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

Method asMatrixF

Engine/source/math/mRotation.cpp:250–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250MatrixF RotationF::asMatrixF() const
251{
252 MatrixF returnMat;
253 if (mRotationType == Euler)
254 {
255 MatrixF imat, xmat, ymat, zmat;
256 xmat.set(EulerF(x, 0, 0));
257 ymat.set(EulerF(0.0f, y, 0.0f));
258 zmat.set(EulerF(0, 0, z));
259 imat.mul(zmat, xmat);
260 returnMat.mul(imat, ymat);
261 }
262 else
263 {
264 AngAxisF aa;
265 aa.set(Point3F(x, y, z), w);
266
267 MatrixF tempMat;
268 aa.setMatrix(&tempMat);
269
270 EulerF eul = tempMat.toEuler();
271
272 MatrixF imat, xmat, ymat, zmat;
273 xmat.set(EulerF(eul.x, 0, 0));
274 ymat.set(EulerF(0.0f, eul.y, 0.0f));
275 zmat.set(EulerF(0, 0, eul.z));
276 imat.mul(zmat, xmat);
277 returnMat.mul(imat, ymat);
278 }
279
280 return returnMat;
281}
282
283QuatF RotationF::asQuatF() const
284{

Callers 4

mRotation.hFile · 0.80
operator +Method · 0.80
operator -Method · 0.80
mRotation.cppFile · 0.80

Calls 5

toEulerMethod · 0.80
Point3FClass · 0.70
setMethod · 0.45
mulMethod · 0.45
setMatrixMethod · 0.45

Tested by

no test coverage detected