MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / buildSkeleton

Method buildSkeleton

engine/source/runtime/function/animation/skeleton.cpp:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 }
16
17 void Skeleton::buildSkeleton(const SkeletonData& skeleton_definition)
18 {
19 m_is_flat = skeleton_definition.is_flat;
20 if (m_bones != nullptr)
21 {
22 delete[] m_bones;
23 }
24 if (!m_is_flat || !skeleton_definition.in_topological_order)
25 {
26 // LOG_ERROR
27 return;
28 }
29 m_bone_count = skeleton_definition.bones_map.size();
30 m_bones = new Bone[m_bone_count];
31 for (size_t i = 0; i < m_bone_count; i++)
32 {
33 const RawBone bone_definition = skeleton_definition.bones_map[i];
34 Bone* parent_bone = find_by_index(m_bones, bone_definition.parent_index, i, m_is_flat);
35 m_bones[i].initialize(std::make_shared<RawBone>(bone_definition), parent_bone);
36 }
37 }
38
39 void Skeleton::applyAnimation(const BlendStateWithClipData& blend_state)
40 {

Callers 1

postLoadResourceMethod · 0.80

Calls 3

find_by_indexFunction · 0.85
sizeMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected