MCPcopy Create free account
hub / github.com/doldecomp/mkdd / stQtNormalize

Function stQtNormalize

src/Sato/stMath.cpp:351–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351f32 stQtNormalize(Quaternion *dst, const Quaternion *q)
352{
353 float length = (q->x * q->x + q->y * q->y + q->z * q->z + q->w * q->w);
354 if (length != 0.0f)
355 {
356 float mag = 1.0f / std::sqrtf(length);
357
358 dst->x = q->x * mag;
359 dst->y = q->y * mag;
360 dst->z = q->z * mag;
361 dst->w = q->w * mag;
362 }
363 return length;
364}
365
366int stMakePlaneParam(stPlaneParam &planeParam, TVec3f &vec1, const TVec3f &vec2)
367{

Callers 1

stVec2QtUpdateFunction · 0.85

Calls 1

sqrtfFunction · 0.85

Tested by

no test coverage detected