Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 405 vs 406 for /trunk/Source Code/Geometry/Animations/Headers/Bone.h

Diff revisions: vs.
  @@ -42,6 +42,7 @@
42 42
43 43 class Bone {
44 44 public:
45 + I32 _boneID;
45 46 stringImpl _name;
46 47
47 48 aiMatrix4x4 _offsetMatrix;
  @@ -53,7 +54,10 @@
53 54 vectorImpl<Bone*> _children;
54 55
55 56 // index in the current animation's channel array.
56 - Bone(const stringImpl& name) : _name(name), _parent(0)
57 + Bone(const stringImpl& name)
58 + : _name(name),
59 + _parent(0),
60 + _boneID(-1)
57 61 {
58 62 }
59 63
  @@ -66,6 +70,15 @@
66 70 MemoryManager::DELETE_VECTOR(_children);
67 71 }
68 72
73 + inline size_t hierarchyDepth() const {
74 + size_t size = _children.size();
75 + for (Bone* child : _children) {
76 + size += child->hierarchyDepth();
77 + }
78 +
79 + return size;
80 + }
81 +
69 82 inline Bone* find(const stringImpl& name) {
70 83 if (_name.compare(name) == 0) {
71 84 return this;
  @@ -80,6 +93,13 @@
80 93
81 94 return nullptr;
82 95 }
96 +
97 + inline void createBoneList(vectorImpl<const Bone*>& boneList) const {
98 + boneList.push_back(this);
99 + for (Bone* child : _children) {
100 + child->createBoneList(boneList);
101 + }
102 + }
83 103 };
84 104
85 105 }; // namespace Divide