Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_RadarSensor.h
- This file was moved from source/gameengine/Ketsji/KX_RadarSensor.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_RadarSensor.h | /** \file SCA_RadarSensor.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| */ | */ | ||||
| #ifndef __KX_RADARSENSOR_H__ | #ifndef __SCA_RADARSENSOR_H__ | ||||
| #define __KX_RADARSENSOR_H__ | #define __SCA_RADARSENSOR_H__ | ||||
| #include "KX_NearSensor.h" | #include "SCA_NearSensor.h" | ||||
| #include "MT_Point3.h" | #include "MT_Point3.h" | ||||
| /** | /** | ||||
| * Radar 'cone' sensor. Very similar to a near-sensor, but instead of a sphere, a cone is used. | * Radar 'cone' sensor. Very similar to a near-sensor, but instead of a sphere, a cone is used. | ||||
| */ | */ | ||||
| class KX_RadarSensor : public KX_NearSensor | class SCA_RadarSensor : public SCA_NearSensor | ||||
| { | { | ||||
| protected: | |||||
| Py_Header | Py_Header | ||||
| protected: | |||||
| float m_coneradius; | float m_coneradius; | ||||
| /** | /** | ||||
| * Height of the cone. | * Height of the cone. | ||||
| */ | */ | ||||
| float m_coneheight; | float m_coneheight; | ||||
| int m_axis; | int m_axis; | ||||
| /** | /** | ||||
| * The previous position of the origin of the cone. | * The previous position of the origin of the cone. | ||||
| */ | */ | ||||
| float m_cone_origin[3]; | float m_cone_origin[3]; | ||||
| /** | /** | ||||
| * The previous direction of the cone (origin to bottom plane). | * The previous direction of the cone (origin to bottom plane). | ||||
| */ | */ | ||||
| float m_cone_target[3]; | float m_cone_target[3]; | ||||
| public: | public: | ||||
| KX_RadarSensor(SCA_EventManager* eventmgr, | SCA_RadarSensor(SCA_EventManager* eventmgr, | ||||
| KX_GameObject* gameobj, | KX_GameObject* gameobj, | ||||
| PHY_IPhysicsController* physCtrl, | PHY_IPhysicsController* physCtrl, | ||||
| double coneradius, | double coneradius, | ||||
| double coneheight, | double coneheight, | ||||
| int axis, | int axis, | ||||
| double margin, | double margin, | ||||
| double resetmargin, | double resetmargin, | ||||
| bool bFindMaterial, | bool bFindMaterial, | ||||
| const STR_String& touchedpropname); | const STR_String& touchedpropname); | ||||
| KX_RadarSensor(); | SCA_RadarSensor(); | ||||
| virtual ~KX_RadarSensor(); | virtual ~SCA_RadarSensor(); | ||||
| virtual void SynchronizeTransform(); | virtual void SynchronizeTransform(); | ||||
| virtual CValue* GetReplica(); | virtual CValue* GetReplica(); | ||||
| /* --------------------------------------------------------------------- */ | |||||
| /* Python interface ---------------------------------------------------- */ | |||||
| /* --------------------------------------------------------------------- */ | |||||
| enum RadarAxis { | enum RadarAxis { | ||||
| KX_RADAR_AXIS_POS_X = 0, | KX_RADAR_AXIS_POS_X = 0, | ||||
| KX_RADAR_AXIS_POS_Y, | KX_RADAR_AXIS_POS_Y, | ||||
| KX_RADAR_AXIS_POS_Z, | KX_RADAR_AXIS_POS_Z, | ||||
| KX_RADAR_AXIS_NEG_X, | KX_RADAR_AXIS_NEG_X, | ||||
| KX_RADAR_AXIS_NEG_Y, | KX_RADAR_AXIS_NEG_Y, | ||||
| KX_RADAR_AXIS_NEG_Z | KX_RADAR_AXIS_NEG_Z | ||||
| }; | }; | ||||
| virtual sensortype GetSensorType() { return ST_RADAR; } | virtual sensortype GetSensorType() { return ST_RADAR; } | ||||
| /* python */ | |||||
| /* --------------------------------------------------------------------- */ | |||||
| /* Python interface ---------------------------------------------------- */ | |||||
| /* --------------------------------------------------------------------- */ | |||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| static PyObject* pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | static PyObject* pyattr_get_angle(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| #endif /* __KX_RADARSENSOR_H__ */ | #endif /* __SCA_RADARSENSOR_H__ */ | ||||