| 43 | using namespace Nz; |
| 44 | |
| 45 | void ProcessJoints(aiNode* node, Skeleton* skeleton, const std::set<Nz::String>& joints) |
| 46 | { |
| 47 | Nz::String jointName(node->mName.data, node->mName.length); |
| 48 | if (joints.count(jointName)) |
| 49 | { |
| 50 | Joint* joint = skeleton->GetJoint(jointName); |
| 51 | if (joint) |
| 52 | { |
| 53 | if (node->mParent) |
| 54 | joint->SetParent(skeleton->GetJoint(node->mParent->mName.C_Str())); |
| 55 | |
| 56 | Matrix4f transformMatrix(node->mTransformation.a1, node->mTransformation.a2, node->mTransformation.a3, node->mTransformation.a4, |
| 57 | node->mTransformation.b1, node->mTransformation.b2, node->mTransformation.b3, node->mTransformation.b4, |
| 58 | node->mTransformation.c1, node->mTransformation.c2, node->mTransformation.c3, node->mTransformation.c4, |
| 59 | node->mTransformation.d1, node->mTransformation.d2, node->mTransformation.d3, node->mTransformation.d4); |
| 60 | |
| 61 | transformMatrix.InverseAffine(); |
| 62 | |
| 63 | joint->SetInverseBindMatrix(transformMatrix); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | for (unsigned int i = 0; i < node->mNumChildren; ++i) |
| 68 | ProcessJoints(node->mChildren[i], skeleton, joints); |
| 69 | } |
| 70 | |
| 71 | bool IsSupported(const String& extension) |
| 72 | { |
no test coverage detected