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

Method toEuler

Engine/source/math/mMatrix.cpp:163–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 12

sceneObject.cppFile · 0.80
setTransformMethod · 0.80
_onParameterEventMethod · 0.80
camera.cppFile · 0.80
on3DMouseDraggedMethod · 0.80
setSelectedFaceZRotMethod · 0.80
on3DMouseDownMethod · 0.80
on3DMouseDraggedMethod · 0.80
setMethod · 0.80
asEulerFMethod · 0.80
asMatrixFMethod · 0.80

Calls 4

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

Tested by

no test coverage detected