Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_TouchSensor.h
- This file was moved from source/gameengine/Ketsji/KX_TouchSensor.h.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file KX_TouchSensor.h | /** \file SCA_TouchSensor.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| * \brief Senses touch and collision events | * \brief Senses touch and collision events | ||||
| */ | */ | ||||
| #ifndef __KX_TOUCHSENSOR_H__ | #ifndef __SCA_TOUCHSENSOR_H__ | ||||
| #define __KX_TOUCHSENSOR_H__ | #define __SCA_TOUCHSENSOR_H__ | ||||
| #include "SCA_ISensor.h" | #include "SCA_ISensor.h" | ||||
| #include "ListValue.h" | #include "ListValue.h" | ||||
| struct PHY_CollData; | struct PHY_CollData; | ||||
| #include "KX_ClientObjectInfo.h" | #include "KX_ClientObjectInfo.h" | ||||
| #if defined(_WIN64) | #if defined(_WIN64) | ||||
| typedef unsigned __int64 uint_ptr; | typedef unsigned __int64 uint_ptr; | ||||
| #else | #else | ||||
| typedef unsigned long uint_ptr; | typedef unsigned long uint_ptr; | ||||
| #endif | #endif | ||||
| class KX_TouchEventManager; | class SCA_TouchEventManager; | ||||
| class KX_TouchSensor : public SCA_ISensor | class SCA_TouchSensor : public SCA_ISensor | ||||
| { | { | ||||
| protected: | protected: | ||||
| Py_Header | Py_Header | ||||
| /** | /** | ||||
| * The sensor should only look for objects with this property. | * The sensor should only look for objects with this property. | ||||
| */ | */ | ||||
| STR_String m_touchedpropname; | STR_String m_touchedpropname; | ||||
| Show All 11 Lines | protected: | ||||
| uint_ptr m_bColliderHash; /* hash collision objects pointers to trigger in case one object collides and another takes its place */ | uint_ptr m_bColliderHash; /* hash collision objects pointers to trigger in case one object collides and another takes its place */ | ||||
| uint_ptr m_bLastColliderHash; | uint_ptr m_bLastColliderHash; | ||||
| SCA_IObject* m_hitObject; | SCA_IObject* m_hitObject; | ||||
| class CListValue* m_colliders; | class CListValue* m_colliders; | ||||
| STR_String m_hitMaterial; | STR_String m_hitMaterial; | ||||
| public: | public: | ||||
| KX_TouchSensor(class SCA_EventManager* eventmgr, | SCA_TouchSensor(class SCA_EventManager* eventmgr, | ||||
| class KX_GameObject* gameobj, | class KX_GameObject* gameobj, | ||||
| bool bFindMaterial, | bool bFindMaterial, | ||||
| bool bTouchPulse, | bool bTouchPulse, | ||||
| const STR_String& touchedpropname); | const STR_String& touchedpropname); | ||||
| virtual ~KX_TouchSensor(); | virtual ~SCA_TouchSensor(); | ||||
| virtual CValue* GetReplica(); | virtual CValue* GetReplica(); | ||||
| virtual void ProcessReplica(); | virtual void ProcessReplica(); | ||||
| virtual void SynchronizeTransform(); | virtual void SynchronizeTransform(); | ||||
| virtual bool Evaluate(); | virtual bool Evaluate(); | ||||
| virtual void Init(); | virtual void Init(); | ||||
| virtual void ReParent(SCA_IObject* parent); | virtual void ReParent(SCA_IObject* parent); | ||||
| virtual void RegisterSumo(KX_TouchEventManager* touchman); | virtual void RegisterSumo(SCA_TouchEventManager* touchman); | ||||
| virtual void UnregisterSumo(KX_TouchEventManager* touchman); | virtual void UnregisterSumo(SCA_TouchEventManager* touchman); | ||||
| virtual void UnregisterToManager(); | virtual void UnregisterToManager(); | ||||
| #if 0 | #if 0 | ||||
| virtual DT_Bool HandleCollision(void* obj1,void* obj2, | virtual DT_Bool HandleCollision(void* obj1,void* obj2, | ||||
| const DT_CollData * coll_data); | const DT_CollData * coll_data); | ||||
| #endif | #endif | ||||
| virtual bool NewHandleCollision(void*obj1,void*obj2,const PHY_CollData* colldata); | virtual bool NewHandleCollision(void*obj1,void*obj2,const PHY_CollData* colldata); | ||||
| Show All 27 Lines | #ifdef WITH_PYTHON | ||||
| static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| #endif /* __KX_TOUCHSENSOR_H__ */ | #endif /* __SCA_TOUCHSENSOR_H__ */ | ||||