17 #ifndef _VECTORMATH_VEC_AOS_CPP_H
18 #define _VECTORMATH_VEC_AOS_CPP_H
23 #define _VECTORMATH_SLERP_TOL 0.999f
28 #ifndef _VECTORMATH_INTERNAL_FUNCTIONS
29 #define _VECTORMATH_INTERNAL_FUNCTIONS
33 namespace Vectormath {
66 return Vector3( 1.0f, 0.0f, 0.0f );
71 return Vector3( 0.0f, 1.0f, 0.0f );
76 return Vector3( 0.0f, 0.0f, 1.0f );
79 inline const Vector3
lerp(
float t,
const Vector3 & vec0,
const Vector3 & vec1 )
81 return ( vec0 + ( ( vec1 - vec0 ) * t ) );
84 inline const Vector3
slerp(
float t,
const Vector3 & unitVec0,
const Vector3 & unitVec1 )
86 float recipSinAngle, scale0, scale1, cosAngle, angle;
87 cosAngle =
dot( unitVec0, unitVec1 );
89 angle = acosf( cosAngle );
90 recipSinAngle = ( 1.0f / sinf( angle ) );
91 scale0 = ( sinf( ( ( 1.0f - t ) * angle ) ) * recipSinAngle );
92 scale1 = ( sinf( ( t * angle ) ) * recipSinAngle );
94 scale0 = ( 1.0f - t );
97 return ( ( unitVec0 * scale0 ) + ( unitVec1 * scale1 ) );
100 inline void loadXYZ( Vector3 & vec,
const float * fptr )
102 vec = Vector3( fptr[0], fptr[1], fptr[2] );
105 inline void storeXYZ(
const Vector3 & vec,
float * fptr )
107 fptr[0] = vec.getX();
108 fptr[1] = vec.getY();
109 fptr[2] = vec.getZ();
112 inline void loadHalfFloats( Vector3 & vec,
const unsigned short * hfptr )
119 for (
int i = 0; i < 3; i++) {
120 unsigned short fp16 = hfptr[i];
121 unsigned int sign = fp16 >> 15;
122 unsigned int exponent = (fp16 >> 10) & ((1 << 5) - 1);
123 unsigned int mantissa = fp16 & ((1 << 10) - 1);
129 }
else if (exponent == 31) {
135 exponent += 127 - 15;
140 d.u32 = (sign << 31) | (exponent << 23) | mantissa;
145 inline void storeHalfFloats(
const Vector3 & vec,
unsigned short * hfptr )
152 for (
int i = 0; i < 3; i++) {
156 unsigned int sign = d.u32 >> 31;
157 unsigned int exponent = (d.u32 >> 23) & ((1 << 8) - 1);
158 unsigned int mantissa = d.u32 & ((1 << 23) - 1);;
164 }
else if (exponent == 255 && mantissa != 0) {
169 }
else if (exponent >= 127 - 15 + 31) {
174 }
else if (exponent <= 127 - 15) {
180 exponent -= 127 - 15;
184 hfptr[i] = (
unsigned short)((sign << 15) | (exponent << 10) | mantissa);
231 *(&
mX + idx) = value;
300 *
this = *
this * scalar;
315 *
this = *
this / scalar;
328 inline const Vector3
operator *(
float scalar,
const Vector3 & vec )
333 inline const Vector3
mulPerElem(
const Vector3 & vec0,
const Vector3 & vec1 )
336 ( vec0.getX() * vec1.getX() ),
337 ( vec0.getY() * vec1.getY() ),
338 ( vec0.getZ() * vec1.getZ() )
342 inline const Vector3
divPerElem(
const Vector3 & vec0,
const Vector3 & vec1 )
345 ( vec0.getX() / vec1.getX() ),
346 ( vec0.getY() / vec1.getY() ),
347 ( vec0.getZ() / vec1.getZ() )
351 inline const Vector3
recipPerElem(
const Vector3 & vec )
354 ( 1.0f / vec.getX() ),
355 ( 1.0f / vec.getY() ),
356 ( 1.0f / vec.getZ() )
360 inline const Vector3
sqrtPerElem(
const Vector3 & vec )
369 inline const Vector3
rsqrtPerElem(
const Vector3 & vec )
372 ( 1.0f / sqrtf( vec.getX() ) ),
373 ( 1.0f / sqrtf( vec.getY() ) ),
374 ( 1.0f / sqrtf( vec.getZ() ) )
378 inline const Vector3
absPerElem(
const Vector3 & vec )
387 inline const Vector3
copySignPerElem(
const Vector3 & vec0,
const Vector3 & vec1 )
390 ( vec1.getX() < 0.0f )? -fabsf( vec0.getX() ) : fabsf( vec0.getX() ),
391 ( vec1.getY() < 0.0f )? -fabsf( vec0.getY() ) : fabsf( vec0.getY() ),
392 ( vec1.getZ() < 0.0f )? -fabsf( vec0.getZ() ) : fabsf( vec0.getZ() )
396 inline const Vector3
maxPerElem(
const Vector3 & vec0,
const Vector3 & vec1 )
399 (vec0.getX() > vec1.getX())? vec0.getX() : vec1.getX(),
400 (vec0.getY() > vec1.getY())? vec0.getY() : vec1.getY(),
401 (vec0.getZ() > vec1.getZ())? vec0.getZ() : vec1.getZ()
405 inline float maxElem(
const Vector3 & vec )
408 result = (vec.getX() > vec.getY())? vec.getX() : vec.getY();
409 result = (vec.getZ() > result)? vec.getZ() : result;
413 inline const Vector3
minPerElem(
const Vector3 & vec0,
const Vector3 & vec1 )
416 (vec0.getX() < vec1.getX())? vec0.getX() : vec1.getX(),
417 (vec0.getY() < vec1.getY())? vec0.getY() : vec1.getY(),
418 (vec0.getZ() < vec1.getZ())? vec0.getZ() : vec1.getZ()
422 inline float minElem(
const Vector3 & vec )
425 result = (vec.getX() < vec.getY())? vec.getX() : vec.getY();
426 result = (vec.getZ() < result)? vec.getZ() : result;
430 inline float sum(
const Vector3 & vec )
433 result = ( vec.getX() + vec.getY() );
434 result = ( result + vec.getZ() );
438 inline float dot(
const Vector3 & vec0,
const Vector3 & vec1 )
441 result = ( vec0.getX() * vec1.getX() );
442 result = ( result + ( vec0.getY() * vec1.getY() ) );
443 result = ( result + ( vec0.getZ() * vec1.getZ() ) );
447 inline float lengthSqr(
const Vector3 & vec )
450 result = ( vec.getX() * vec.getX() );
451 result = ( result + ( vec.getY() * vec.getY() ) );
452 result = ( result + ( vec.getZ() * vec.getZ() ) );
456 inline float length(
const Vector3 & vec )
461 inline const Vector3
normalize(
const Vector3 & vec )
463 float lenSqr, lenInv;
465 lenInv = ( 1.0f / sqrtf( lenSqr ) );
467 ( vec.getX() * lenInv ),
468 ( vec.getY() * lenInv ),
469 ( vec.getZ() * lenInv )
473 inline const Vector3
cross(
const Vector3 & vec0,
const Vector3 & vec1 )
476 ( ( vec0.getY() * vec1.getZ() ) - ( vec0.getZ() * vec1.getY() ) ),
477 ( ( vec0.getZ() * vec1.getX() ) - ( vec0.getX() * vec1.getZ() ) ),
478 ( ( vec0.getX() * vec1.getY() ) - ( vec0.getY() * vec1.getX() ) )
482 inline const Vector3
select(
const Vector3 & vec0,
const Vector3 & vec1,
bool select1 )
485 ( select1 )? vec1.getX() : vec0.getX(),
486 ( select1 )? vec1.getY() : vec0.getY(),
487 ( select1 )? vec1.getZ() : vec0.getZ()
491 #ifdef _VECTORMATH_DEBUG
493 inline void print(
const Vector3 & vec )
495 printf(
"( %f %f %f )\n", vec.getX(), vec.getY(), vec.getZ() );
498 inline void print(
const Vector3 & vec,
const char * name )
500 printf(
"%s: ( %f %f %f )\n", name, vec.getX(), vec.getY(), vec.getZ() );
561 return Vector4( 1.0f, 0.0f, 0.0f, 0.0f );
566 return Vector4( 0.0f, 1.0f, 0.0f, 0.0f );
571 return Vector4( 0.0f, 0.0f, 1.0f, 0.0f );
576 return Vector4( 0.0f, 0.0f, 0.0f, 1.0f );
579 inline const Vector4
lerp(
float t,
const Vector4 & vec0,
const Vector4 & vec1 )
581 return ( vec0 + ( ( vec1 - vec0 ) * t ) );
584 inline const Vector4
slerp(
float t,
const Vector4 & unitVec0,
const Vector4 & unitVec1 )
586 float recipSinAngle, scale0, scale1, cosAngle, angle;
587 cosAngle =
dot( unitVec0, unitVec1 );
589 angle = acosf( cosAngle );
590 recipSinAngle = ( 1.0f / sinf( angle ) );
591 scale0 = ( sinf( ( ( 1.0f - t ) * angle ) ) * recipSinAngle );
592 scale1 = ( sinf( ( t * angle ) ) * recipSinAngle );
594 scale0 = ( 1.0f - t );
597 return ( ( unitVec0 * scale0 ) + ( unitVec1 * scale1 ) );
600 inline void loadXYZW( Vector4 & vec,
const float * fptr )
602 vec = Vector4( fptr[0], fptr[1], fptr[2], fptr[3] );
605 inline void storeXYZW(
const Vector4 & vec,
float * fptr )
607 fptr[0] = vec.getX();
608 fptr[1] = vec.getY();
609 fptr[2] = vec.getZ();
610 fptr[3] = vec.getW();
613 inline void loadHalfFloats( Vector4 & vec,
const unsigned short * hfptr )
620 for (
int i = 0; i < 4; i++) {
621 unsigned short fp16 = hfptr[i];
622 unsigned int sign = fp16 >> 15;
623 unsigned int exponent = (fp16 >> 10) & ((1 << 5) - 1);
624 unsigned int mantissa = fp16 & ((1 << 10) - 1);
630 }
else if (exponent == 31) {
636 exponent += 127 - 15;
641 d.u32 = (sign << 31) | (exponent << 23) | mantissa;
646 inline void storeHalfFloats(
const Vector4 & vec,
unsigned short * hfptr )
653 for (
int i = 0; i < 4; i++) {
657 unsigned int sign = d.u32 >> 31;
658 unsigned int exponent = (d.u32 >> 23) & ((1 << 8) - 1);
659 unsigned int mantissa = d.u32 & ((1 << 23) - 1);;
665 }
else if (exponent == 255 && mantissa != 0) {
670 }
else if (exponent >= 127 - 15 + 31) {
675 }
else if (exponent <= 127 - 15) {
681 exponent -= 127 - 15;
685 hfptr[i] = (
unsigned short)((sign << 15) | (exponent << 10) | mantissa);
708 return Vector3(
mX,
mY,
mZ );
757 *(&
mX + idx) = value;
820 *
this = *
this * scalar;
836 *
this = *
this / scalar;
850 inline const Vector4
operator *(
float scalar,
const Vector4 & vec )
855 inline const Vector4
mulPerElem(
const Vector4 & vec0,
const Vector4 & vec1 )
858 ( vec0.getX() * vec1.getX() ),
859 ( vec0.getY() * vec1.getY() ),
860 ( vec0.getZ() * vec1.getZ() ),
861 ( vec0.getW() * vec1.getW() )
865 inline const Vector4
divPerElem(
const Vector4 & vec0,
const Vector4 & vec1 )
868 ( vec0.getX() / vec1.getX() ),
869 ( vec0.getY() / vec1.getY() ),
870 ( vec0.getZ() / vec1.getZ() ),
871 ( vec0.getW() / vec1.getW() )
875 inline const Vector4
recipPerElem(
const Vector4 & vec )
878 ( 1.0f / vec.getX() ),
879 ( 1.0f / vec.getY() ),
880 ( 1.0f / vec.getZ() ),
881 ( 1.0f / vec.getW() )
885 inline const Vector4
sqrtPerElem(
const Vector4 & vec )
895 inline const Vector4
rsqrtPerElem(
const Vector4 & vec )
898 ( 1.0f / sqrtf( vec.getX() ) ),
899 ( 1.0f / sqrtf( vec.getY() ) ),
900 ( 1.0f / sqrtf( vec.getZ() ) ),
901 ( 1.0f / sqrtf( vec.getW() ) )
905 inline const Vector4
absPerElem(
const Vector4 & vec )
915 inline const Vector4
copySignPerElem(
const Vector4 & vec0,
const Vector4 & vec1 )
918 ( vec1.getX() < 0.0f )? -fabsf( vec0.getX() ) : fabsf( vec0.getX() ),
919 ( vec1.getY() < 0.0f )? -fabsf( vec0.getY() ) : fabsf( vec0.getY() ),
920 ( vec1.getZ() < 0.0f )? -fabsf( vec0.getZ() ) : fabsf( vec0.getZ() ),
921 ( vec1.getW() < 0.0f )? -fabsf( vec0.getW() ) : fabsf( vec0.getW() )
925 inline const Vector4
maxPerElem(
const Vector4 & vec0,
const Vector4 & vec1 )
928 (vec0.getX() > vec1.getX())? vec0.getX() : vec1.getX(),
929 (vec0.getY() > vec1.getY())? vec0.getY() : vec1.getY(),
930 (vec0.getZ() > vec1.getZ())? vec0.getZ() : vec1.getZ(),
931 (vec0.getW() > vec1.getW())? vec0.getW() : vec1.getW()
935 inline float maxElem(
const Vector4 & vec )
938 result = (vec.getX() > vec.getY())? vec.getX() : vec.getY();
939 result = (vec.getZ() > result)? vec.getZ() : result;
940 result = (vec.getW() > result)? vec.getW() : result;
944 inline const Vector4
minPerElem(
const Vector4 & vec0,
const Vector4 & vec1 )
947 (vec0.getX() < vec1.getX())? vec0.getX() : vec1.getX(),
948 (vec0.getY() < vec1.getY())? vec0.getY() : vec1.getY(),
949 (vec0.getZ() < vec1.getZ())? vec0.getZ() : vec1.getZ(),
950 (vec0.getW() < vec1.getW())? vec0.getW() : vec1.getW()
954 inline float minElem(
const Vector4 & vec )
957 result = (vec.getX() < vec.getY())? vec.getX() : vec.getY();
958 result = (vec.getZ() < result)? vec.getZ() : result;
959 result = (vec.getW() < result)? vec.getW() : result;
963 inline float sum(
const Vector4 & vec )
966 result = ( vec.getX() + vec.getY() );
967 result = ( result + vec.getZ() );
968 result = ( result + vec.getW() );
972 inline float dot(
const Vector4 & vec0,
const Vector4 & vec1 )
975 result = ( vec0.getX() * vec1.getX() );
976 result = ( result + ( vec0.getY() * vec1.getY() ) );
977 result = ( result + ( vec0.getZ() * vec1.getZ() ) );
978 result = ( result + ( vec0.getW() * vec1.getW() ) );
982 inline float lengthSqr(
const Vector4 & vec )
985 result = ( vec.getX() * vec.getX() );
986 result = ( result + ( vec.getY() * vec.getY() ) );
987 result = ( result + ( vec.getZ() * vec.getZ() ) );
988 result = ( result + ( vec.getW() * vec.getW() ) );
992 inline float length(
const Vector4 & vec )
997 inline const Vector4
normalize(
const Vector4 & vec )
999 float lenSqr, lenInv;
1001 lenInv = ( 1.0f / sqrtf( lenSqr ) );
1003 ( vec.getX() * lenInv ),
1004 ( vec.getY() * lenInv ),
1005 ( vec.getZ() * lenInv ),
1006 ( vec.getW() * lenInv )
1010 inline const Vector4
select(
const Vector4 & vec0,
const Vector4 & vec1,
bool select1 )
1013 ( select1 )? vec1.getX() : vec0.getX(),
1014 ( select1 )? vec1.getY() : vec0.getY(),
1015 ( select1 )? vec1.getZ() : vec0.getZ(),
1016 ( select1 )? vec1.getW() : vec0.getW()
1020 #ifdef _VECTORMATH_DEBUG
1022 inline void print(
const Vector4 & vec )
1024 printf(
"( %f %f %f %f )\n", vec.getX(), vec.getY(), vec.getZ(), vec.getW() );
1027 inline void print(
const Vector4 & vec,
const char * name )
1029 printf(
"%s: ( %f %f %f %f )\n", name, vec.getX(), vec.getY(), vec.getZ(), vec.getW() );
1062 inline const Point3
lerp(
float t,
const Point3 & pnt0,
const Point3 & pnt1 )
1064 return ( pnt0 + ( ( pnt1 - pnt0 ) * t ) );
1067 inline void loadXYZ( Point3 & pnt,
const float * fptr )
1069 pnt = Point3( fptr[0], fptr[1], fptr[2] );
1072 inline void storeXYZ(
const Point3 & pnt,
float * fptr )
1074 fptr[0] = pnt.getX();
1075 fptr[1] = pnt.getY();
1076 fptr[2] = pnt.getZ();
1079 inline void loadHalfFloats( Point3 & vec,
const unsigned short * hfptr )
1086 for (
int i = 0; i < 3; i++) {
1087 unsigned short fp16 = hfptr[i];
1088 unsigned int sign = fp16 >> 15;
1089 unsigned int exponent = (fp16 >> 10) & ((1 << 5) - 1);
1090 unsigned int mantissa = fp16 & ((1 << 10) - 1);
1092 if (exponent == 0) {
1096 }
else if (exponent == 31) {
1102 exponent += 127 - 15;
1107 d.u32 = (sign << 31) | (exponent << 23) | mantissa;
1112 inline void storeHalfFloats(
const Point3 & vec,
unsigned short * hfptr )
1119 for (
int i = 0; i < 3; i++) {
1123 unsigned int sign = d.u32 >> 31;
1124 unsigned int exponent = (d.u32 >> 23) & ((1 << 8) - 1);
1125 unsigned int mantissa = d.u32 & ((1 << 23) - 1);;
1127 if (exponent == 0) {
1131 }
else if (exponent == 255 && mantissa != 0) {
1136 }
else if (exponent >= 127 - 15 + 31) {
1141 }
else if (exponent <= 127 - 15) {
1147 exponent -= 127 - 15;
1151 hfptr[i] = (
unsigned short)((sign << 15) | (exponent << 10) | mantissa);
1198 *(&
mX + idx) = value;
1204 return *(&
mX + idx);
1209 return *(&
mX + idx);
1214 return *(&
mX + idx);
1229 (
mX + vec.getX() ),
1230 (
mY + vec.getY() ),
1238 (
mX - vec.getX() ),
1239 (
mY - vec.getY() ),
1246 *
this = *
this + vec;
1252 *
this = *
this - vec;
1256 inline const Point3
mulPerElem(
const Point3 & pnt0,
const Point3 & pnt1 )
1259 ( pnt0.getX() * pnt1.getX() ),
1260 ( pnt0.getY() * pnt1.getY() ),
1261 ( pnt0.getZ() * pnt1.getZ() )
1265 inline const Point3
divPerElem(
const Point3 & pnt0,
const Point3 & pnt1 )
1268 ( pnt0.getX() / pnt1.getX() ),
1269 ( pnt0.getY() / pnt1.getY() ),
1270 ( pnt0.getZ() / pnt1.getZ() )
1277 ( 1.0f / pnt.getX() ),
1278 ( 1.0f / pnt.getY() ),
1279 ( 1.0f / pnt.getZ() )
1283 inline const Point3
sqrtPerElem(
const Point3 & pnt )
1286 sqrtf( pnt.getX() ),
1287 sqrtf( pnt.getY() ),
1295 ( 1.0f / sqrtf( pnt.getX() ) ),
1296 ( 1.0f / sqrtf( pnt.getY() ) ),
1297 ( 1.0f / sqrtf( pnt.getZ() ) )
1301 inline const Point3
absPerElem(
const Point3 & pnt )
1304 fabsf( pnt.getX() ),
1305 fabsf( pnt.getY() ),
1310 inline const Point3
copySignPerElem(
const Point3 & pnt0,
const Point3 & pnt1 )
1313 ( pnt1.getX() < 0.0f )? -fabsf( pnt0.getX() ) : fabsf( pnt0.getX() ),
1314 ( pnt1.getY() < 0.0f )? -fabsf( pnt0.getY() ) : fabsf( pnt0.getY() ),
1315 ( pnt1.getZ() < 0.0f )? -fabsf( pnt0.getZ() ) : fabsf( pnt0.getZ() )
1319 inline const Point3
maxPerElem(
const Point3 & pnt0,
const Point3 & pnt1 )
1322 (pnt0.getX() > pnt1.getX())? pnt0.getX() : pnt1.getX(),
1323 (pnt0.getY() > pnt1.getY())? pnt0.getY() : pnt1.getY(),
1324 (pnt0.getZ() > pnt1.getZ())? pnt0.getZ() : pnt1.getZ()
1328 inline float maxElem(
const Point3 & pnt )
1331 result = (pnt.getX() > pnt.getY())? pnt.getX() : pnt.getY();
1332 result = (pnt.getZ() > result)? pnt.getZ() : result;
1336 inline const Point3
minPerElem(
const Point3 & pnt0,
const Point3 & pnt1 )
1339 (pnt0.getX() < pnt1.getX())? pnt0.getX() : pnt1.getX(),
1340 (pnt0.getY() < pnt1.getY())? pnt0.getY() : pnt1.getY(),
1341 (pnt0.getZ() < pnt1.getZ())? pnt0.getZ() : pnt1.getZ()
1345 inline float minElem(
const Point3 & pnt )
1348 result = (pnt.getX() < pnt.getY())? pnt.getX() : pnt.getY();
1349 result = (pnt.getZ() < result)? pnt.getZ() : result;
1353 inline float sum(
const Point3 & pnt )
1356 result = ( pnt.getX() + pnt.getY() );
1357 result = ( result + pnt.getZ() );
1361 inline const Point3
scale(
const Point3 & pnt,
float scaleVal )
1363 return mulPerElem( pnt, Point3( scaleVal ) );
1366 inline const Point3
scale(
const Point3 & pnt,
const Vector3 & scaleVec )
1368 return mulPerElem( pnt, Point3( scaleVec ) );
1371 inline float projection(
const Point3 & pnt,
const Vector3 & unitVec )
1374 result = ( pnt.getX() * unitVec.getX() );
1375 result = ( result + ( pnt.getY() * unitVec.getY() ) );
1376 result = ( result + ( pnt.getZ() * unitVec.getZ() ) );
1387 return length( Vector3( pnt ) );
1390 inline float distSqr(
const Point3 & pnt0,
const Point3 & pnt1 )
1395 inline float dist(
const Point3 & pnt0,
const Point3 & pnt1 )
1397 return length( ( pnt1 - pnt0 ) );
1400 inline const Point3
select(
const Point3 & pnt0,
const Point3 & pnt1,
bool select1 )
1403 ( select1 )? pnt1.getX() : pnt0.getX(),
1404 ( select1 )? pnt1.getY() : pnt0.getY(),
1405 ( select1 )? pnt1.getZ() : pnt0.getZ()
1409 #ifdef _VECTORMATH_DEBUG
1411 inline void print(
const Point3 & pnt )
1413 printf(
"( %f %f %f )\n", pnt.getX(), pnt.getY(), pnt.getZ() );
1416 inline void print(
const Point3 & pnt,
const char * name )
1418 printf(
"%s: ( %f %f %f )\n", name, pnt.getX(), pnt.getY(), pnt.getZ() );
const Vector4 operator*(float scalar) const
const Quat normalize(const Quat &quat)
float & operator[](int idx)
const Vector3 getXYZ() const
const Vector3 recipPerElem(const Vector3 &vec)
static const Vector4 yAxis()
float minElem(const Vector3 &vec)
void loadHalfFloats(Vector3 &vec, const unsigned short *hfptr)
Vector4 & setXYZ(const Vector3 &vec)
Vector4 & operator+=(const Vector4 &vec)
static const Vector3 xAxis()
static const Vector3 zAxis()
void storeHalfFloats(const Vector3 &vec, unsigned short *hfptr)
float dist(const Point3 &pnt0, const Point3 &pnt1)
const Vector3 minPerElem(const Vector3 &vec0, const Vector3 &vec1)
Point3 & operator=(const Point3 &pnt)
Point3 & setElem(int idx, float value)
static const Vector4 xAxis()
Vector3 & operator=(const Vector3 &vec)
Point3 & operator-=(const Vector3 &vec)
float distFromOrigin(const Point3 &pnt)
const Vector4 operator-() const
Vector3 & operator/=(float scalar)
const Vector3 sqrtPerElem(const Vector3 &vec)
static const Vector3 yAxis()
Vector3 & operator-=(const Vector3 &vec)
static const Vector4 wAxis()
const Vector3 maxPerElem(const Vector3 &vec0, const Vector3 &vec1)
float lengthSqr(const Vector3 &vec)
float distSqrFromOrigin(const Point3 &pnt)
const Point3 operator+(const Vector3 &vec) const
float & operator[](int idx)
const Point3 scale(const Point3 &pnt, float scaleVal)
const Vector3 operator-(const Point3 &pnt) const
float projection(const Point3 &pnt, const Vector3 &unitVec)
const Vector3 copySignPerElem(const Vector3 &vec0, const Vector3 &vec1)
const Vector3 operator-() const
const Vector3 operator+(const Vector3 &vec) const
Vector3 & setElem(int idx, float value)
const Vector3 operator/(float scalar) const
Point3 & operator+=(const Vector3 &vec)
void loadXYZW(Quat &quat, const float *fptr)
const Vector4 operator+(const Vector4 &vec) const
const Vector3 rsqrtPerElem(const Vector3 &vec)
float distSqr(const Point3 &pnt0, const Point3 &pnt1)
float getElem(int idx) const
#define _VECTORMATH_SLERP_TOL
void storeXYZW(const Quat &quat, float *fptr)
const Quat lerp(float t, const Quat &quat0, const Quat &quat1)
const Matrix3 select(const Matrix3 &mat0, const Matrix3 &mat1, bool select1)
const Vector4 operator/(float scalar) const
Vector3 & operator*=(float scalar)
float getElem(int idx) const
Vector3 & operator+=(const Vector3 &vec)
float getElem(int idx) const
float maxElem(const Vector3 &vec)
void storeXYZ(const Vector3 &vec, float *fptr)
float & operator[](int idx)
float sum(const Vector3 &vec)
static const Vector4 zAxis()
float dot(const Quat &quat0, const Quat &quat1)
const Vector3 cross(const Vector3 &vec0, const Vector3 &vec1)
const Matrix3 mulPerElem(const Matrix3 &mat0, const Matrix3 &mat1)
Vector4 & operator/=(float scalar)
const Vector3 operator*(float scalar) const
float length(const Quat &quat)
Vector4 & operator*=(float scalar)
const Vector3 divPerElem(const Vector3 &vec0, const Vector3 &vec1)
const Matrix3 absPerElem(const Matrix3 &mat)
Vector4 & setElem(int idx, float value)
const Matrix3 operator*(float scalar, const Matrix3 &mat)
Vector4 & operator=(const Vector4 &vec)
Vector4 & operator-=(const Vector4 &vec)
void loadXYZ(Vector3 &vec, const float *fptr)
const Quat slerp(float t, const Quat &unitQuat0, const Quat &unitQuat1)