Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_RaySensor.h
- This file was moved from source/gameengine/Ketsji/KX_RaySensor.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_RaySensor.h | /** \file SCA_RaySensor.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| * \brief Cast a ray and feel for objects | * \brief Cast a ray and feel for objects | ||||
| */ | */ | ||||
| #ifndef __KX_RAYSENSOR_H__ | #ifndef __SCA_RAYSENSOR_H__ | ||||
| #define __KX_RAYSENSOR_H__ | #define __SCA_RAYSENSOR_H__ | ||||
| #include "SCA_ISensor.h" | #include "SCA_ISensor.h" | ||||
| #include "MT_Point3.h" | #include "MT_Point3.h" | ||||
| #include "SCA_IScene.h" /* only for scene replace */ | #include "SCA_IScene.h" /* only for scene replace */ | ||||
| #include "KX_Scene.h" /* only for scene replace */ | #include "KX_Scene.h" /* only for scene replace */ | ||||
| struct KX_ClientObjectInfo; | struct KX_ClientObjectInfo; | ||||
| class KX_RayCast; | class KX_RayCast; | ||||
| class KX_RaySensor : public SCA_ISensor | class SCA_RaySensor : public SCA_ISensor | ||||
| { | { | ||||
| Py_Header | Py_Header | ||||
| STR_String m_propertyname; | STR_String m_propertyname; | ||||
| bool m_bFindMaterial; | bool m_bFindMaterial; | ||||
| bool m_bXRay; | bool m_bXRay; | ||||
| float m_distance; | float m_distance; | ||||
| class KX_Scene* m_scene; | class KX_Scene* m_scene; | ||||
| bool m_bTriggered; | bool m_bTriggered; | ||||
| int m_axis; | int m_axis; | ||||
| bool m_rayHit; | bool m_rayHit; | ||||
| float m_hitPosition[3]; | float m_hitPosition[3]; | ||||
| SCA_IObject* m_hitObject; | SCA_IObject* m_hitObject; | ||||
| float m_hitNormal[3]; | float m_hitNormal[3]; | ||||
| float m_rayDirection[3]; | float m_rayDirection[3]; | ||||
| STR_String m_hitMaterial; | STR_String m_hitMaterial; | ||||
| public: | public: | ||||
| KX_RaySensor(class SCA_EventManager* eventmgr, | SCA_RaySensor(class SCA_EventManager* eventmgr, | ||||
| SCA_IObject* gameobj, | SCA_IObject* gameobj, | ||||
| const STR_String& propname, | const STR_String& propname, | ||||
| bool bFindMaterial, | bool bFindMaterial, | ||||
| bool bXRay, | bool bXRay, | ||||
| double distance, | double distance, | ||||
| int axis, | int axis, | ||||
| class KX_Scene* ketsjiScene); | class KX_Scene* ketsjiScene); | ||||
| virtual ~KX_RaySensor(); | virtual ~SCA_RaySensor(); | ||||
| virtual CValue* GetReplica(); | virtual CValue* GetReplica(); | ||||
| virtual bool Evaluate(); | virtual bool Evaluate(); | ||||
| virtual bool IsPositiveTrigger(); | virtual bool IsPositiveTrigger(); | ||||
| virtual void Init(); | virtual void Init(); | ||||
| bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); | bool RayHit(KX_ClientObjectInfo* client, KX_RayCast* result, void * const data); | ||||
| bool NeedRayCast(KX_ClientObjectInfo* client); | bool NeedRayCast(KX_ClientObjectInfo* client); | ||||
| Show All 18 Lines | #ifdef WITH_PYTHON | ||||
| /* Attributes */ | /* Attributes */ | ||||
| static PyObject *pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | ||||
| #endif /* WITH_PYTHON */ | #endif /* WITH_PYTHON */ | ||||
| }; | }; | ||||
| #endif /* __KX_RAYSENSOR_H__ */ | #endif /* __SCA_RAYSENSOR_H__ */ | ||||