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

Function getMatrixFromUpVector

Engine/source/math/mathUtils.cpp:218–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216//-----------------------------------------------------------------------------
217
218void getMatrixFromUpVector( const VectorF &up, MatrixF *outMat )
219{
220 AssertFatal( up.isUnitLength(), "MathUtils::getMatrixFromUpVector() - Up vector was not normalized!" );
221 AssertFatal( outMat, "MathUtils::getMatrixFromUpVector() - Got null output matrix!" );
222 AssertFatal( outMat->isAffine(), "MathUtils::getMatrixFromUpVector() - Got uninitialized matrix!" );
223
224 VectorF forward = mPerp( up );
225 VectorF right = mCross( forward, up );
226 right.normalize();
227 forward = mCross( up, right );
228 forward.normalize();
229
230 outMat->setColumn( 0, right );
231 outMat->setColumn( 1, forward );
232 outMat->setColumn( 2, up );
233}
234
235//-----------------------------------------------------------------------------
236

Callers 7

drawConeMethod · 0.85
drawCylinderMethod · 0.85
setDeployedPosMethod · 0.85
addDecalMethod · 0.85
decalManager.cppFile · 0.85
createConvexShapeFromMethod · 0.85
worldEditor.cppFile · 0.85

Calls 6

mPerpFunction · 0.85
isUnitLengthMethod · 0.80
isAffineMethod · 0.80
setColumnMethod · 0.80
mCrossFunction · 0.70
normalizeMethod · 0.45

Tested by

no test coverage detected