mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
readable .vb format
This commit is contained in:
+31
-1
@@ -1,5 +1,35 @@
|
||||
#include"skeleton.h"
|
||||
#include"animation.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace vb01{
|
||||
Skeleton::Skeleton(){}
|
||||
Skeleton::Skeleton(string name){
|
||||
this->name=name;
|
||||
}
|
||||
|
||||
void Skeleton::addBone(Bone *bone, Node *parent){
|
||||
parent->attachChild(bone);
|
||||
bones.push_back(bone);
|
||||
}
|
||||
|
||||
Bone* Skeleton::getBone(string name){
|
||||
Bone *bone=nullptr;
|
||||
for(Bone *b : bones)
|
||||
if(b->getName()==name){
|
||||
bone=b;
|
||||
break;
|
||||
}
|
||||
return bone;
|
||||
}
|
||||
|
||||
Animation* Skeleton::getAnimation(string name){
|
||||
Animation *anim=nullptr;
|
||||
for(Animation *a : animations)
|
||||
if(a->getName()==name){
|
||||
anim=a;
|
||||
break;
|
||||
}
|
||||
return anim;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user