BGE API cleanup: apply patch from Moguri: Near, Radar, Touch sensor updated.
authorBenoit Bolsee <benoit.bolsee@online.be>
Sat, 28 Feb 2009 21:00:27 +0000 (21:00 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sat, 28 Feb 2009 21:00:27 +0000 (21:00 +0000)
12 files changed:
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_NearSensor.h
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RadarSensor.h
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TouchSensor.h
source/gameengine/PyDoc/GameLogic.py
source/gameengine/PyDoc/KX_NearSensor.py
source/gameengine/PyDoc/KX_RadarSensor.py
source/gameengine/PyDoc/KX_Scene.py
source/gameengine/PyDoc/KX_TouchSensor.py

index 066387abb93e601ca16280d5fa9c2f98c9a0633e..993a6b3d86c55b31830e38b03091714f85412d52 100644 (file)
@@ -42,8 +42,8 @@
 #endif
 KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr,
                                                         KX_GameObject* gameobj,
-                                                        double margin,
-                                                        double resetmargin,
+                                                        float margin,
+                                                        float resetmargin,
                                                         bool bFindMaterial,
                                                         const STR_String& touchedpropname,
                                                         class KX_Scene* scene,
@@ -276,8 +276,16 @@ bool       KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
 }
 
 
+/* ------------------------------------------------------------------------- */
+/* Python Functions                                                                                                                     */
+/* ------------------------------------------------------------------------- */
+
+//No methods
+
+/* ------------------------------------------------------------------------- */
+/* Python Integration Hooks                                                  */
+/* ------------------------------------------------------------------------- */
 
-// python embedding
 PyTypeObject KX_NearSensor::Type = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,
@@ -311,20 +319,31 @@ PyParentObject KX_NearSensor::Parents[] = {
 
 
 PyMethodDef KX_NearSensor::Methods[] = {
-       {"setProperty", (PyCFunction) KX_NearSensor::sPySetProperty,      METH_O, (PY_METHODCHAR)SetProperty_doc},
-       {"getProperty", (PyCFunction) KX_NearSensor::sPyGetProperty,      METH_NOARGS, (PY_METHODCHAR)GetProperty_doc},
-       {"getHitObject",(PyCFunction) KX_NearSensor::sPyGetHitObject,     METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
-       {"getHitObjectList", (PyCFunction) KX_NearSensor::sPyGetHitObjectList, METH_NOARGS, (PY_METHODCHAR)GetHitObjectList_doc},
+       //No methods
        {NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_NearSensor::Attributes[] = {
-       { NULL }        //Sentinel
+       KX_PYATTRIBUTE_FLOAT_RW_CHECK("distance", 0, 100, KX_NearSensor, m_Margin, CheckResetDistance),
+       KX_PYATTRIBUTE_FLOAT_RW_CHECK("resetDistance", 0, 100, KX_NearSensor, m_ResetMargin, CheckResetDistance),
+       {NULL} //Sentinel
 };
 
-PyObject*
-KX_NearSensor::_getattr(const char *attr)
+
+PyObject* KX_NearSensor::_getattr(const char *attr)
 {
-  _getattr_up(KX_TouchSensor);
+       PyObject* object = _getattr_self(Attributes, this, attr);
+       if (object != NULL)
+               return object;
+
+       _getattr_up(KX_TouchSensor);
 }
 
+int KX_NearSensor::_setattr(const char *attr, PyObject* value)
+{
+       int ret = _setattr_self(Attributes, this, attr, value);
+       if (ret >= 0)
+               return ret;
+
+       return KX_TouchSensor::_setattr(attr, value);
+}
index 58c7cc7da911ae9e15576fe3918585899b3827e4..ee03992e734f44899a527d9d82566557c66e2a2a 100644 (file)
@@ -42,15 +42,15 @@ class KX_NearSensor : public KX_TouchSensor
 {
        Py_Header;
 protected:
-       double  m_Margin;
-       double  m_ResetMargin;
+       float   m_Margin;
+       float  m_ResetMargin;
        KX_Scene*       m_scene;
        KX_ClientObjectInfo*    m_client_info;
 public:
        KX_NearSensor(class SCA_EventManager* eventmgr,
                        class KX_GameObject* gameobj,
-                       double margin,
-                       double resetmargin,
+                       float margin,
+                       float resetmargin,
                        bool bFindMaterial,
                        const STR_String& touchedpropname,
                        class KX_Scene* scene,
@@ -78,8 +78,25 @@ public:
        virtual bool    BroadPhaseFilterCollision(void*obj1,void*obj2);
        virtual void RegisterSumo(KX_TouchEventManager *touchman);
        virtual void UnregisterSumo(KX_TouchEventManager* touchman);
-       
+
+       /* --------------------------------------------------------------------- */
+       /* Python interface ---------------------------------------------------- */
+       /* --------------------------------------------------------------------- */
        virtual PyObject* _getattr(const char *attr);
+       virtual int _setattr(const char *attr, PyObject* value);
+
+       //No methods
+
+       //This method is used to make sure the distance does not exceed the reset distance
+       static int CheckResetDistance(void *self, const PyAttributeDef*)
+       {
+               KX_NearSensor* sensor = reinterpret_cast<KX_NearSensor*>(self);
+
+               if (sensor->m_Margin > sensor->m_ResetMargin)
+                       sensor->m_ResetMargin = sensor->m_Margin;
+
+               return 0;
+       }
 
 };
 
index 93f57986181b74bef8a33017de8e520d629891b3..d974d67bf332c3363490e1af1695a074757f437f 100644 (file)
@@ -47,6 +47,7 @@
 #include "KX_PyConstraintBinding.h"
 
 #include "KX_KetsjiEngine.h"
+#include "KX_RadarSensor.h"
 
 #include "SCA_IInputDevice.h"
 #include "SCA_PropertySensor.h"
@@ -1060,6 +1061,14 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
        KX_MACRO_addTypesToDict(d, KX_STATE29, (1<<28));
        KX_MACRO_addTypesToDict(d, KX_STATE30, (1<<29));
 
+       /* Radar Sensor */
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_POS_X, KX_RadarSensor::KX_RADAR_AXIS_POS_X);
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_POS_Y, KX_RadarSensor::KX_RADAR_AXIS_POS_Y);
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_POS_Z, KX_RadarSensor::KX_RADAR_AXIS_POS_Z);
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_NEG_X, KX_RadarSensor::KX_RADAR_AXIS_NEG_Y);
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_NEG_Y, KX_RadarSensor::KX_RADAR_AXIS_NEG_X);
+       KX_MACRO_addTypesToDict(d, KX_RADAR_AXIS_NEG_Z, KX_RadarSensor::KX_RADAR_AXIS_NEG_Z);
+
        // Check for errors
        if (PyErr_Occurred())
     {
index c347faaee1af46971a313a491966907f66a34553..fa8998cd81df97c704a0e8c4dd55f4b7ae878ca2 100644 (file)
@@ -171,8 +171,18 @@ void KX_RadarSensor::SynchronizeTransform()
                {
                }
        }
-       m_cone_origin = trans.getOrigin();
-       m_cone_target = trans(MT_Point3(0, -m_coneheight/2.0 ,0));
+       
+       //Using a temp variable to translate MT_Point3 to float[3].
+       //float[3] works better for the Python interface.
+       MT_Point3 temp = trans.getOrigin();
+       m_cone_origin[0] = temp[0];
+       m_cone_origin[1] = temp[1];
+       m_cone_origin[2] = temp[2];
+
+       temp = trans(MT_Point3(0, -m_coneheight/2.0 ,0));
+       m_cone_target[0] = temp[0];
+       m_cone_target[1] = temp[1];
+       m_cone_target[2] = temp[2];
 
 
        if (m_physCtrl)
@@ -187,10 +197,58 @@ void KX_RadarSensor::SynchronizeTransform()
 }
 
 /* ------------------------------------------------------------------------- */
-/* Python functions                                                          */
+/* Python Functions                                                                                                                     */
 /* ------------------------------------------------------------------------- */
 
-/* Integration hooks ------------------------------------------------------- */
+//Deprecated ----->
+/* getConeOrigin */
+const char KX_RadarSensor::GetConeOrigin_doc[] = 
+"getConeOrigin()\n"
+"\tReturns the origin of the cone with which to test. The origin\n"
+"\tis in the middle of the cone.";
+PyObject* KX_RadarSensor::PyGetConeOrigin(PyObject* self) {
+       ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property");
+
+       PyObject *retVal = PyList_New(3);
+       
+       PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_cone_origin[0]));
+       PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_cone_origin[1]));
+       PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_cone_origin[2]));
+       
+       return retVal;
+}
+
+/* getConeOrigin */
+const char KX_RadarSensor::GetConeTarget_doc[] = 
+"getConeTarget()\n"
+"\tReturns the center of the bottom face of the cone with which to test.\n";
+PyObject* KX_RadarSensor::PyGetConeTarget(PyObject* self) {
+       ShowDeprecationWarning("getConeTarget()", "the coneTarget property");
+
+       PyObject *retVal = PyList_New(3);
+       
+       PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_cone_target[0]));
+       PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_cone_target[1]));
+       PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_cone_target[2]));
+       
+       return retVal;
+}
+
+/* getConeHeight */
+const char KX_RadarSensor::GetConeHeight_doc[] = 
+"getConeHeight()\n"
+"\tReturns the height of the cone with which to test.\n";
+PyObject* KX_RadarSensor::PyGetConeHeight(PyObject* self) {
+                                                                                         
+       ShowDeprecationWarning("getConeHeight()", "the distance property");
+
+       return PyFloat_FromDouble(m_coneheight);
+}
+//<----- Deprecated
+
+/* ------------------------------------------------------------------------- */
+/* Python Integration Hooks                                                  */
+/* ------------------------------------------------------------------------- */
 PyTypeObject KX_RadarSensor::Type = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,
@@ -221,46 +279,39 @@ PyParentObject KX_RadarSensor::Parents[] = {
 };
 
 PyMethodDef KX_RadarSensor::Methods[] = {
+       //Deprecated ----->
        {"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin, 
-        METH_NOARGS, (PY_METHODCHAR)GetConeOrigin_doc},
+        METH_VARARGS, (PY_METHODCHAR)GetConeOrigin_doc},
        {"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget, 
-        METH_NOARGS, (PY_METHODCHAR)GetConeTarget_doc},
+        METH_VARARGS, (PY_METHODCHAR)GetConeTarget_doc},
        {"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight, 
-        METH_NOARGS, (PY_METHODCHAR)GetConeHeight_doc},
-       {NULL,NULL,NULL,NULL} //Sentinel
+        METH_VARARGS, (PY_METHODCHAR)GetConeHeight_doc},
+        //<-----
+       {NULL} //Sentinel
 };
 
 PyAttributeDef KX_RadarSensor::Attributes[] = {
-       { NULL }        //Sentinel
+       KX_PYATTRIBUTE_FLOAT_ARRAY_RO("coneOrigin", KX_RadarSensor, m_cone_origin, 3),
+       KX_PYATTRIBUTE_FLOAT_ARRAY_RO("coneTarget", KX_RadarSensor, m_cone_target, 3),
+       KX_PYATTRIBUTE_FLOAT_RW("angle", 0, 360, KX_RadarSensor, m_coneradius),
+       KX_PYATTRIBUTE_INT_RW("axis", 0, 5, true, KX_RadarSensor, m_axis),
+       {NULL} //Sentinel
 };
 
-PyObject* KX_RadarSensor::_getattr(const char *attr) {
-       _getattr_up(KX_TouchSensor);
-}
+PyObject* KX_RadarSensor::_getattr(const char *attr)
+{
+       PyObject* object = _getattr_self(Attributes, this, attr);
+       if (object != NULL)
+               return object;
 
-/* getConeOrigin */
-const char KX_RadarSensor::GetConeOrigin_doc[] = 
-"getConeOrigin()\n"
-"\tReturns the origin of the cone with which to test. The origin\n"
-"\tis in the middle of the cone.";
-PyObject* KX_RadarSensor::PyGetConeOrigin(PyObject* self) {
-       return PyObjectFrom(m_cone_origin);
+       _getattr_up(KX_NearSensor);
 }
 
-/* getConeOrigin */
-const char KX_RadarSensor::GetConeTarget_doc[] = 
-"getConeTarget()\n"
-"\tReturns the center of the bottom face of the cone with which to test.\n";
-PyObject* KX_RadarSensor::PyGetConeTarget(PyObject* self) {
-       return PyObjectFrom(m_cone_target);
-}
+int KX_RadarSensor::_setattr(const char *attr, PyObject* value)
+{
+       int ret = _setattr_self(Attributes, this, attr, value);
+       if (ret >= 0)
+               return ret;
 
-/* getConeOrigin */
-const char KX_RadarSensor::GetConeHeight_doc[] = 
-"getConeHeight()\n"
-"\tReturns the height of the cone with which to test.\n";
-PyObject* KX_RadarSensor::PyGetConeHeight(PyObject* self) {
-       return PyFloat_FromDouble(m_coneheight);
+       return KX_NearSensor::_setattr(attr, value);
 }
-
-
index e4c6d73f22dabbebf63a8612df47b53b8cde2602..6dfe0c42f5de5985be38078e24337c34b245e2d4 100644 (file)
@@ -40,23 +40,23 @@ class KX_RadarSensor : public KX_NearSensor
  protected:
        Py_Header;
                
-       MT_Scalar               m_coneradius;
+       float           m_coneradius;
 
        /**
         * Height of the cone.
         */
-       MT_Scalar               m_coneheight;
+       float           m_coneheight;
        int                             m_axis;
 
        /**
         * The previous position of the origin of the cone.
         */
-       MT_Point3       m_cone_origin;
+       float       m_cone_origin[3];
 
        /**
         * The previous direction of the cone (origin to bottom plane).
         */
-       MT_Point3       m_cone_target;
+       float       m_cone_target[3];
        
 public:
 
@@ -80,13 +80,23 @@ public:
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
-       
+       enum RadarAxis {
+               KX_RADAR_AXIS_POS_X = 0,
+               KX_RADAR_AXIS_POS_Y,
+               KX_RADAR_AXIS_POS_Z,
+               KX_RADAR_AXIS_NEG_X,
+               KX_RADAR_AXIS_NEG_Y,
+               KX_RADAR_AXIS_NEG_Z
+       };
+
        virtual PyObject* _getattr(const char *attr);
+       virtual int _setattr(const char *attr, PyObject* value);
 
+       //Deprecated ----->
        KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin);
        KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeTarget);
        KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeHeight);
-
+       //<-----
 };
 
 #endif //__KX_RADAR_SENSOR_H
index 32fcc148395ab3c750534c222aad942ef90a3621..705b54edd3784dfd17c5b0c6e0188b99b755fa54 100644 (file)
@@ -269,6 +269,7 @@ PyParentObject KX_TouchSensor::Parents[] = {
 };
 
 PyMethodDef KX_TouchSensor::Methods[] = {
+       //Deprecated ----->
        {"setProperty", 
         (PyCFunction) KX_TouchSensor::sPySetProperty,      METH_O, (PY_METHODCHAR)SetProperty_doc},
        {"getProperty", 
@@ -277,12 +278,13 @@ PyMethodDef KX_TouchSensor::Methods[] = {
         (PyCFunction) KX_TouchSensor::sPyGetHitObject,     METH_NOARGS, (PY_METHODCHAR)GetHitObject_doc},
        {"getHitObjectList", 
         (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (PY_METHODCHAR)GetHitObjectList_doc},
+        //<-----
        {NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_TouchSensor::Attributes[] = {
-       KX_PYATTRIBUTE_STRING_RW("propertyName",0,100,false,KX_TouchSensor,m_touchedpropname),
-       KX_PYATTRIBUTE_BOOL_RW("materialCheck",KX_TouchSensor,m_bFindMaterial),
+       KX_PYATTRIBUTE_STRING_RW("property",0,100,false,KX_TouchSensor,m_touchedpropname),
+       KX_PYATTRIBUTE_BOOL_RW("useMaterial",KX_TouchSensor,m_bFindMaterial),
        KX_PYATTRIBUTE_BOOL_RW("pulseCollisions",KX_TouchSensor,m_bTouchPulse),
        KX_PYATTRIBUTE_DUMMY("objectHit"),
        KX_PYATTRIBUTE_DUMMY("objectHitList"),
@@ -372,6 +374,9 @@ PyObject* KX_TouchSensor::PyGetHitObjectList(PyObject* self)
        return m_colliders->AddRef();
 }
 
+/*getTouchMaterial and setTouchMaterial were never added to the api,
+they can probably be removed with out anyone noticing*/
+
 /* 5. getTouchMaterial */
 const char KX_TouchSensor::GetTouchMaterial_doc[] = 
 "getTouchMaterial()\n"
index c523736967b799803a3fecca23850d5f647a847e..18ce9406a9ba4466715b191c55536315d0bc934f 100644 (file)
@@ -123,6 +123,7 @@ public:
        virtual PyObject* _getattr(const char *attr);
        virtual int _setattr(const char *attr, PyObject *value);
 
+       //Deprecated ----->
        /* 1. setProperty */
        KX_PYMETHOD_DOC_O(KX_TouchSensor,SetProperty);
        /* 2. getProperty */
@@ -137,6 +138,7 @@ public:
        /* 6. setTouchMaterial */
        KX_PYMETHOD_DOC_O(KX_TouchSensor,SetTouchMaterial);
 #endif
+       //<-----
        
 };
 
index f743acf06feb2bed7496a2a313967a2d07c3d9d6..0524a9df355cb460f4189b0c767d06e71cfcea25 100644 (file)
@@ -140,6 +140,14 @@ Documentation for the GameLogic Module.
 @var KX_SOUNDACT_LOOPEND:                  See L{KX_SoundActuator}
 @var KX_SOUNDACT_LOOPBIDIRECTIONAL:        See L{KX_SoundActuator}
 @var KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:    See L{KX_SoundActuator}
+
+@group Radar Sensor: KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
+@var KX_RADAR_AXIS_POS_X:                  See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_POS_Y:                  See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_POS_Z:                  See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_X:                  See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_Y:                  See L{KX_RadarSensor}
+@var KX_RADAR_AXIS_NEG_Z:                  See L{KX_RadarSensor}
 """
 
 
index fef2e4b2acc50f99fd85d828786f7c397d757eb6..a8c408827fef75bfc2b2083fb84032307d65ca12 100644 (file)
@@ -5,5 +5,10 @@ from KX_TouchSensor import *
 class KX_NearSensor(KX_TouchSensor):
        """
        A near sensor is a specialised form of touch sensor.
+       
+       @ivar distance: The near sensor activates when an object is within this distance.
+       @type distance: float
+       @ivar resetDistance: The near sensor deactivates when the object exceeds this distance.
+       @type resetDistance: float
        """
 
index 64be858371a733a1f2aef02c3260efda7d6e7ee1..b68bf4ea0f3ee050e45234d1b14464726b7bd312 100644 (file)
@@ -5,8 +5,26 @@ from KX_NearSensor import *
 class KX_RadarSensor(KX_NearSensor):
        """
        Radar sensor is a near sensor with a conical sensor object.
+       
+       @ivar coneOrigin: The origin of the cone with which to test. The origin
+                                               is in the middle of the cone.
+                                               (Read only)
+       @type coneOrigin: list of floats [x, y, z]
+       @ivar coneTarget: The center of the bottom face of the cone with which to test.
+                                               (Read only)
+       @type coneTarget: list of floats [x, y, z]
+       @ivar distance: The height of the cone with which to test.
+       @type distance: float
+       @ivar angle: The angle of the cone (in degrees) with which to test.
+       @type angle: float from 0 to 360
+       @ivar axis: The axis on which the radar cone is cast
+       @type axis: int from 0 to 5
+               KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z,
+               KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
        """
        
+       
+       #--The following methods are deprecated, please use properties instead.
        def getConeOrigin():
                """
                Returns the origin of the cone with which to test. The origin
index 24b81bbf55e36a289e9cb8a6eb841b46865aa843..5e357e6eefca554e4ab0851bfd5846092f617278 100644 (file)
@@ -70,3 +70,16 @@ class KX_Scene:
                @rtype: string
                """
 
+       def addObject(object, other, time=0)
+               """
+               Adds an object to the scene like the Add Object Actuator would, and returns the created object.
+               
+               @param object: The object to add
+               @type object: L{KX_GameObject} or string
+               @param other: The object's center to use when adding the object
+               @type other: L{KX_GameObject} or string
+               @param time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
+               @type time: int
+               
+               @rtype: L{KX_GameObject}
+               """
index 4f020930c4c3cef161104705b9730761b11ef803..d7277be4c2ae2aa7d47003d1d2c54d51f061ad7a 100644 (file)
@@ -7,10 +7,11 @@ class KX_TouchSensor(SCA_ISensor):
        """
        Touch sensor detects collisions between objects.
        
-       @ivar propertyName: The name of the property or material this sensor detects (depending on the materialCheck property).
-       @type propertyName: string
-       @ivar materialCheck: when enabled this sensor checks for object materials rather then properties.
-       @type materialCheck: bool
+       @ivar property: The property or material to collide with.
+       @type property: string
+       @ivar useMaterial: Determines if the sensor is looking for a property or material.
+                                               KX_True = Find material; KX_False = Find property
+       @type useMaterial: boolean
        @ivar pulseCollisions: The last collided object.
        @type pulseCollisions: bool
        @ivar objectHit: The last collided object. (Read Only)
@@ -18,24 +19,26 @@ class KX_TouchSensor(SCA_ISensor):
        @ivar objectHitList: A list of colliding objects. (Read Only)
        @type objectHitList: list
        """
+               
+       #--The following methods are deprecated, please use properties instead.
        def setProperty(name):
                """
-               DEPRECATED: use the propertyName property
+               DEPRECATED: use the property property
                Set the property or material to collide with. Use
                setTouchMaterial() to switch between properties and
                materials.
                @type name: string
                """
+               
        def getProperty():
                """
-               DEPRECATED: use the propertyName property
+               DEPRECATED: use the property property
                Returns the property or material to collide with. Use
                getTouchMaterial() to find out whether this sensor
                looks for properties or materials. (B{deprecated})
                
                @rtype: string
                """
-
        def getHitObject():
                """
                DEPRECATED: use the objectHit property
@@ -54,7 +57,7 @@ class KX_TouchSensor(SCA_ISensor):
                """
        def getTouchMaterial():
                """
-               DEPRECATED: use the materialCheck property
+               DEPRECATED: use the useMaterial property
                Returns KX_TRUE if this sensor looks for a specific material,
                KX_FALSE if it looks for a specific property. (B{deprecated})
                """