diff --git a/code/OgreImporter.cpp b/code/OgreImporter.cpp index 431b83e77..b8c7f6f8e 100644 --- a/code/OgreImporter.cpp +++ b/code/OgreImporter.cpp @@ -14,7 +14,6 @@ using namespace boost; #include "irrXMLWrapper.h" - namespace Assimp { namespace Ogre @@ -364,7 +363,7 @@ void OgreImporter::CreateAssimpSubMesh(const SubMesh& theSubMesh, const vectormWeights=new aiVertexWeight[aiWeights[i].size()]; memcpy(NewBone->mWeights, &(aiWeights[i][0]), sizeof(aiVertexWeight)*aiWeights[i].size()); NewBone->mName=Bones[i].Name;//The bone list should be sorted after its ids, this was done in LoadSkeleton - NewBone->mOffsetMatrix=aiMatrix4x4(Bones[i].WorldToBoneSpace).Inverse();//we suggest, that the mesh space is the world space! + NewBone->mOffsetMatrix=aiMatrix4x4();//(Bones[i].WorldToBoneSpace).Inverse();//we suggest, that the mesh space is the world space! aiBones.push_back(NewBone); } @@ -717,12 +716,13 @@ void OgreImporter::LoadSkeleton(std::string FileName, vector &Bones, vecto NewKeyframe.Time=GetAttribute(SkeletonFile, "time"); //Position: + //It seams that we have to flip some axies, i really dont know why XmlRead(SkeletonFile); if(string("translate")!=SkeletonFile->getNodeName()) throw new ImportErrorException("translate node not first in keyframe"); - NewKeyframe.Position.x=GetAttribute(SkeletonFile, "x"); - NewKeyframe.Position.y=GetAttribute(SkeletonFile, "y"); - NewKeyframe.Position.z=GetAttribute(SkeletonFile, "z"); + NewKeyframe.Position.x=GetAttribute(SkeletonFile, "y"); + NewKeyframe.Position.y=-GetAttribute(SkeletonFile, "z"); + NewKeyframe.Position.z=-GetAttribute(SkeletonFile, "x"); //Rotation: XmlRead(SkeletonFile); @@ -884,8 +884,8 @@ void Bone::CalculateWorldToBoneSpaceMatrix(vector &Bones) else { WorldToBoneSpace= Bones[ParentId].WorldToBoneSpace - * aiMatrix4x4::Translation(Position, t0) * aiMatrix4x4::Rotation(RotationAngle, RotationAxis, t1) + * aiMatrix4x4::Translation(Position, t0) ; } diff --git a/test/models/Ogre/animationtest2/Animationtest2.blend b/test/models/Ogre/animationtest2/Animationtest2.blend new file mode 100644 index 000000000..c3c5edef9 Binary files /dev/null and b/test/models/Ogre/animationtest2/Animationtest2.blend differ diff --git a/test/models/Ogre/animationtest2/Animationtest2.blend1 b/test/models/Ogre/animationtest2/Animationtest2.blend1 new file mode 100644 index 000000000..df3e30299 Binary files /dev/null and b/test/models/Ogre/animationtest2/Animationtest2.blend1 differ diff --git a/test/models/Ogre/animationtest2/Cube.mesh.xml b/test/models/Ogre/animationtest2/Cube.mesh.xml new file mode 100644 index 000000000..59c109239 --- /dev/null +++ b/test/models/Ogre/animationtest2/Cube.mesh.xml @@ -0,0 +1,762 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/models/Ogre/animationtest2/Cube.skeleton.xml b/test/models/Ogre/animationtest2/Cube.skeleton.xml new file mode 100644 index 000000000..fb0da67f9 --- /dev/null +++ b/test/models/Ogre/animationtest2/Cube.skeleton.xml @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/models/Ogre/animationtest2/Scene.material b/test/models/Ogre/animationtest2/Scene.material new file mode 100644 index 000000000..c0e448cd1 --- /dev/null +++ b/test/models/Ogre/animationtest2/Scene.material @@ -0,0 +1,14 @@ +material Material +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.640000 0.640000 0.640000 1.000000 + specular 0.500000 0.500000 0.500000 1.000000 12.500000 + emissive 0.000000 0.000000 0.000000 1.000000 + } + } +}