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

Function mPerp

Engine/source/math/mPoint.cpp:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62
63Point3F mPerp( const Point3F &inVec )
64{
65 AssertFatal( inVec.len() > 0.0f, "mPerp() - zero length vector has no perp!" );
66 AssertFatal( inVec.isUnitLength(), "mPerp() - passed vector must be normalized!" );
67
68 U32 idx = inVec.getLeastComponentIndex();
69
70 Point3F vec( 0.0f, 0.0f, 0.0f );
71 vec[idx] = 1.0f;
72
73 Point3F outVec = mCross( inVec, vec );
74 outVec.normalize();
75
76 //AssertFatal( mIsZero( mDot( inVec, outVec ) ), "mPerp, failed to generate perpendicular" );
77
78 return outVec;
79}
80

Callers 5

getNodeTransformMethod · 0.85
getNodeTransformMethod · 0.85
calcSliceTransformMethod · 0.85
getMatrixFromUpVectorFunction · 0.85

Calls 5

isUnitLengthMethod · 0.80
mCrossFunction · 0.70
lenMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected