mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Conversions
Commit from Azaezel to fix the naming of inspector fields. TypeMatrixField still messes around on first responder, we know these functions convert angAxis to eul properly and from eul to angAxis but when the data comes to TypeMatrix it changes.... weird issue is weird.
This commit is contained in:
parent
92920dbcd9
commit
cbe2bd4c7b
7 changed files with 146 additions and 53 deletions
|
|
@ -464,3 +464,13 @@ DefineEngineFunction(mDecToBin, const char*, (S32 n), , "convert decimal to a bi
|
|||
}
|
||||
return ret.c_str();
|
||||
}
|
||||
|
||||
DefineEngineFunction(mEulDegToAng, AngAxisF, (EulerF euler), , "convert euler to degrees")
|
||||
{
|
||||
return mEulDegToAng(euler);
|
||||
}
|
||||
|
||||
DefineEngineFunction(mAngToEul, EulerF, (AngAxisF angAx), , "convert degrees to euler")
|
||||
{
|
||||
return mAngToEul(angAx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,4 +52,20 @@
|
|||
#include "math/mRotation.h"
|
||||
#endif
|
||||
|
||||
inline AngAxisF mEulDegToAng(EulerF euler)
|
||||
{
|
||||
MatrixF tempMat = MatrixF(euler * M_PI_F / 180.0f, Point3F::Zero);
|
||||
AngAxisF angAx = AngAxisF(tempMat);
|
||||
return angAx;
|
||||
}
|
||||
|
||||
inline EulerF mAngToEul(AngAxisF angAx)
|
||||
{
|
||||
MatrixF tempMat;
|
||||
angAx.setMatrix(&tempMat);
|
||||
EulerF euler = tempMat.toEuler();
|
||||
euler *= 180.0f / M_PI_F;
|
||||
return euler;
|
||||
}
|
||||
|
||||
#endif //_MMATH_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue