MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xQuatNormalize

Function xQuatNormalize

src/SB/Core/x/xMath3.cpp:654–680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654F32 xQuatNormalize(xQuat* o, const xQuat* q)
655{
656 F32 one_len, len, len2;
657 len2 = xQuatLength2(q);
658 if (len2 == 1.0f)
659 {
660 if (o != q)
661 {
662 xQuatCopy(o, q);
663 }
664 return 1.0f;
665 }
666
667 if (len2 == 0.0f)
668 {
669 if (o != q)
670 {
671 xQuatCopy(o, &g_IQ);
672 }
673 return 0.0f;
674 }
675
676 len = xsqrt(len2);
677 one_len = 1.0f / len;
678 xQuatSMul(o, q, one_len);
679 return len;
680}
681
682void xQuatSlerp(xQuat* q, const xQuat* a, const xQuat* b, F32 t)
683{

Callers 3

xQuatSlerpFunction · 0.70
xQuatMulFunction · 0.70
xEntMPMoveFunction · 0.70

Calls 4

xQuatLength2Function · 0.85
xQuatCopyFunction · 0.85
xsqrtFunction · 0.85
xQuatSMulFunction · 0.85

Tested by

no test coverage detected