Adds some helpful utility math functions.

This commit is contained in:
Areloch 2016-11-28 22:42:29 -06:00
parent 7af95e6a8e
commit 31ed509c1c
6 changed files with 81 additions and 0 deletions

View file

@ -361,6 +361,16 @@ void getVectorFromAngles( VectorF &vec, F32 yawAng, F32 pitchAng )
vec = pnt;
}
F32 getAngleBetweenVectors(VectorF vecA, VectorF vecB)
{
F32 dot = mDot(vecA, vecB);
F32 lenSq1 = vecA.lenSquared();
F32 lenSq2 = vecB.lenSquared();
F32 angle = mAcos(dot / mSqrt(lenSq1 * lenSq2));
return angle;
}
//-----------------------------------------------------------------------------
void transformBoundingBox(const Box3F &sbox, const MatrixF &mat, const Point3F scale, Box3F &dbox)