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

Function createOrientFromDir

Engine/source/math/mathUtils.cpp:192–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190//-----------------------------------------------------------------------------
191
192MatrixF createOrientFromDir( const Point3F &direction )
193{
194 Point3F j = direction;
195 Point3F k(0.0f, 0.0f, 1.0f);
196 Point3F i;
197
198 mCross( j, k, &i );
199
200 if( i.magnitudeSafe() == 0.0f )
201 {
202 i.set( 0.0f, -1.0f, 0.0f );
203 }
204
205 i.normalizeSafe();
206 mCross( i, j, &k );
207
208 MatrixF mat( true );
209 mat.setColumn( 0, i );
210 mat.setColumn( 1, j );
211 mat.setColumn( 2, k );
212
213 return mat;
214}
215
216//-----------------------------------------------------------------------------
217

Callers 15

interpolateTickMethod · 0.85
snapToPositionMethod · 0.85
afxXM_RandomRotMethod · 0.85
updateParamsMethod · 0.85
updateParamsMethod · 0.85
innerRenderMethod · 0.85
calcLightMatricesMethod · 0.85
interpolateTickMethod · 0.85
ejectShellCasingMethod · 0.85
advanceTimeMethod · 0.85
onAddMethod · 0.85

Calls 5

setColumnMethod · 0.80
mCrossFunction · 0.70
magnitudeSafeMethod · 0.45
setMethod · 0.45
normalizeSafeMethod · 0.45

Tested by

no test coverage detected