Get the world transform of the node at the specified time
| 237 | |
| 238 | /// Get the world transform of the node at the specified time |
| 239 | MatrixF 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 | |
| 272 | void AssimpAppNode::assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& outMat) |
| 273 | { |
no test coverage detected