MCPcopy Create free account
hub / github.com/defold/defold / LinkNodesWithBones

Function LinkNodesWithBones

engine/modelc/src/modelimporter_gltf.cpp:1521–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1519}
1520
1521static void LinkNodesWithBones(Scene* scene, cgltf_data* gltf_data)
1522{
1523 for (uint32_t i = 0; i < gltf_data->skins_count; ++i)
1524 {
1525 cgltf_skin* gltf_skin = &gltf_data->skins[i];
1526 Skin* skin = &scene->m_Skins[i];
1527
1528 for (uint32_t j = 0; j < gltf_skin->joints_count; ++j)
1529 {
1530 cgltf_node* gltf_joint = gltf_skin->joints[j];
1531
1532 Bone* bone = 0;
1533 for (uint32_t b = 0; b < gltf_skin->joints_count; ++b)
1534 {
1535 if (strcmp(skin->m_Bones[b].m_Name, gltf_joint->name) == 0)
1536 {
1537 bone = &skin->m_Bones[b];
1538 break;
1539 }
1540 }
1541 bone->m_Node = TranslateNode(gltf_joint, gltf_data, scene);
1542 }
1543 }
1544}
1545
1546static void RemapMeshBoneIndices(Skin* skin, Mesh* mesh)
1547{

Callers 1

LoadSceneFunction · 0.85

Calls 1

TranslateNodeFunction · 0.85

Tested by

no test coverage detected