| 216 | } |
| 217 | |
| 218 | void AnimatedModel::SetCurrentPose(const Array<Matrix>& nodesTransformation, bool worldSpace) |
| 219 | { |
| 220 | if (GraphInstance.NodesPose.IsEmpty()) |
| 221 | const_cast<AnimatedModel*>(this)->PreInitSkinningData(); // Ensure to have valid nodes pose to return |
| 222 | CHECK(nodesTransformation.Count() == GraphInstance.NodesPose.Count()); |
| 223 | GraphInstance.NodesPose = nodesTransformation; |
| 224 | if (worldSpace) |
| 225 | { |
| 226 | Matrix world; |
| 227 | GetLocalToWorldMatrix(world); |
| 228 | Matrix invWorld; |
| 229 | Matrix::Invert(world, invWorld); |
| 230 | for (auto& m : GraphInstance.NodesPose) |
| 231 | m = m * invWorld; |
| 232 | } |
| 233 | OnAnimationUpdated(); |
| 234 | } |
| 235 | |
| 236 | void AnimatedModel::GetNodeTransformation(int32 nodeIndex, Matrix& nodeTransformation, bool worldSpace) const |
| 237 | { |
no test coverage detected