Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-03-13 21:04:38 +0300
committerMartin Poirier <theeth@yahoo.com>2009-03-13 21:04:38 +0300
commit54a55827ecee7f25d6a52255d8a639498a678fa6 (patch)
tree6311657bfab7e75fa59e6828e0381bdcd4ec9eda /source/gameengine/Ketsji/KX_NearSensor.h
parentdff781c2a8c77f35fefe00b0a561235861d4d053 (diff)
parent39acb4efa4c3f35806f5dc37124ff1028eb18215 (diff)
merging trunk 19093:19274etch-a-ton
Diffstat (limited to 'source/gameengine/Ketsji/KX_NearSensor.h')
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h
index 58c7cc7da91..ee03992e734 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.h
+++ b/source/gameengine/Ketsji/KX_NearSensor.h
@@ -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;
+ }
};