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

Function createOrientFromDir

Engine/source/math/mathUtils.cpp:191–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 12

innerRenderMethod · 0.85
calcLightMatricesMethod · 0.85
interpolateTickMethod · 0.85
ejectShellCasingMethod · 0.85
advanceTimeMethod · 0.85
onAddMethod · 0.85
prepModelViewMethod · 0.85
terrainSnapSelectionMethod · 0.85
softSnapSelectionMethod · 0.85
testEdgeCoverMethod · 0.85
randomDirFunction · 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