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)
frame = os::Byteswap::byteswap(frame);
#endif
// Add key frames
// Add key frames, frames in Irrlicht are zero-based
f32 data[4];
if (flags & 1)
{
readFloats(data, 3);
CSkinnedMesh::SPositionKey *Key=AnimatedMesh->createPositionKey(InJoint);
Key->frame = (f32)frame;
Key->frame = (f32)frame-1;
Key->position.set(data[0], data[1], data[2]);
}
if (flags & 2)
{
readFloats(data, 3);
CSkinnedMesh::SScaleKey *Key=AnimatedMesh->createScaleKey(InJoint);
Key->frame = (f32)frame;
Key->frame = (f32)frame-1;
Key->scale.set(data[0], data[1], data[2]);
}
if (flags & 4)
{
readFloats(data, 4);
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
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