1#ifndef NW_MATH_MATRIX44_H_
2#define NW_MATH_MATRIX44_H_
6#if defined(NW_PLATFORM_CAFE)
7 #include <cafe/mtx/mtx44.h>
11#include <nw/math/math_Config.h>
13namespace nw {
namespace math {
61#ifdef NW_MATH_USE_OLDMTX
62 return MTX44FrustumOld(pOut, l, r, b, t, n, f);
64 return MTX44FrustumNew(pOut, l, r, b, t, n, f);
69#ifdef NW_MATH_USE_OLDMTX
70 return MTX44OrthoOld(pOut, l, r, b, t, n, f);
72 return MTX44OrthoNew(pOut, l, r, b, t, n, f);
77#ifdef NW_MATH_USE_OLDMTX
78 return MTX44PerspectiveRadOld(pOut, fovyRad, aspect, n, f);
80 return MTX44PerspectiveRadNew(pOut, fovyRad, aspect, n, f);
116 return MTX44PerspectiveRad(pOut, NW_MATH_DEG_TO_RAD(fovyDeg), aspect, n, f);
122 return MTX44PerspectiveRad(pOut, fovyRad, aspect, n, f);
128 return MTX44PerspectivePivotRad(pOut, NW_MATH_DEG_TO_RAD(fovyDeg), aspect, n, f, pivot);
131#pragma clang diagnostic push
132#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
137 return MTX44RotXYZIdx(pOut, NW_MATH_RAD_TO_IDX(fRadX), NW_MATH_RAD_TO_IDX(fRadY), NW_MATH_RAD_TO_IDX(fRadZ));
143 return MTX44RotXYZIdx(pOut, NW_MATH_DEG_TO_IDX(fDegX), NW_MATH_DEG_TO_IDX(fDegY), NW_MATH_DEG_TO_IDX(fDegZ));
149 return MTX44RotAxisIdx(pOut, pAxis, NW_MATH_RAD_TO_IDX(fRad));
155 return MTX44RotAxisIdx(pOut, pAxis, NW_MATH_DEG_TO_IDX(fDeg));
158#pragma clang diagnostic pop
196 static const MTX44 identity(
197 1.0f, 0.0f, 0.0f, 0.0f,
198 0.0f, 1.0f, 0.0f, 0.0f,
199 0.0f, 0.0f, 1.0f, 0.0f,
200 0.0f, 0.0f, 0.0f, 1.0f);
215 f._30 = f._31 = f._32 = 0.f; f._33 = 1.f;
222 MTX44(f32 x00, f32 x01, f32 x02, f32 x03,
223 f32 x10, f32 x11, f32 x12, f32 x13,
224 f32 x20, f32 x21, f32 x22, f32 x23,
225 f32 x30, f32 x31, f32 x32, f32 x33)
227 f._00 = x00; f._01 = x01; f._02 = x02; f._03 = x03;
228 f._10 = x10; f._11 = x11; f._12 = x12; f._13 = x13;
229 f._20 = x20; f._21 = x21; f._22 = x22; f._23 = x23;
230 f._30 = x30; f._31 = x31; f._32 = x32; f._33 = x33;
239 template <
typename ToPtr>
242 return reinterpret_cast<
ToPtr>(
this );
245 template <
typename ToPtr>
248 return reinterpret_cast<
ToPtr>(
this );
277 return *
reinterpret_cast<
VEC4*>(&
this->
v[
index]);
282 return *
reinterpret_cast<
const VEC4*>(&
this->
v[
index]);
387namespace nw {
namespace math {
418#include <nw/math/math_Vector3.h>
420namespace nw {
namespace math {
425VEC3Transform(VEC4* pOut,
const MTX44* pM,
const VEC3* pV)
428 tmp.x = pM->f._00 * pV->x + pM->f._01 * pV->y + pM->f._02 * pV->z + pM->f._03;
429 tmp.y = pM->f._10 * pV->x + pM->f._11 * pV->y + pM->f._12 * pV->z + pM->f._13;
430 tmp.z = pM->f._20 * pV->x + pM->f._21 * pV->y + pM->f._22 * pV->z + pM->f._23;
431 tmp.w = pM->f._30 * pV->x + pM->f._31 * pV->y + pM->f._32 * pV->z + pM->f._33;
444 pOut->f._00 = p1->f._00 + p2->f._00;
445 pOut->f._01 = p1->f._01 + p2->f._01;
446 pOut->f._02 = p1->f._02 + p2->f._02;
447 pOut->f._03 = p1->f._03 + p2->f._03;
449 pOut->f._10 = p1->f._10 + p2->f._10;
450 pOut->f._11 = p1->f._11 + p2->f._11;
451 pOut->f._12 = p1->f._12 + p2->f._12;
452 pOut->f._13 = p1->f._13 + p2->f._13;
454 pOut->f._20 = p1->f._20 + p2->f._20;
455 pOut->f._21 = p1->f._21 + p2->f._21;
456 pOut->f._22 = p1->f._22 + p2->f._22;
457 pOut->f._23 = p1->f._23 + p2->f._23;
459 pOut->f._30 = p1->f._30 + p2->f._30;
460 pOut->f._31 = p1->f._31 + p2->f._31;
461 pOut->f._32 = p1->f._32 + p2->f._32;
462 pOut->f._33 = p1->f._33 + p2->f._33;
470 pOut->f._00 = p1->f._00 - p2->f._00;
471 pOut->f._01 = p1->f._01 - p2->f._01;
472 pOut->f._02 = p1->f._02 - p2->f._02;
473 pOut->f._03 = p1->f._03 - p2->f._03;
475 pOut->f._10 = p1->f._10 - p2->f._10;
476 pOut->f._11 = p1->f._11 - p2->f._11;
477 pOut->f._12 = p1->f._12 - p2->f._12;
478 pOut->f._13 = p1->f._13 - p2->f._13;
480 pOut->f._20 = p1->f._20 - p2->f._20;
481 pOut->f._21 = p1->f._21 - p2->f._21;
482 pOut->f._22 = p1->f._22 - p2->f._22;
483 pOut->f._23 = p1->f._23 - p2->f._23;
485 pOut->f._30 = p1->f._30 - p2->f._30;
486 pOut->f._31 = p1->f._31 - p2->f._31;
487 pOut->f._32 = p1->f._32 - p2->f._32;
488 pOut->f._33 = p1->f._33 - p2->f._33;
496 pOut->f._00 = p->f._00 * f;
497 pOut->f._01 = p->f._01 * f;
498 pOut->f._02 = p->f._02 * f;
499 pOut->f._03 = p->f._03 * f;
501 pOut->f._10 = p->f._10 * f;
502 pOut->f._11 = p->f._11 * f;
503 pOut->f._12 = p->f._12 * f;
504 pOut->f._13 = p->f._13 * f;
506 pOut->f._20 = p->f._20 * f;
507 pOut->f._21 = p->f._21 * f;
508 pOut->f._22 = p->f._22 * f;
509 pOut->f._23 = p->f._23 * f;
511 pOut->f._30 = p->f._30 * f;
512 pOut->f._31 = p->f._31 * f;
513 pOut->f._32 = p->f._32 * f;
514 pOut->f._33 = p->f._33 * f;
524 MTX44*
__restrict pDst = ( pOut == p1 || pOut == p2 ) ? &mTmp : pOut;
526 pDst->f._00 = p1->f._00 * p2->f._00 + p1->f._01 * p2->f._10 + p1->f._02 * p2->f._20 + p1->f._03 * p2->f._30;
527 pDst->f._01 = p1->f._00 * p2->f._01 + p1->f._01 * p2->f._11 + p1->f._02 * p2->f._21 + p1->f._03 * p2->f._31;
528 pDst->f._02 = p1->f._00 * p2->f._02 + p1->f._01 * p2->f._12 + p1->f._02 * p2->f._22 + p1->f._03 * p2->f._32;
529 pDst->f._03 = p1->f._00 * p2->f._03 + p1->f._01 * p2->f._13 + p1->f._02 * p2->f._23 + p1->f._03 * p2->f._33;
531 pDst->f._10 = p1->f._10 * p2->f._00 + p1->f._11 * p2->f._10 + p1->f._12 * p2->f._20 + p1->f._13 * p2->f._30;
532 pDst->f._11 = p1->f._10 * p2->f._01 + p1->f._11 * p2->f._11 + p1->f._12 * p2->f._21 + p1->f._13 * p2->f._31;
533 pDst->f._12 = p1->f._10 * p2->f._02 + p1->f._11 * p2->f._12 + p1->f._12 * p2->f._22 + p1->f._13 * p2->f._32;
534 pDst->f._13 = p1->f._10 * p2->f._03 + p1->f._11 * p2->f._13 + p1->f._12 * p2->f._23 + p1->f._13 * p2->f._33;
536 pDst->f._20 = p1->f._20 * p2->f._00 + p1->f._21 * p2->f._10 + p1->f._22 * p2->f._20 + p1->f._23 * p2->f._30;
537 pDst->f._21 = p1->f._20 * p2->f._01 + p1->f._21 * p2->f._11 + p1->f._22 * p2->f._21 + p1->f._23 * p2->f._31;
538 pDst->f._22 = p1->f._20 * p2->f._02 + p1->f._21 * p2->f._12 + p1->f._22 * p2->f._22 + p1->f._23 * p2->f._32;
539 pDst->f._23 = p1->f._20 * p2->f._03 + p1->f._21 * p2->f._13 + p1->f._22 * p2->f._23 + p1->f._23 * p2->f._33;
541 pDst->f._30 = p1->f._30 * p2->f._00 + p1->f._31 * p2->f._10 + p1->f._32 * p2->f._20 + p1->f._33 * p2->f._30;
542 pDst->f._31 = p1->f._30 * p2->f._01 + p1->f._31 * p2->f._11 + p1->f._32 * p2->f._21 + p1->f._33 * p2->f._31;
543 pDst->f._32 = p1->f._30 * p2->f._02 + p1->f._31 * p2->f._12 + p1->f._32 * p2->f._22 + p1->f._33 * p2->f._32;
544 pDst->f._33 = p1->f._30 * p2->f._03 + p1->f._31 * p2->f._13 + p1->f._32 * p2->f._23 + p1->f._33 * p2->f._33;
557 pOut->f._00 = pM->f._00 * pS->x;
558 pOut->f._10 = pM->f._10 * pS->x;
559 pOut->f._20 = pM->f._20 * pS->x;
560 pOut->f._30 = pM->f._30 * pS->x;
562 pOut->f._01 = pM->f._01 * pS->y;
563 pOut->f._11 = pM->f._11 * pS->y;
564 pOut->f._21 = pM->f._21 * pS->y;
565 pOut->f._31 = pM->f._31 * pS->y;
567 pOut->f._02 = pM->f._02 * pS->z;
568 pOut->f._12 = pM->f._12 * pS->z;
569 pOut->f._22 = pM->f._22 * pS->z;
570 pOut->f._32 = pM->f._32 * pS->z;
574 pOut->f._03 = pM->f._03;
575 pOut->f._13 = pM->f._13;
576 pOut->f._23 = pM->f._23;
577 pOut->f._33 = pM->f._33;
586 const f32 (*
const src)[4] = pM->m;
587 f32 (*
const dst)[4] = pOut->m;
589 dst[0][0] = src[0][0] * pS->x;
590 dst[0][1] = src[0][1] * pS->x;
591 dst[0][2] = src[0][2] * pS->x;
592 dst[0][3] = src[0][3] * pS->x;
594 dst[1][0] = src[1][0] * pS->y;
595 dst[1][1] = src[1][1] * pS->y;
596 dst[1][2] = src[1][2] * pS->y;
597 dst[1][3] = src[1][3] * pS->y;
599 dst[2][0] = src[2][0] * pS->z;
600 dst[2][1] = src[2][1] * pS->z;
601 dst[2][2] = src[2][2] * pS->z;
602 dst[2][3] = src[2][3] * pS->z;
606 dst[3][0] = src[3][0];
607 dst[3][1] = src[3][1];
608 dst[3][2] = src[3][2];
609 dst[3][3] = src[3][3];
617#if defined(NW_MATH_ENABLE_INTRINSICS)
912VEC3Transform(VEC4* pOut,
const MTX44* pM,
const VEC3* pV)
920 return VEC3Transform(pOut,
reinterpret_cast<
const MTX34*>(pM), pV);
947 pOut->f._00 = pOut->f._01 = pOut->f._02 = pOut->f._03 =
948 pOut->f._10 = pOut->f._11 = pOut->f._12 = pOut->f._13 =
949 pOut->f._20 = pOut->f._21 = pOut->f._22 = pOut->f._23 =
950 pOut->f._30 = pOut->f._31 = pOut->f._32 = pOut->f._33 = 0.f;
995 return p->f._00 == 1.f && p->f._01 == 0.f && p->f._02 == 0.f && p->f._03 == 0.f &&
996 p->f._10 == 0.f && p->f._11 == 1.f && p->f._12 == 0.f && p->f._13 == 0.f &&
997 p->f._20 == 0.f && p->f._21 == 0.f && p->f._22 == 1.f && p->f._23 == 0.f &&
998 p->f._30 == 0.f && p->f._31 == 0.f && p->f._32 == 0.f && p->f._33 == 1.f;
1010 pOut->f._00 = pSrc->f._00;
1011 pOut->f._11 = pSrc->f._11;
1012 pOut->f._22 = pSrc->f._22;
1013 pOut->f._33 = pSrc->f._33;
1018 tmp.f._01 = pSrc->f._01;
1019 tmp.f._02 = pSrc->f._02;
1020 tmp.f._03 = pSrc->f._03;
1021 tmp.f._12 = pSrc->f._12;
1022 tmp.f._13 = pSrc->f._13;
1023 tmp.f._23 = pSrc->f._23;
1026 pOut->f._01 = pSrc->f._10;
1027 pOut->f._02 = pSrc->f._20;
1028 pOut->f._03 = pSrc->f._30;
1029 pOut->f._12 = pSrc->f._21;
1030 pOut->f._13 = pSrc->f._31;
1031 pOut->f._23 = pSrc->f._32;
1033 pOut->f._10 = pMtx->f._01;
1034 pOut->f._20 = pMtx->f._02;
1035 pOut->f._30 = pMtx->f._03;
1036 pOut->f._21 = pMtx->f._12;
1037 pOut->f._31 = pMtx->f._13;
1038 pOut->f._32 = pMtx->f._23;
1046 f32 (*
const m)[4] = pOut->m;
1050 const f32 angle = fovyRad * 0.5f;
1052 const f32 cot = 1.0f / ::std::tan(angle);
1054 m[0][0] = cot / aspect;
1067 const f32 tmp = -1.0f / (f - n);
1068 m[2][2] = (f + n) * tmp;
1069 m[2][3] = (2 * f * n) * tmp;
1082 f32 (*
const m)[4] = pOut->m;
1086 const f32 angle = fovyRad * 0.5f;
1088 const f32 cot = 1.0f / ::std::tan(angle);
1090 m[0][0] = cot / aspect;
1103 const f32 tmp = -1.0f / (f - n);
1105 m[2][3] = f * n * tmp;
1120 f32 (*
const m)[4] = pOut->m;
1121 f32 tmp = 1.0f / (r - l);
1122 m[0][0] = (2*n) * tmp;
1124 m[0][2] = (r + l) * tmp;
1127 tmp = 1.0f / (t - b);
1129 m[1][1] = (2*n) * tmp;
1130 m[1][2] = (t + b) * tmp;
1136 tmp = -1.0f / (f - n);
1137 m[2][2] = (f + n) * tmp;
1138 m[2][3] = (2 * f * n) * tmp;
1153 f32 (*
const m)[4] = pOut->m;
1154 f32 tmp = 1.0f / (r - l);
1155 m[0][0] = (2*n) * tmp;
1157 m[0][2] = (r + l) * tmp;
1160 tmp = 1.0f / (t - b);
1162 m[1][1] = (2*n) * tmp;
1163 m[1][2] = (t + b) * tmp;
1169 tmp = -1.0f / (f - n);
1172 m[2][3] = f * n * tmp;
1187 f32 (*
const m)[4] = pOut->m;
1188 f32 tmp = 1.0f / (r - l);
1189 m[0][0] = 2.0f * tmp;
1192 m[0][3] = -(r + l) * tmp;
1194 tmp = 1.0f / (t - b);
1196 m[1][1] = 2.0f * tmp;
1198 m[1][3] = -(t + b) * tmp;
1203 tmp = -1.0f / (f - n);
1204 m[2][2] = 2.0f * tmp;
1205 m[2][3] = (f + n) * tmp;
1220 f32 (*
const m)[4] = pOut->m;
1221 f32 tmp = 1.0f / (r - l);
1222 m[0][0] = 2.0f * tmp;
1225 m[0][3] = -(r + l) * tmp;
1227 tmp = 1.0f / (t - b);
1229 m[1][1] = 2.0f * tmp;
1231 m[1][3] = -(t + b) * tmp;
1236 tmp = -1.0f / (f - n);
1253 const f32 PIVOT_ROTATION_SIN_COS[ PIVOT_NUM ][ 2 ] =
1267 f32 sin = PIVOT_ROTATION_SIN_COS[ pivot ][ 0 ];
1268 f32 cos = PIVOT_ROTATION_SIN_COS[ pivot ][ 1 ];
1270 f32 (*
const m)[4] = pOut->m;
1274 m[0][0] = cos * m[0][0];
1275 m[0][1] = cos * m[0][1];
1276 m[0][2] = cos * m[0][2];
1277 m[0][3] = cos * m[0][3];
1279 m[1][0] = cos * m[1][0];
1280 m[1][1] = cos * m[1][1];
1281 m[1][2] = cos * m[1][2];
1282 m[1][3] = cos * m[1][3];
1287 m[0][0] = -sin * m[1][0];
1288 m[1][0] = sin * tmp;
1291 m[0][1] = -sin * m[1][1];
1292 m[1][1] = sin * tmp;
1295 m[0][2] = -sin * m[1][2];
1296 m[1][2] = sin * tmp;
1299 m[0][3] = -sin * m[1][3];
1300 m[1][3] = sin * tmp;
1311 MTX44Pivot( pOut, pivot );
1320 MTX44Pivot( pOut, pivot );
1329 MTX44Pivot( pOut, pivot );
1343 MTX44* pOutBase = pOut;
1345 for ( s32 i = 0 ; i < count ; i++ )
1357 inline void SwapF(f32 &a, f32 &b)
1380 for (
int i = 0; i < 4; ++i)
1386 for(
int k = i ; k < 4 ; k++ )
1389 ftmp = ::std::fabs(src[k][i]);
1407 for (
int k = 0; k < 4; k++)
1409 SwapF(src[i][k], src[swp][k]);
1410 SwapF(inv[i][k], inv[swp][k]);
1416 w = 1.0f / src[i][i];
1417 for (
int j = 0; j < 4; ++j)
1423 for (
int k = 0; k < 4; ++k )
1429 for (
int j = 0; j < 4; ++j)
1431 src[k][j] -= src[i][j] * w;
1432 inv[k][j] -= inv[i][j] * w;
1441MTX44RotAxisRad_(
MTX44* pOut,
const VEC3 *pAxis, f32 fRad )
1450 f32 (*
const m)[4] = pOut->m;
1452 s = ::std::sin(fRad);
1453 c = ::std::cos(fRad);
1466 m[0][0] = ( t * xSq ) + ( c );
1467 m[0][1] = ( t * x * y ) - ( s * z );
1468 m[0][2] = ( t * x * z ) + ( s * y );
1471 m[1][0] = ( t * x * y ) + ( s * z );
1472 m[1][1] = ( t * ySq ) + ( c );
1473 m[1][2] = ( t * y * z ) - ( s * x );
1476 m[2][0] = ( t * x * z ) - ( s * y );
1477 m[2][1] = ( t * y * z ) + ( s * x );
1478 m[2][2] = ( t * zSq ) + ( c );
1489#pragma clang diagnostic push
1490#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
1493MTX44RotAxisIdx(
MTX44* pOut,
const VEC3* pAxis, u32 idx)
1495 MTX44RotAxisRad_(pOut, pAxis, NW_MATH_IDX_TO_RAD(idx));
1499#pragma clang diagnostic pop
1509 SinCosIdx(&sinx, &cosx, idxX);
1510 SinCosIdx(&siny, &cosy, idxY);
1511 SinCosIdx(&sinz, &cosz, idxZ);
1513 pOut->f._20 = -siny;
1514 pOut->f._00 = cosz * cosy;
1515 pOut->f._10 = sinz * cosy;
1516 pOut->f._21 = cosy * sinx;
1517 pOut->f._22 = cosy * cosx;
1522 pOut->f._01 = f2 * siny - f1;
1523 pOut->f._12 = f1 * siny - f2;
1527 pOut->f._02 = f2 * siny + f1;
1528 pOut->f._11 = f1 * siny + f2;
1545 f32 (*
const m)[4] = pOut->m;
1547 m[0][0] = pS->x; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;
1548 m[1][0] = 0.0f; m[1][1] = pS->y; m[1][2] = 0.0f; m[1][3] = 0.0f;
1549 m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = pS->z; m[2][3] = 0.0f;
1550 m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
1568MTX44Translate(
MTX44* pOut,
const VEC3* pT)
1570 f32 (*
const m)[4] = pOut->m;
1572 m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = pT->x;
1573 m[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = pT->y;
1574 m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = pT->z;
1575 m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
1583 const f32 (*
const src)[4] = pM->m;
1584 f32 (*
const dst)[4] = pOut->m;
1588 dst[0][0] = src[0][0]; dst[0][1] = src[0][1]; dst[0][2] = src[0][2];
1589 dst[1][0] = src[1][0]; dst[1][1] = src[1][1]; dst[1][2] = src[1][2];
1590 dst[2][0] = src[2][0]; dst[2][1] = src[2][1]; dst[2][2] = src[2][2];
1593 dst[0][3] = src[0][3] + pT->x;
1594 dst[1][3] = src[1][3] + pT->y;
1595 dst[2][3] = src[2][3] + pT->z;
1610 VEC3Transform(&tmp, pM, pT);
1612 pOut->f._03 = tmp.x;
1613 pOut->f._13 = tmp.y;
1614 pOut->f._23 = tmp.z;
#define NW_MATH_AS_INLINE
Definition math_Config.h:6
#define NW_MATH_INLINE
Definition math_Config.h:7
#define NW_MATH_IMPL_NS
Definition math_Config.h:14
Definition math_Matrix34.h:26
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *__restrict p1, const MTX44 *__restrict p2)
MTX44 * MTX44MultScale(MTX44 *pOut, const VEC3 *pS, const MTX44 *pM)
MTX44 * MTX44Add(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44Sub(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44MultScale(MTX44 *pOut, const MTX44 *pM, const VEC3 *pS)
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *p, f32 f)
VEC4 * VEC3Transform(VEC4 *pOut, const MTX44 *pM, const VEC3 *pV)
Definition math_Matrix34.h:11
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *p, f32 f)
MTX44 * MTX44MultScale(MTX44 *pOut, const VEC3 *pS, const MTX44 *pM)
VEC4 * VEC3Transform(VEC4 *pOut, const MTX44 *pM, const VEC3 *pV)
MTX44 * MTX44MultScale(MTX44 *pOut, const MTX44 *pM, const VEC3 *pS)
MTX44 * MTX44Add(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44Sub(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *__restrict p1, const MTX44 *__restrict p2)
Definition math_Triangular.cpp:3
Definition math_Constant.cpp:5
NW_MATH_INLINE MTX44 * MTX44Frustum(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
Definition math_Matrix44.h:59
NW_MATH_INLINE MTX44 * MTX44FrustumOld(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
NW_MATH_INLINE MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44Transpose(MTX44 *pOut, const MTX44 &m)
Definition math_Matrix44.h:397
MTX44 * MTX44RotAxisIdx(MTX44 *pOut, const VEC3 &vAxis, u32 idx)
Definition math_Matrix44.h:401
MTX44 * MTX44MultArray(MTX44 *pOut, const MTX44 &m1, const MTX44 *pSrc, s32 count)
Definition math_Matrix44.h:398
MTX44 * MTX44MultScale(MTX44 *pOut, const VEC3 &S, const MTX44 &M)
Definition math_Matrix44.h:407
MTX44 * MTX44MultTranslate(MTX44 *pOut, const MTX44 &M, const VEC3 &T)
Definition math_Matrix44.h:410
MTX44 * MTX44PerspectiveDeg(MTX44 *pOut, f32 fovyDeg, f32 aspect, f32 n, f32 f)
Definition math_Matrix44.h:114
NW_MATH_INLINE MTX44 * MTX44PerspectivePivotRad(MTX44 *pOut, f32 fovyRad, f32 aspect, f32 n, f32 f, PivotDirection pivot=PIVOT_NONE)
MTX44 * MTX44Add(MTX44 *pOut, const MTX44 &m1, const MTX44 &m2)
Definition math_Matrix44.h:392
MTX44 * MTX44Copy(MTX44 *pOut, const MTX44 &m)
Definition math_Matrix44.h:389
MTX44 * MTX44Scale(MTX44 *pOut, const VEC3 &S)
Definition math_Matrix44.h:405
NW_MATH_INLINE MTX44 * MTX44FrustumNew(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
MTX44 * MTX44RotAxisRad(MTX44 *pOut, const VEC3 *pAxis, f32 fRad)
Definition math_Matrix44.h:147
NW_MATH_INLINE MTX44 * MTX44FrustumPivot(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f, PivotDirection pivot=PIVOT_NONE)
NW_MATH_INLINE MTX44 * MTX44MultScale(MTX44 *pOut, const MTX44 *pM, const VEC3 *pS)
NW_MATH_INLINE MTX44 * MTX44Add(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 &m1, const MTX44 &m2)
Definition math_Matrix44.h:395
NW_MATH_INLINE MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 *p, f32 f)
NW_MATH_INLINE MTX44 * MTX44Identity(MTX44 *pOut)
NW_MATH_INLINE MTX44 * MTX44RotAxisIdx(MTX44 *pOut, const VEC3 *pAxis, u32 idx)
NW_MATH_INLINE MTX44 * MTX44OrthoNew(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
NW_MATH_INLINE VEC3 * VEC3Normalize(VEC3 *pOut, const VEC3 *p)
NW_MATH_INLINE MTX44 * MTX44Transpose(MTX44 *pOut, const MTX44 *pSrc)
NW_MATH_INLINE MTX44 * MTX44Ortho(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
Definition math_Matrix44.h:67
MTX44 * MTX44Mult(MTX44 *pOut, const MTX44 &m, f32 f)
Definition math_Matrix44.h:394
NW_MATH_INLINE MTX44 * MTX44MultTranslate(MTX44 *pOut, const VEC3 *pT, const MTX44 *pM)
struct MTX44 Matrix44
Definition math_Matrix44.h:383
NW_MATH_INLINE MTX44 * MTX44MultArray(MTX44 *pOut, const MTX44 *p1, const MTX44 *pSrc, s32 count)
NW_MATH_INLINE MTX44 * MTX44Copy(MTX44 *pOut, const MTX44 *p)
NW_MATH_INLINE MTX44 * MTX44Zero(MTX44 *pOut)
NW_MATH_INLINE MTX44 * MTX44Scale(MTX44 *pOut, const VEC3 *pS)
NW_MATH_INLINE MTX44 * MTX44Translate(MTX44 *pOut, const VEC3 *pT)
bool MTX44IsIdentity(const MTX44 &m)
Definition math_Matrix44.h:390
MTX44 * MTX44RotXYZRad(MTX44 *pOut, f32 fRadX, f32 fRadY, f32 fRadZ)
Definition math_Matrix44.h:135
NW_MATH_INLINE MTX44 * MTX44PerspectiveRadNew(MTX44 *pOut, f32 fovyRad, f32 aspect, f32 n, f32 f)
MTX44 * MTX44PerspectivePivotDeg(MTX44 *pOut, f32 fovyDeg, f32 aspect, f32 n, f32 f, PivotDirection pivot=PIVOT_NONE)
Definition math_Matrix44.h:126
MTX44 * MTX44Perspective(MTX44 *pOut, f32 fovyRad, f32 aspect, f32 n, f32 f)
Definition math_Matrix44.h:120
NW_MATH_INLINE MTX44 * MTX44PerspectiveRad(MTX44 *pOut, f32 fovyRad, f32 aspect, f32 n, f32 f)
Definition math_Matrix44.h:75
MTX44 * MTX44Sub(MTX44 *pOut, const MTX44 &m1, const MTX44 &m2)
Definition math_Matrix44.h:393
NW_MATH_INLINE MTX44 * MTX44MultTranslate(MTX44 *pOut, const MTX44 *pM, const VEC3 *pT)
NW_MATH_INLINE MTX44 * MTX44PerspectiveRadOld(MTX44 *pOut, f32 fovyRad, f32 aspect, f32 n, f32 f)
NW_MATH_INLINE MTX44 * MTX44Sub(MTX44 *pOut, const MTX44 *p1, const MTX44 *p2)
MTX44 * MTX44RotAxisRad(MTX44 *pOut, const VEC3 &vAxis, f32 fRad)
Definition math_Matrix44.h:402
PivotDirection
Definition math_Matrix44.h:100
@ PIVOT_UPSIDE_TO_TOP
Definition math_Matrix44.h:102
@ PIVOT_NONE
Definition math_Matrix44.h:101
@ PIVOT_NUM
Definition math_Matrix44.h:106
@ PIVOT_UPSIDE_TO_BOTTOM
Definition math_Matrix44.h:104
@ PIVOT_UPSIDE_TO_LEFT
Definition math_Matrix44.h:105
@ PIVOT_UPSIDE_TO_RIGHT
Definition math_Matrix44.h:103
MTX44 * MTX44Translate(MTX44 *pOut, const VEC3 &T)
Definition math_Matrix44.h:409
NW_MATH_INLINE MTX44 * MTX44OrthoOld(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f)
NW_MATH_INLINE MTX44 * MTX44OrthoPivot(MTX44 *pOut, f32 l, f32 r, f32 b, f32 t, f32 n, f32 f, PivotDirection pivot=PIVOT_NONE)
u32 MTX44Inverse(MTX44 *pOut, const MTX44 &m)
Definition math_Matrix44.h:399
MTX44 * MTX44RotAxisDeg(MTX44 *pOut, const VEC3 *pAxis, f32 fDeg)
Definition math_Matrix44.h:153
MTX44 * MTX44MultScale(MTX44 *pOut, const MTX44 &M, const VEC3 &S)
Definition math_Matrix44.h:406
NW_MATH_INLINE u32 MTX44Inverse(MTX44 *pOut, const MTX44 *p)
NW_MATH_INLINE MTX44 * MTX44MultScale(MTX44 *pOut, const VEC3 *pS, const MTX44 *pM)
MTX44 * MTX44MultTranslate(MTX44 *pOut, const VEC3 &T, const MTX44 &M)
Definition math_Matrix44.h:411
NW_MATH_INLINE MTX44 * MTX44RotXYZIdx(MTX44 *pOut, u32 idxX, u32 idxY, u32 idxZ)
MTX44 * MTX44RotAxisDeg(MTX44 *pOut, const VEC3 &vAxis, f32 fDeg)
Definition math_Matrix44.h:403
MTX44 * MTX44RotXYZDeg(MTX44 *pOut, f32 fDegX, f32 fDegY, f32 fDegZ)
Definition math_Matrix44.h:141
NW_MATH_INLINE bool MTX44IsIdentity(const MTX44 *p)
Definition math_Constant.cpp:5
Definition math_Matrix34.h:136
Definition math_Matrix44.h:165
f32 _00
Definition math_Matrix44.h:166
f32 _12
Definition math_Matrix44.h:167
f32 _31
Definition math_Matrix44.h:169
f32 _33
Definition math_Matrix44.h:169
f32 _30
Definition math_Matrix44.h:169
f32 _13
Definition math_Matrix44.h:167
f32 _22
Definition math_Matrix44.h:168
f32 _21
Definition math_Matrix44.h:168
f32 _02
Definition math_Matrix44.h:166
f32 _32
Definition math_Matrix44.h:169
f32 _01
Definition math_Matrix44.h:166
f32 _11
Definition math_Matrix44.h:167
f32 _10
Definition math_Matrix44.h:167
f32 _03
Definition math_Matrix44.h:166
f32 _23
Definition math_Matrix44.h:168
f32 _20
Definition math_Matrix44.h:168
Definition math_Matrix44.h:163
f32 _02
Definition math_Matrix44.h:176
f32 a[16]
Definition math_Matrix44.h:183
f32 _00
Definition math_Matrix44.h:176
f32 _32
Definition math_Matrix44.h:179
f32 _20
Definition math_Matrix44.h:178
f32 _10
Definition math_Matrix44.h:177
f32 m[4][4]
Definition math_Matrix44.h:182
f32 _03
Definition math_Matrix44.h:176
f32 _31
Definition math_Matrix44.h:179
f32 _12
Definition math_Matrix44.h:177
f32 _33
Definition math_Matrix44.h:179
f32 _23
Definition math_Matrix44.h:178
f32 _22
Definition math_Matrix44.h:178
f32 _13
Definition math_Matrix44.h:177
f32 _30
Definition math_Matrix44.h:179
VEC4_ v[4]
Definition math_Matrix44.h:184
f32 _21
Definition math_Matrix44.h:178
f32 _01
Definition math_Matrix44.h:176
f32 _11
Definition math_Matrix44.h:177
BaseData f
Definition math_Matrix44.h:181
Definition math_Matrix44.h:189
MTX44 & operator=(const MTX44 &other)=default
MTX44(f32 x00, f32 x01, f32 x02, f32 x03, f32 x10, f32 x11, f32 x12, f32 x13, f32 x20, f32 x21, f32 x22, f32 x23, f32 x30, f32 x31, f32 x32, f32 x33)
Definition math_Matrix44.h:222
MTX44(const MTX34 &rhs)
Definition math_Matrix44.h:212
MTX44 self_type
Definition math_Matrix44.h:204
MTX44(const MTX44 &rhs)
Definition math_Matrix44.h:218
f32 value_type
Definition math_Matrix44.h:205
static const MTX44 & Identity()
Definition math_Matrix44.h:194
static const int ROW_COUNT
Definition math_Matrix44.h:191
static const int COLUMN_COUNT
Definition math_Matrix44.h:192
MTX44()
Definition math_Matrix44.h:208
MTX44(const f32 *p)
Definition math_Matrix44.h:210
Definition math_Vector3.h:62