Blender V2.61 - r43446
|
#include <SCA_LogicManager.h>
Public Member Functions | |
SCA_LogicManager () | |
virtual | ~SCA_LogicManager () |
void | RegisterEventManager (SCA_EventManager *eventmgr) |
void | RegisterToSensor (SCA_IController *controller, class SCA_ISensor *sensor) |
void | RegisterToActuator (SCA_IController *controller, class SCA_IActuator *actuator) |
void | BeginFrame (double curtime, double fixedtime) |
void | UpdateFrame (double curtime, bool frame) |
void | EndFrame () |
void | AddActiveActuator (SCA_IActuator *actua, bool event) |
void | AddTriggeredController (SCA_IController *controller, SCA_ISensor *sensor) |
SCA_EventManager * | FindEventManager (int eventmgrtype) |
vector< class SCA_EventManager * > | GetEventManagers () |
void | RemoveGameObject (const STR_String &gameobjname) |
void | RemoveSensor (SCA_ISensor *sensor) |
void | RemoveController (SCA_IController *controller) |
void | RemoveActuator (SCA_IActuator *actuator) |
void | RegisterMeshName (const STR_String &meshname, void *mesh) |
void | UnregisterMeshName (const STR_String &meshname, void *mesh) |
CTR_Map< STR_HashedString, void * > & | GetMeshMap () |
CTR_Map< STR_HashedString, void * > & | GetActionMap () |
void | RegisterActionName (const STR_String &actname, void *action) |
void * | GetActionByName (const STR_String &actname) |
void * | GetMeshByName (const STR_String &meshname) |
void | RegisterGameObjectName (const STR_String &gameobjname, CValue *gameobj) |
class CValue * | GetGameObjectByName (const STR_String &gameobjname) |
void | RegisterGameMeshName (const STR_String &gamemeshname, void *blendobj) |
void * | FindBlendObjByGameMeshName (const STR_String &gamemeshname) |
void | RegisterGameObj (void *blendobj, CValue *gameobj) |
void | UnregisterGameObj (void *blendobj, CValue *gameobj) |
CValue * | FindGameObjByBlendObj (void *blendobj) |
This manager handles sensor, controllers and actuators. logic executes each frame the following way: find triggering sensors build list of controllers that are triggered by these triggering sensors process all triggered controllers during this phase actuators can be added to the active actuator list process all active actuators clear triggering sensors clear triggered controllers (actuators may be active during a longer timeframe)
Definition at line 73 of file SCA_LogicManager.h.
SCA_LogicManager::SCA_LogicManager | ( | ) |
Definition at line 43 of file SCA_LogicManager.cpp.
SCA_LogicManager::~SCA_LogicManager | ( | ) | [virtual] |
Definition at line 49 of file SCA_LogicManager.cpp.
References assert, and SG_DList::Empty().
void SCA_LogicManager::AddActiveActuator | ( | SCA_IActuator * | actua, |
bool | event | ||
) | [inline] |
Definition at line 106 of file SCA_LogicManager.h.
References SCA_IActuator::Activate(), SCA_IActuator::AddEvent(), and SCA_ILogicBrick::SetActive().
Referenced by SCA_ExpressionController::Trigger(), SCA_NANDController::Trigger(), SCA_XORController::Trigger(), SCA_ANDController::Trigger(), SCA_XNORController::Trigger(), SCA_NORController::Trigger(), and SCA_ORController::Trigger().
void SCA_LogicManager::AddTriggeredController | ( | SCA_IController * | controller, |
SCA_ISensor * | sensor | ||
) |
Definition at line 309 of file SCA_LogicManager.cpp.
References SCA_IController::Activate(), and SCA_PythonController::AddTriggeredSensor().
Referenced by SCA_ISensor::Activate(), and SCA_ISensor::ActivateControllers().
void SCA_LogicManager::BeginFrame | ( | double | curtime, |
double | fixedtime | ||
) |
Definition at line 187 of file SCA_LogicManager.cpp.
References NULL, SG_QList::QRemove(), and SG_DList::Remove().
Referenced by KX_Scene::LogicBeginFrame().
void SCA_LogicManager::EndFrame | ( | ) |
Definition at line 299 of file SCA_LogicManager.cpp.
Referenced by KX_Scene::LogicEndFrame().
void * SCA_LogicManager::FindBlendObjByGameMeshName | ( | const STR_String & | gamemeshname | ) |
Definition at line 139 of file SCA_LogicManager.cpp.
References NULL.
Referenced by KX_Scene::ReplaceMesh().
SCA_EventManager * SCA_LogicManager::FindEventManager | ( | int | eventmgrtype | ) |
Definition at line 326 of file SCA_LogicManager.cpp.
References SCA_EventManager::GetType(), i, and NULL.
Referenced by BL_ConvertSensors(), KX_Scene::MergeScene(), and SCA_ISensor::Replace_EventManager().
CValue * SCA_LogicManager::FindGameObjByBlendObj | ( | void * | blendobj | ) |
Definition at line 131 of file SCA_LogicManager.cpp.
References NULL.
Referenced by KX_Scene::DupliGroupRecurse().
void * SCA_LogicManager::GetActionByName | ( | const STR_String & | actname | ) |
Definition at line 252 of file SCA_LogicManager.cpp.
References NULL.
Referenced by BL_Action::Play().
CTR_Map<STR_HashedString,void*>& SCA_LogicManager::GetActionMap | ( | ) | [inline] |
Definition at line 131 of file SCA_LogicManager.h.
Referenced by KX_BlenderSceneConverter::FreeBlendFile().
vector<class SCA_EventManager*> SCA_LogicManager::GetEventManagers | ( | ) | [inline] |
Definition at line 115 of file SCA_LogicManager.h.
Referenced by KX_Scene::MergeScene().
CValue * SCA_LogicManager::GetGameObjectByName | ( | const STR_String & | gameobjname | ) |
Definition at line 119 of file SCA_LogicManager.cpp.
References NULL.
void * SCA_LogicManager::GetMeshByName | ( | const STR_String & | meshname | ) |
Definition at line 265 of file SCA_LogicManager.cpp.
References NULL.
CTR_Map<STR_HashedString,void*>& SCA_LogicManager::GetMeshMap | ( | ) | [inline] |
Definition at line 130 of file SCA_LogicManager.h.
Referenced by KX_BlenderSceneConverter::FreeBlendFile().
void SCA_LogicManager::RegisterActionName | ( | const STR_String & | actname, |
void * | action | ||
) |
Definition at line 291 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by BL_ConvertBlenderObjects(), and KX_BlenderSceneConverter::LinkBlendFile().
void SCA_LogicManager::RegisterEventManager | ( | SCA_EventManager * | eventmgr | ) |
Definition at line 83 of file SCA_LogicManager.cpp.
Referenced by KX_Scene::KX_Scene(), and KX_Scene::SetPhysicsEnvironment().
void SCA_LogicManager::RegisterGameMeshName | ( | const STR_String & | gamemeshname, |
void * | blendobj | ||
) |
Definition at line 99 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by bl_ConvertBlenderObject_Single(), and MergeScene_GameObject().
void SCA_LogicManager::RegisterGameObj | ( | void * | blendobj, |
CValue * | gameobj | ||
) |
Definition at line 107 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by bl_ConvertBlenderObject_Single(), and MergeScene_GameObject().
void SCA_LogicManager::RegisterGameObjectName | ( | const STR_String & | gameobjname, |
CValue * | gameobj | ||
) |
Definition at line 90 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by bl_ConvertBlenderObject_Single(), and MergeScene_GameObject().
void SCA_LogicManager::RegisterMeshName | ( | const STR_String & | meshname, |
void * | mesh | ||
) |
Definition at line 278 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by KX_BlenderSceneConverter::ConvertMeshSpecial(), gameobject_from_blenderobject(), and KX_BlenderSceneConverter::LinkBlendFile().
void SCA_LogicManager::RegisterToActuator | ( | SCA_IController * | controller, |
class SCA_IActuator * | actuator | ||
) |
Definition at line 179 of file SCA_LogicManager.cpp.
References SCA_IController::LinkToActuator(), and SCA_IActuator::LinkToController().
Referenced by LinkControllerToActuators(), and KX_Scene::ReplicateLogic().
void SCA_LogicManager::RegisterToSensor | ( | SCA_IController * | controller, |
class SCA_ISensor * | sensor | ||
) |
Definition at line 171 of file SCA_LogicManager.cpp.
References SCA_ISensor::LinkToController(), and SCA_IController::LinkToSensor().
Referenced by BL_ConvertSensors(), and KX_Scene::ReplicateLogic().
void SCA_LogicManager::RemoveActuator | ( | SCA_IActuator * | actuator | ) |
Definition at line 162 of file SCA_LogicManager.cpp.
References SCA_IActuator::Deactivate(), SCA_ILogicBrick::SetActive(), and SCA_IActuator::UnlinkAllControllers().
Referenced by KX_Scene::NewRemoveObject().
void SCA_LogicManager::RemoveController | ( | SCA_IController * | controller | ) |
Definition at line 154 of file SCA_LogicManager.cpp.
References SCA_IController::Deactivate(), SCA_IController::UnlinkAllActuators(), and SCA_IController::UnlinkAllSensors().
Referenced by KX_Scene::NewRemoveObject().
void SCA_LogicManager::RemoveGameObject | ( | const STR_String & | gameobjname | ) |
void SCA_LogicManager::RemoveSensor | ( | SCA_ISensor * | sensor | ) |
remove Logic Bricks from the running logicmanager
Definition at line 148 of file SCA_LogicManager.cpp.
References SCA_ISensor::UnlinkAllControllers(), and SCA_ISensor::UnregisterToManager().
Referenced by KX_Scene::NewRemoveObject().
void SCA_LogicManager::UnregisterGameObj | ( | void * | blendobj, |
CValue * | gameobj | ||
) |
Definition at line 112 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::remove().
Referenced by KX_Scene::NewRemoveObject().
void SCA_LogicManager::UnregisterMeshName | ( | const STR_String & | meshname, |
void * | mesh | ||
) |
Definition at line 284 of file SCA_LogicManager.cpp.
References CTR_Map< Key, Value >::remove().
void SCA_LogicManager::UpdateFrame | ( | double | curtime, |
bool | frame | ||
) |
Definition at line 208 of file SCA_LogicManager.cpp.
References SCA_IActuator::AddEvent(), SG_QList::iterator< T >::begin(), SG_DList::iterator< T >::begin(), SG_DList::Delink(), SG_DList::iterator< T >::end(), SG_QList::iterator< T >::end(), SCA_IActuator::IsNoLink(), SG_QList::QDelink(), SG_QList::QEmpty(), SCA_IActuator::RemoveAllEvents(), SCA_ILogicBrick::SetActive(), and SCA_IActuator::Update().
Referenced by KX_Scene::LogicUpdateFrame().