Commit 05922fd9 authored by hybrid's avatar hybrid

Change b3d frame numbers to zero-based.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2554 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ced7ef0c
...@@ -605,27 +605,27 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *InJoint) ...@@ -605,27 +605,27 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *InJoint)
frame = os::Byteswap::byteswap(frame); frame = os::Byteswap::byteswap(frame);
#endif #endif
// Add key frames // Add key frames, frames in Irrlicht are zero-based
f32 data[4]; f32 data[4];
if (flags & 1) if (flags & 1)
{ {
readFloats(data, 3); readFloats(data, 3);
CSkinnedMesh::SPositionKey *Key=AnimatedMesh->createPositionKey(InJoint); CSkinnedMesh::SPositionKey *Key=AnimatedMesh->createPositionKey(InJoint);
Key->frame = (f32)frame; Key->frame = (f32)frame-1;
Key->position.set(data[0], data[1], data[2]); Key->position.set(data[0], data[1], data[2]);
} }
if (flags & 2) if (flags & 2)
{ {
readFloats(data, 3); readFloats(data, 3);
CSkinnedMesh::SScaleKey *Key=AnimatedMesh->createScaleKey(InJoint); CSkinnedMesh::SScaleKey *Key=AnimatedMesh->createScaleKey(InJoint);
Key->frame = (f32)frame; Key->frame = (f32)frame-1;
Key->scale.set(data[0], data[1], data[2]); Key->scale.set(data[0], data[1], data[2]);
} }
if (flags & 4) if (flags & 4)
{ {
readFloats(data, 4); readFloats(data, 4);
CSkinnedMesh::SRotationKey *Key=AnimatedMesh->createRotationKey(InJoint); CSkinnedMesh::SRotationKey *Key=AnimatedMesh->createRotationKey(InJoint);
Key->frame = (f32)frame; Key->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
Key->rotation.set(data[1], data[2], data[3], data[0]); Key->rotation.set(data[1], data[2], data[3], data[0]);
} }
......
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