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

Function stVec2QtUpdate

src/Sato/stMath.cpp:205–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void stVec2QtUpdate(Quaternion &p, Quaternion &q, const TVec3f &dir, const TVec3f &vec)
206{
207 TVec3f crossp;
208 crossp.cross(dir, vec);
209
210 float length = stspeedy_sqrtf(2.0f * (1.0f + dir.dot(vec)));
211 if (length > 0.0f)
212 {
213 Quaternion a;
214 a.x = crossp.x / length;
215 a.y = crossp.y / length;
216 a.z = crossp.z / length;
217 a.w = (0.5f * length);
218
219 Quaternion c;
220 stQtMult(&c, &a, &p);
221 stQtNormalize(&q, &c);
222 }
223}
224
225void stVec2QtUpdate(Quaternion &q, const Vec &dir, const Vec &vec)
226{

Callers 2

calcGndUpdateQuatMethod · 0.85
moveCommonMethod · 0.85

Calls 7

stspeedy_sqrtfFunction · 0.85
stQtMultFunction · 0.85
stQtNormalizeFunction · 0.85
PSVECCrossProductFunction · 0.85
PSVECDotProductFunction · 0.85
crossMethod · 0.80
dotMethod · 0.45

Tested by

no test coverage detected