Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-02-13 09:28:35 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-02-13 09:28:35 +0300
commitf55e45f855250a5693455fe0f7e13fe0f35c7814 (patch)
tree3b98f46c92068f3dd6c1acb45887b0b16175878c /source/gameengine/Ketsji/KX_KetsjiEngine.cpp
parente4790aef46f7ca0b4ab01c34f043be9e7b1fa7f1 (diff)
more vehicle preparation and some bullet collision detection bugfixes (related to collision margin)
Diffstat (limited to 'source/gameengine/Ketsji/KX_KetsjiEngine.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 8be153ecb60..e9d10f785b0 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -333,6 +333,13 @@ void KX_KetsjiEngine::NextFrame()
m_clockTime = m_kxsystem->GetTimeInSeconds();
double deltatime = m_clockTime - m_frameTime;
+ if (deltatime<0.f)
+ {
+ printf("problem with clock\n");
+ deltatime = 0.f;
+ m_clockTime = 0.f;
+ m_frameTime = 0.f;
+ }
// Compute the number of logic frames to do each update (fixed tic bricks)
int frames =int(deltatime*m_ticrate);
@@ -341,9 +348,21 @@ void KX_KetsjiEngine::NextFrame()
// PIL_sleep_ms(4);
KX_SceneList::iterator sceneit;
+ int frameOut = 5;
+ if (frames>frameOut)
+ {
+ printf("framedOut: %d\n",frames);
+ m_frameTime+=(frames-frameOut)*(1.0/m_ticrate);
+ frames = frameOut;
+ }
+
while (frames)
{
+ if (frames > frameOut)
+ {
+ printf ("what happened\n");
+ }
m_frameTime += 1.0/m_ticrate;