| 61 | |
| 62 | |
| 63 | Point3F 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 |
no test coverage detected