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

Method convertTransform

Engine/source/ts/collada/colladaUtils.cpp:52–83  ·  view source on GitHub ↗

Convert a transform from the Collada model coordinate system to the DTS coordinate system

Source from the content-addressed store, hash-verified

50// Convert a transform from the Collada model coordinate system to the DTS coordinate
51// system
52void ColladaUtils::convertTransform(MatrixF& mat)
53{
54 MatrixF rot(true);
55
56 switch (ColladaUtils::getOptions().upAxis)
57 {
58 case UPAXISTYPE_X_UP:
59 // rotate 90 around Y-axis, then 90 around Z-axis
60 rot(0,0) = 0.0f; rot(1,0) = 1.0f;
61 rot(1,1) = 0.0f; rot(2,1) = 1.0f;
62 rot(0,2) = 1.0f; rot(2,2) = 0.0f;
63
64 // pre-multiply the transform by the rotation matrix
65 mat.mulL(rot);
66 break;
67
68 case UPAXISTYPE_Y_UP:
69 // rotate 180 around Y-axis, then 90 around X-axis
70 rot(0,0) = -1.0f;
71 rot(1,1) = 0.0f; rot(2,1) = 1.0f;
72 rot(1,2) = 1.0f; rot(2,2) = 0.0f;
73
74 // pre-multiply the transform by the rotation matrix
75 mat.mulL(rot);
76 break;
77
78 case UPAXISTYPE_Z_UP:
79 default:
80 // nothing to do
81 break;
82 }
83}
84
85/// Find the COMMON profile element in an effect
86const domProfile_COMMON* ColladaUtils::findEffectCommonProfile(const domEffect* effect)

Callers

nothing calls this directly

Calls 1

mulLMethod · 0.80

Tested by

no test coverage detected