Commit 50c2efb3 authored by cutealien's avatar cutealien

Merge branch releases/1.8 revisions 5000:5101 into trunk:

- Fix loading of .X and .B3D models with non-normalized quaternion rotations


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5102 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9ee9422a
...@@ -111,6 +111,7 @@ Changes in 1.9 (not yet released) ...@@ -111,6 +111,7 @@ Changes in 1.9 (not yet released)
-------------------------- --------------------------
Changes in 1.8.2 Changes in 1.8.2
- Fix loading of .X and .B3D models with non-normalized quaternion rotations (thanks to JLouisB for a test-model).
- Fix compiling on Free BSD (thanks to leper for reporting and patch) - Fix compiling on Free BSD (thanks to leper for reporting and patch)
- Fix bug with multiple SetPixelFormat calls. (reported and fixed by anontypist) - Fix bug with multiple SetPixelFormat calls. (reported and fixed by anontypist)
- Fix bug related to memory release in PNG image loader. Thanks elephoenix for it. - Fix bug related to memory release in PNG image loader. Thanks elephoenix for it.
......
...@@ -730,6 +730,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) ...@@ -730,6 +730,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint)
oldRotKey=AnimatedMesh->addRotationKey(inJoint); oldRotKey=AnimatedMesh->addRotationKey(inJoint);
oldRotKey->frame = (f32)frame-1; oldRotKey->frame = (f32)frame-1;
oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0]));
oldRot[1].normalize();
} }
} }
else if (oldRotKey==0 && isFirst[2]) else if (oldRotKey==0 && isFirst[2])
...@@ -738,6 +739,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) ...@@ -738,6 +739,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint)
oldRotKey->frame = (f32)frame-1; oldRotKey->frame = (f32)frame-1;
// meant to be in this order since b3d stores W first // meant to be in this order since b3d stores W first
oldRot[0].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); oldRot[0].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0]));
oldRot[0].normalize();
oldRotKey=0; oldRotKey=0;
isFirst[2]=false; isFirst[2]=false;
} }
...@@ -749,6 +751,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) ...@@ -749,6 +751,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint)
oldRotKey->frame = (f32)frame-1; oldRotKey->frame = (f32)frame-1;
// meant to be in this order since b3d stores W first // meant to be in this order since b3d stores W first
oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0]));
oldRot[1].normalize();
} }
} }
} }
......
...@@ -478,8 +478,8 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf ...@@ -478,8 +478,8 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf
} }
else if (type==3) else if (type==3)
{ {
// currMaterial->Meshbuffer->Material.Textures[1] = texture; // currMaterial->Meshbuffer->Material.Textures[1] = texture;
// currMaterial->Meshbuffer->Material.MaterialType=video::EMT_REFLECTION_2_LAYER; // currMaterial->Meshbuffer->Material.MaterialType=video::EMT_REFLECTION_2_LAYER;
} }
// Set diffuse material color to white so as not to affect texture color // Set diffuse material color to white so as not to affect texture color
// Because Maya set diffuse color Kd to black when you use a diffuse color map // Because Maya set diffuse color Kd to black when you use a diffuse color map
......
...@@ -1831,6 +1831,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ...@@ -1831,6 +1831,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint)
ISkinnedMesh::SRotationKey *key=AnimatedMesh->addRotationKey(joint); ISkinnedMesh::SRotationKey *key=AnimatedMesh->addRotationKey(joint);
key->frame=time; key->frame=time;
key->rotation.set(X,Y,Z,W); key->rotation.set(X,Y,Z,W);
key->rotation.normalize();
} }
break; break;
case 1: //scale case 1: //scale
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment