From ad08de4c2afda4456585f6e9bb462be1143f9c14 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Thu, 14 Jul 2011 07:03:33 +0000 Subject: BGE Animations: Now animations are only updated based on the set animation speed. This offers a significant performance increase (about 2x fps in my animation stress tests) for cases such as the defaults: 60fps logic and 30fps animations. This means that animations now only have to be updated half the time. I've also added Animations as a profiling category. This is the time spent in Blender's animation code, and not in the BL_ShapeDeformer (the mesh deformation). I'd like the add the deformation too, but right now it's counted in the rasterizer, and I don't see an obviously clean way to have it counted as animation instead. I'll investigate more. --- source/gameengine/Ketsji/KX_KetsjiEngine.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/gameengine/Ketsji/KX_KetsjiEngine.h') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 8cd6fdb8f5f..89419bb7773 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -108,6 +108,7 @@ private: double m_frameTime;//discrete timestamp of the 'game logic frame' double m_clockTime;//current time double m_previousClockTime;//previous clock time + double m_previousAnimTime; //the last time animations were updated double m_remainingTime; static int m_maxLogicFrame; /* maximum number of consecutive logic frame */ @@ -147,6 +148,7 @@ private: tc_first = 0, tc_physics = 0, tc_logic, + tc_animations, tc_network, tc_scenegraph, tc_sound, -- cgit v1.2.3