mirror of https://github.com/axmolengine/axmol.git
fix animation bug
This commit is contained in:
parent
ccb39e51b2
commit
2175b25730
|
@ -95,7 +95,7 @@ void Animate3D::startWithTarget(Node *target)
|
||||||
|
|
||||||
_boneCurves.clear();
|
_boneCurves.clear();
|
||||||
auto skin = sprite->getSkin();
|
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 bone = skin->getBoneByIndex(i);
|
||||||
auto curve = _animation->getBoneCurveByName(bone->getName());
|
auto curve = _animation->getBoneCurveByName(bone->getName());
|
||||||
if (curve)
|
if (curve)
|
||||||
|
|
|
@ -324,9 +324,9 @@ bool MeshSkin::initFromSkinData(const SkinData& skindata)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t MeshSkin::getSkinBoneCount() const
|
ssize_t MeshSkin::getBoneCount() const
|
||||||
{
|
{
|
||||||
return _skinBones.size();
|
return _skinBones.size() + _nodeBones.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//get bone
|
//get bone
|
||||||
|
|
|
@ -189,8 +189,8 @@ public:
|
||||||
/**create a new meshskin if do not want to share meshskin*/
|
/**create a new meshskin if do not want to share meshskin*/
|
||||||
static MeshSkin* create(const std::string& filename, const std::string& name);
|
static MeshSkin* create(const std::string& filename, const std::string& name);
|
||||||
|
|
||||||
/**get skin bone count*/
|
/**get total bone count, skin bone + node bone*/
|
||||||
ssize_t getSkinBoneCount() const;
|
ssize_t getBoneCount() const;
|
||||||
|
|
||||||
/**get bone*/
|
/**get bone*/
|
||||||
Bone* getBoneByIndex(unsigned int index) const;
|
Bone* getBoneByIndex(unsigned int index) const;
|
||||||
|
|
Loading…
Reference in New Issue