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

Function find_by_index

engine/source/runtime/function/animation/utilities.cpp:7–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace Piccolo
6{
7 Bone* find_by_index(Bone* bones, int key, int size, bool is_flat)
8 {
9 if (key == std::numeric_limits<int>::max())
10 return nullptr;
11 if (is_flat)
12 {
13 if (key >= size)
14 return nullptr;
15 else
16 return &bones[key];
17 }
18 else
19 {
20 for (int i = 0; i < size; i++)
21 {
22 if (bones[i].getID() == key)
23 return &bones[i];
24 }
25 }
26 return nullptr;
27 }
28
29 std::shared_ptr<RawBone> find_by_index(std::vector<std::shared_ptr<RawBone>>& bones, int key, bool is_flat)
30 {

Callers 1

buildSkeletonMethod · 0.85

Calls 3

getIDMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected