mirror of https://github.com/axmolengine/axmol.git
animation is ok.
This commit is contained in:
parent
9c41b1a826
commit
b1c9fb99e3
|
@ -1292,7 +1292,7 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
|
||||||
|
|
||||||
for (rapidjson::SizeType j = 0; j < bones.Size(); j++)
|
for (rapidjson::SizeType j = 0; j < bones.Size(); j++)
|
||||||
{
|
{
|
||||||
const rapidjson::Value& bone = bones[i];
|
const rapidjson::Value& bone = bones[j];
|
||||||
|
|
||||||
// node
|
// node
|
||||||
if (!bone.HasMember(NODE))
|
if (!bone.HasMember(NODE))
|
||||||
|
@ -1306,9 +1306,9 @@ NodeData* Bundle3D::parseNodesRecursivelyJson(const rapidjson::Value& jvalue)
|
||||||
Mat4 invbindpos;
|
Mat4 invbindpos;
|
||||||
const rapidjson::Value& jtransform = bone[TRANSFORM];
|
const rapidjson::Value& jtransform = bone[TRANSFORM];
|
||||||
|
|
||||||
for (rapidjson::SizeType j = 0; j < jtransform.Size(); j++)
|
for (rapidjson::SizeType k = 0; k < jtransform.Size(); k++)
|
||||||
{
|
{
|
||||||
invbindpos.m[j] = jtransform[j].GetDouble();
|
invbindpos.m[k] = jtransform[k].GetDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
//invbindpos.inverse();
|
//invbindpos.inverse();
|
||||||
|
|
|
@ -299,6 +299,7 @@ Skeleton3D* Skeleton3D::create(const std::vector<NodeData*>& skeletondata)
|
||||||
auto skeleton = new Skeleton3D();
|
auto skeleton = new Skeleton3D();
|
||||||
for (const auto& it : skeletondata) {
|
for (const auto& it : skeletondata) {
|
||||||
auto bone = skeleton->createBone3D(*it);
|
auto bone = skeleton->createBone3D(*it);
|
||||||
|
bone->resetPose();
|
||||||
skeleton->_rootBones.pushBack(bone);
|
skeleton->_rootBones.pushBack(bone);
|
||||||
}
|
}
|
||||||
skeleton->autorelease();
|
skeleton->autorelease();
|
||||||
|
|
Loading…
Reference in New Issue