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() ...@@ -239,23 +239,21 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame()
//! OnAnimate() is called just before rendering the whole scene. //! OnAnimate() is called just before rendering the whole scene.
void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs) void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
{ {
// set CurrentFrameNr and update bbox if (LastTimeMs==0) // first frame
if (LastTimeMs==0)
{ {
CurrentFrameNr = (f32)StartFrame; LastTimeMs = timeMs;
// bbox is the default one, so no change
} }
else
{
buildFrameNr(timeMs-LastTimeMs);
if (Mesh) // set CurrentFrameNr
{ buildFrameNr(timeMs-LastTimeMs);
scene::IMesh * mesh = getMeshForCurrentFrame();
if (mesh) // update bbox
Box = mesh->getBoundingBox(); if (Mesh)
} {
scene::IMesh * mesh = getMeshForCurrentFrame();
if (mesh)
Box = mesh->getBoundingBox();
} }
LastTimeMs = timeMs; LastTimeMs = timeMs;
......
Tests finished. 1 test of 1 passed. Tests finished. 1 test of 1 passed.
Compiled as DEBUG 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