MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / ProcessJoints

Function ProcessJoints

plugins/Assimp/Plugin.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43using namespace Nz;
44
45void 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
71bool IsSupported(const String& extension)
72{

Callers 1

LoadFunction · 0.85

Calls 3

GetJointMethod · 0.80
SetParentMethod · 0.80
SetInverseBindMatrixMethod · 0.80

Tested by

no test coverage detected