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

Method getNodeTransform

Engine/source/ts/assimp/assimpAppNode.cpp:239–270  ·  view source on GitHub ↗

Get the world transform of the node at the specified time

Source from the content-addressed store, hash-verified

237
238/// Get the world transform of the node at the specified time
239MatrixF AssimpAppNode::getNodeTransform(F32 time)
240{
241 // Avoid re-computing the default transform if possible
242 if (mDefaultTransformValid && time == TSShapeLoader::DefaultTime)
243 {
244 return mDefaultNodeTransform;
245 }
246 else
247 {
248 MatrixF nodeTransform = getTransform(time);
249
250 // Check for inverted node coordinate spaces => can happen when modelers
251 // use the 'mirror' tool in their 3d app. Shows up as negative <scale>
252 // transforms in the collada model.
253 if (m_matF_determinant(nodeTransform) < 0.0f)
254 {
255 // Mark this node as inverted so we can mirror mesh geometry, then
256 // de-invert the transform matrix
257 mInvertMeshes = true;
258 nodeTransform.scale(Point3F(1, 1, -1));
259 }
260
261 // Cache the default transform
262 if (time == TSShapeLoader::DefaultTime)
263 {
264 mDefaultTransformValid = true;
265 mDefaultNodeTransform = nodeTransform;
266 }
267
268 return nodeTransform;
269 }
270}
271
272void AssimpAppNode::assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& outMat)
273{

Callers 6

getLocalNodeMatrixMethod · 0.45
processNodeMethod · 0.45
generateDefaultStatesMethod · 0.45
computeBoundsMethod · 0.45
getMeshTransformMethod · 0.45

Calls 2

Point3FClass · 0.50
scaleMethod · 0.45

Tested by

no test coverage detected