From bcc6704299ece695ff7312cdda10eebfdac000d7 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 10 May 2006 00:05:49 +0000 Subject: [PATCH] fixed [ #3863 ] Baking game physics to IPOs misses the first few frames of motion Also, the recording starts from the actual 'curframe' onwards, rather then from frame 1 --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index e9d10f785b0..20e017cbf1b 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -263,11 +263,11 @@ void KX_KetsjiEngine::StartEngine() m_firstframe = true; m_bInitialized = true; m_ticrate = DEFAULT_LOGIC_TIC_RATE; - m_currentFrame = 0; - + if (m_game2ipo) { m_sceneconverter->ResetPhysicsObjectsAnimationIpo(); + m_sceneconverter->WritePhysicsObjectToAnimationIpo(m_currentFrame); } } @@ -438,7 +438,7 @@ void KX_KetsjiEngine::NextFrame() if (m_game2ipo) { - m_sceneconverter->WritePhysicsObjectToAnimationIpo(m_currentFrame++); + m_sceneconverter->WritePhysicsObjectToAnimationIpo(++m_currentFrame); } scene->setSuspendedTime(0.0);