[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49372] trunk/blender/source/gameengine/ Ketsji/KX_KetsjiEngine.cpp: BGE: When using the "Restrict Animation Updates " option, animations are now truly frame rate independent.

Mitchell Stokes mogurijin at gmail.com
Mon Jul 30 01:53:22 CEST 2012


Revision: 49372
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49372
Author:   moguri
Date:     2012-07-29 23:53:21 +0000 (Sun, 29 Jul 2012)
Log Message:
-----------
BGE: When using the "Restrict Animation Updates" option, animations are now truly frame rate independent. Thanks to vrav for reporting the issue in IRC.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp	2012-07-29 23:49:17 UTC (rev 49371)
+++ trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp	2012-07-29 23:53:21 UTC (rev 49372)
@@ -784,21 +784,21 @@
 	// Handle the animations independently of the logic time step
 	if (GetRestrictAnimationFPS())
 	{
-		m_logger->StartLog(tc_animations, m_kxsystem->GetTimeInSeconds(), true);
+		double clocktime = m_kxsystem->GetTimeInSeconds();
+		m_logger->StartLog(tc_animations, clocktime, true);
 		SG_SetActiveStage(SG_STAGE_ANIMATION_UPDATE);
 
 		double anim_timestep = 1.0/KX_GetActiveScene()->GetAnimationFPS();
-		if (m_clockTime - m_previousAnimTime > anim_timestep)
+		if (clocktime - m_previousAnimTime > anim_timestep)
 		{
 			// Sanity/debug print to make sure we're actually going at the fps we want (should be close to anim_timestep)
 			// printf("Anim fps: %f\n", 1.0/(m_clockTime - m_previousAnimTime));
-			m_previousAnimTime = m_clockTime;
+			m_previousAnimTime = clocktime;
 			for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit)
 			{
-				(*sceneit)->UpdateAnimations(m_frameTime);
+				(*sceneit)->UpdateAnimations(clocktime);
 			}
 		}
-		m_previousClockTime = m_clockTime;
 	}
 	
 	// Start logging time spend outside main loop




More information about the Bf-blender-cvs mailing list