MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / getRotationMatrix

Function getRotationMatrix

Source/ThirdParty/OpenFBX/ofbx.cpp:262–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261
262static DMatrix getRotationMatrix(const DVec3& euler, RotationOrder order)
263{
264 const double TO_RAD = 3.1415926535897932384626433832795028 / 180.0;
265 DMatrix rx = rotationX(euler.x * TO_RAD);
266 DMatrix ry = rotationY(euler.y * TO_RAD);
267 DMatrix rz = rotationZ(euler.z * TO_RAD);
268 switch (order)
269 {
270 default:
271 case RotationOrder::EULER_XYZ: return rz * ry * rx;
272 case RotationOrder::EULER_XZY: return ry * rz * rx;
273 case RotationOrder::EULER_YXZ: return rz * rx * ry;
274 case RotationOrder::EULER_YZX: return rx * rz * ry;
275 case RotationOrder::EULER_ZXY: return ry * rx * rz;
276 case RotationOrder::EULER_ZYX: return rx * ry * rz;
277 case RotationOrder::SPHERIC_XYZ: assert(false); Error::s_message = "Unsupported rotation order."; return rx * ry * rz;
278 }
279}
280
281
282double fbxTimeToSeconds(i64 value)

Callers 2

getGeometricMatrixMethod · 0.85
evalLocalMethod · 0.85

Calls 3

rotationXFunction · 0.85
rotationYFunction · 0.85
rotationZFunction · 0.85

Tested by

no test coverage detected