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:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-10-16 15:41:50 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-10-16 15:41:50 +0400
commit7b2567924b9b86961cd4c07b76653f49939cab1c (patch)
treeadcf1091db6f3f78c05c6b02c567a9b77fc10092 /source/gameengine/GameLogic/SCA_LogicManager.cpp
parent063982914038ecd578bab7849a1e94cccbb8d8b9 (diff)
Switch fixed time system. Logic updates should now happen at 30Hz, physics at 60Hz. (By default, use Python to set.) Some actuators still run at framerate (IPO, Action) for nice smooth animation, and an excuse to buy high end hardware.
Keyboard sensors can now hook escape key. Ctrl-Break can be used from within blender if you've forgotten an end game actuator. Fixed a stupid bug preventing some actuators working (like TrackTo).
Diffstat (limited to 'source/gameengine/GameLogic/SCA_LogicManager.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_LogicManager.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp
index 62b532ee5a0..0829fb0657b 100644
--- a/source/gameengine/GameLogic/SCA_LogicManager.cpp
+++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp
@@ -42,6 +42,7 @@
#include <config.h>
#endif
+
SCA_LogicManager::SCA_LogicManager()
{
}
@@ -175,13 +176,10 @@ void SCA_LogicManager::RegisterToActuator(SCA_IController* controller,SCA_IActua
-void SCA_LogicManager::BeginFrame(double curtime,double deltatime)
+void SCA_LogicManager::BeginFrame(double curtime, double fixedtime)
{
- for (vector<SCA_EventManager*>::const_iterator ie=m_eventmanagers.begin();
- !(ie==m_eventmanagers.end());ie++)
- {
- (*ie)->NextFrame(curtime,deltatime);
- }
+ for (vector<SCA_EventManager*>::const_iterator ie=m_eventmanagers.begin(); !(ie==m_eventmanagers.end()); ie++)
+ (*ie)->NextFrame(curtime, fixedtime);
// for this frame, look up for activated sensors, and build the collection of triggered controllers
int numsensors = this->m_activatedsensors.size();
@@ -214,11 +212,10 @@ void SCA_LogicManager::BeginFrame(double curtime,double deltatime)
-void SCA_LogicManager::UpdateFrame(double curtime,double deltatime)
+void SCA_LogicManager::UpdateFrame(double curtime, bool frame)
{
vector<SmartActuatorPtr>::iterator ra;
- for (ra = m_removedActuators.begin();
- !(ra == m_removedActuators.end());ra++)
+ for (ra = m_removedActuators.begin(); !(ra == m_removedActuators.end()); ra++)
{
m_activeActuators.erase(*ra);
(*ra)->SetActive(false);
@@ -228,7 +225,7 @@ void SCA_LogicManager::UpdateFrame(double curtime,double deltatime)
for (set<SmartActuatorPtr>::iterator ia = m_activeActuators.begin();!(ia==m_activeActuators.end());ia++)
{
//SCA_IActuator* actua = *ia;
- if (!(*ia)->Update(curtime,deltatime))
+ if (!(*ia)->Update(curtime, frame))
{
//*ia = m_activeactuators.back();
m_removedActuators.push_back(*ia);
@@ -238,8 +235,7 @@ void SCA_LogicManager::UpdateFrame(double curtime,double deltatime)
}
}
- for ( ra = m_removedActuators.begin();
- !(ra == m_removedActuators.end());ra++)
+ for ( ra = m_removedActuators.begin(); !(ra == m_removedActuators.end()); ra++)
{
m_activeActuators.erase(*ra);
(*ra)->SetActive(false);