fix animation bug

This commit is contained in:
yangxiao 2014-06-26 21:58:26 +08:00
parent ccb39e51b2
commit 2175b25730
3 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ void Animate3D::startWithTarget(Node *target)
_boneCurves.clear();
auto skin = sprite->getSkin();
for (unsigned int i = 0; i < skin->getSkinBoneCount(); i++) {
for (unsigned int i = 0; i < skin->getBoneCount(); i++) {
auto bone = skin->getBoneByIndex(i);
auto curve = _animation->getBoneCurveByName(bone->getName());
if (curve)

View File

@ -324,9 +324,9 @@ bool MeshSkin::initFromSkinData(const SkinData& skindata)
return true;
}
ssize_t MeshSkin::getSkinBoneCount() const
ssize_t MeshSkin::getBoneCount() const
{
return _skinBones.size();
return _skinBones.size() + _nodeBones.size();
}
//get bone

View File

@ -189,8 +189,8 @@ public:
/**create a new meshskin if do not want to share meshskin*/
static MeshSkin* create(const std::string& filename, const std::string& name);
/**get skin bone count*/
ssize_t getSkinBoneCount() const;
/**get total bone count, skin bone + node bone*/
ssize_t getBoneCount() const;
/**get bone*/
Bone* getBoneByIndex(unsigned int index) const;