MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / toEuler

Method toEuler

Engine/source/math/mMatrix.cpp:161–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161EulerF MatrixF::toEuler() const
162{
163 const F32 * mat = m;
164
165 EulerF r;
166 r.x = mAsin(mClampF(mat[MatrixF::idx(2,1)], -1.0, 1.0));
167
168 if(mCos(r.x) != 0.f)
169 {
170 r.y = mAtan2(-mat[MatrixF::idx(2,0)], mat[MatrixF::idx(2,2)]);
171 r.z = mAtan2(-mat[MatrixF::idx(0,1)], mat[MatrixF::idx(1,1)]);
172 }
173 else
174 {
175 r.y = 0.f;
176 r.z = mAtan2(mat[MatrixF::idx(1,0)], mat[MatrixF::idx(0,0)]);
177 }
178
179 return r;
180}
181
182void MatrixF::dumpMatrix(const char *caption /* =NULL */) const
183{

Callers 14

sceneObject.cppFile · 0.80
setTransformMethod · 0.80
_onParameterEventMethod · 0.80
camera.cppFile · 0.80
setTransformMethod · 0.80
getCameraTransformMethod · 0.80
setForwardVectorMethod · 0.80
prepRenderImageMethod · 0.80
on3DMouseDownMethod · 0.80
on3DMouseDraggedMethod · 0.80

Calls 4

mAsinFunction · 0.85
mClampFFunction · 0.85
mCosFunction · 0.85
mAtan2Function · 0.85

Tested by

no test coverage detected