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

Method getTransform

Engine/source/ts/assimp/assimpAppNode.cpp:81–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81MatrixF AssimpAppNode::getTransform(F32 time)
82{
83 // Check if we can use the last computed transform
84 if (time == mLastTransformTime)
85 return mLastTransform;
86
87 if (appParent) {
88 // Get parent node's transform
89 mLastTransform = appParent->getTransform(time);
90 }
91 else {
92 // no parent (ie. root level) => scale by global shape <unit>
93 mLastTransform.identity();
94 mLastTransform.scale(ColladaUtils::getOptions().unit * ColladaUtils::getOptions().formatScaleFactor);
95 if (!isBounds())
96 convertMat(mLastTransform);
97 }
98
99 // If this node is animated in the active sequence, fetch the animated transform
100 MatrixF mat(true);
101 if (sActiveSequence)
102 getAnimatedTransform(mat, time, sActiveSequence);
103 else
104 mat = mNodeTransform;
105
106 // Remove node scaling?
107 Point3F nodeScale = mat.getScale();
108 if (nodeScale != Point3F::One && appParent && ColladaUtils::getOptions().ignoreNodeScale)
109 {
110 nodeScale.x = nodeScale.x ? (1.0f / nodeScale.x) : 0;
111 nodeScale.y = nodeScale.y ? (1.0f / nodeScale.y) : 0;
112 nodeScale.z = nodeScale.z ? (1.0f / nodeScale.z) : 0;
113 mat.scale(nodeScale);
114 }
115
116 mLastTransform.mul(mat);
117
118 mLastTransformTime = time;
119 return mLastTransform;
120}
121
122void AssimpAppNode::getAnimatedTransform(MatrixF& mat, F32 t, aiAnimation* animSeq)
123{

Callers 15

updateBoundsMethod · 0.45
renderDebugNormalsMethod · 0.45
buildPolyListMethod · 0.45
getFeaturesMethod · 0.45
castRayMethod · 0.45
castRayRenderedMethod · 0.45
supportMethod · 0.45
computeBoundsMethod · 0.45
buildPolyListOpcodeMethod · 0.45
castRayOpcodeMethod · 0.45
buildConvexOpcodeMethod · 0.45
_updateOBBMethod · 0.45

Calls 4

identityMethod · 0.45
scaleMethod · 0.45
getScaleMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected