00001 00007 00008 #ifndef KX_IOBJECT_H 00009 #define KX_IOBJECT_H 00010 00011 #include "Value.h" 00012 #include <vector> 00013 00014 class SCA_ISensor; 00015 class SCA_IController; 00016 class SCA_IActuator; 00017 00018 00019 typedef std::vector<SCA_ISensor *> SCA_SensorList; 00020 typedef std::vector<SCA_IController *> SCA_ControllerList; 00021 typedef std::vector<SCA_IActuator *> SCA_ActuatorList; 00022 00023 00024 class SCA_IObject : public CValue 00025 { 00026 00027 Py_Header; 00028 00029 protected: 00030 SCA_SensorList m_sensors; 00031 SCA_ControllerList m_controllers; 00032 SCA_ActuatorList m_actuators; 00033 00034 public: 00035 SCA_IObject(PyTypeObject* T=&Type) : 00036 CValue(T) 00037 {} 00038 00039 virtual ~SCA_IObject(); 00040 00041 SCA_ControllerList& GetControllers() { return m_controllers; } 00042 SCA_SensorList& GetSensors() { return m_sensors; } 00043 SCA_ActuatorList& GetActuators() { return m_actuators; } 00044 00045 void AddSensor(SCA_ISensor* act) { m_sensors.push_back(act); } 00046 void AddController(SCA_IController* act) { m_controllers.push_back(act); } 00047 void AddActuator(SCA_IActuator* act) { m_actuators.push_back(act); } 00048 00049 SCA_ISensor* FindSensor(const CCString& sensorname); 00050 SCA_IActuator* FindActuator(const CCString& actuatorname); 00051 SCA_IController* FindController(const CCString& controllername); 00052 00053 void SetCurrentTime(float currentTime); 00054 00055 void ReParentLogic(); 00056 00057 // todo: next lines have to be moved to better place ! 00058 virtual void setLinearVelocity(const class MT_Vector3& lin_vel,bool local)=0; 00059 virtual void setAngularVelocity(const class MT_Vector3& ang_vel,bool local)=0; 00060 00061 // here come the python forwarded methods 00062 PyObject* _getattr(char* attr); 00063 00064 }; 00065 #endif //KX_IOBJECT_H 00066 00067 00068 00069