mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Adds some helpful utility math functions.
This commit is contained in:
parent
7af95e6a8e
commit
31ed509c1c
6 changed files with 81 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue