MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getAnglesFromVector

Function getAnglesFromVector

Engine/source/math/mathUtils.cpp:333–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331//-----------------------------------------------------------------------------
332
333void getAnglesFromVector( const VectorF &vec, F32 &yawAng, F32 &pitchAng )
334{
335 yawAng = mAtan2( vec.x, vec.y );
336 if( yawAng < 0.0f )
337 yawAng += M_2PI_F;
338
339 if( mFabs(vec.x) > mFabs(vec.y) )
340 pitchAng = mAtan2( mFabs(vec.z), mFabs(vec.x) );
341 else
342 pitchAng = mAtan2( mFabs(vec.z), mFabs(vec.y) );
343 if( vec.z < 0.0f )
344 pitchAng = -pitchAng;
345}
346
347//-----------------------------------------------------------------------------
348

Callers 13

snapToPositionMethod · 0.85
calc_facing_angleMethod · 0.85
calc_facing_angleMethod · 0.85
ea_updateMethod · 0.85
_getFogColorMethod · 0.85
processTickMethod · 0.85
interpolateTickMethod · 0.85
setEditOrbitModeMethod · 0.85
setEditOrbitPointMethod · 0.85
lookAtMethod · 0.85
autoFitRadiusMethod · 0.85
updateMoveMethod · 0.85

Calls 2

mAtan2Function · 0.85
mFabsFunction · 0.85

Tested by

no test coverage detected