MCPcopy Create free account
hub / github.com/carbonengine/trinity / TriQuaternionArcFromForward

Function TriQuaternionArcFromForward

trinity/TriMath.cpp:341–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341Quaternion* TriQuaternionArcFromForward(
342 Quaternion* out,
343 const Vector3* v )
344{
345 Vector3 temp = Normalize( *v );
346 if( temp.z < 0.99999f )
347 {
348 temp.z = 1.0f - temp.z;
349 temp.z = sqrtf( temp.z );
350 float div = 0.707106781187f / temp.z;
351 *out = Quaternion( temp.y * div, -temp.x * div, 0.0f, 0.707106781187f * temp.z );
352 return out;
353 }
354 *out = Quaternion( 1.0f, 0.0f, 0.0f, 0.0f );
355 return out;
356}
357
358void TriQuaternionToYawPitchRoll(
359 float* yaw,

Callers 9

UpdateVisibilityMethod · 0.85
UpdateAsyncronousMethod · 0.85
UpdateVisibilityMethod · 0.85
UpdateWarheadMethod · 0.85
RenderDebugInfoMethod · 0.85
ApplyTransformMethod · 0.85
UpdateBufferMethod · 0.85
UpdateBufferMethod · 0.85

Calls 1

QuaternionClass · 0.50

Tested by

no test coverage detected