Commit d4ee6407 authored by cutealien's avatar cutealien

Use another solution to ensure first animation frame is at start. Solution...

Use another solution to ensure first animation frame is at start. Solution yesterday had the trouble that it was no longer possible to use setCurrentFrame before otherwise. Tests b3dAnimation and md2Animation working again.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4217 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 26b2b68a
......@@ -239,23 +239,21 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame()
//! OnAnimate() is called just before rendering the whole scene.
void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
{
// set CurrentFrameNr and update bbox
if (LastTimeMs==0)
if (LastTimeMs==0) // first frame
{
CurrentFrameNr = (f32)StartFrame;
// bbox is the default one, so no change
LastTimeMs = timeMs;
}
else
{
buildFrameNr(timeMs-LastTimeMs);
if (Mesh)
{
scene::IMesh * mesh = getMeshForCurrentFrame();
// set CurrentFrameNr
buildFrameNr(timeMs-LastTimeMs);
if (mesh)
Box = mesh->getBoundingBox();
}
// update bbox
if (Mesh)
{
scene::IMesh * mesh = getMeshForCurrentFrame();
if (mesh)
Box = mesh->getBoundingBox();
}
LastTimeMs = timeMs;
......
Tests finished. 1 test of 1 passed.
Compiled as DEBUG
Test suite pass at GMT Wed Jun 27 10:38:16 2012
Test suite pass at GMT Wed Jun 27 13:50:47 2012
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