Browse Source

Rename sensor to trigger.

aster2013 11 years ago
parent
commit
1ba3fe00fa

+ 3 - 3
Source/Engine/LuaScript/pkgs/Urho2D/CollisionShape2D.pkg

@@ -2,7 +2,7 @@ $#include "CollisionShape2D.h"
 
 
 class CollisionShape2D : Component
 class CollisionShape2D : Component
 {
 {
-    void SetSensor(bool sensor);
+    void SetTrigger(bool trigger);
     void SetCategoryBits(int categoryBits);
     void SetCategoryBits(int categoryBits);
     void SetMaskBits(int maskBits);
     void SetMaskBits(int maskBits);
     void SetGroupIndex(int groupIndex);
     void SetGroupIndex(int groupIndex);
@@ -10,7 +10,7 @@ class CollisionShape2D : Component
     void SetFriction(float friction);
     void SetFriction(float friction);
     void SetRestitution(float restitution);
     void SetRestitution(float restitution);
 
 
-    bool IsSensor() const;
+    bool IsTrigger() const;
     int GetCategoryBits() const;
     int GetCategoryBits() const;
     int GetMaskBits() const;
     int GetMaskBits() const;
     int GetGroupIndex() const;
     int GetGroupIndex() const;
@@ -21,7 +21,7 @@ class CollisionShape2D : Component
     float GetInertia() const;
     float GetInertia() const;
     Vector2 GetMassCenter() const;
     Vector2 GetMassCenter() const;
 
 
-    tolua_property__is_set bool sensor;
+    tolua_property__is_set bool trigger;
     tolua_property__get_set int categoryBits;
     tolua_property__get_set int categoryBits;
     tolua_property__get_set int maskBits;
     tolua_property__get_set int maskBits;
     tolua_property__get_set int groupIndex;
     tolua_property__get_set int groupIndex;

+ 2 - 2
Source/Engine/Script/Urho2DAPI.cpp

@@ -307,8 +307,8 @@ template <class T> void RegisterCollisionShape2D(asIScriptEngine* engine, const
 {
 {
     RegisterComponent<T>(engine, className);
     RegisterComponent<T>(engine, className);
     RegisterSubclass<CollisionShape2D, T>(engine, "CollisionShape2D", className);
     RegisterSubclass<CollisionShape2D, T>(engine, "CollisionShape2D", className);
-    engine->RegisterObjectMethod(className, "void set_sensor(bool)", asMETHOD(T, SetSensor), asCALL_THISCALL);
-    engine->RegisterObjectMethod(className, "bool get_sensor() const", asMETHOD(T, IsSensor), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "void set_trigger(bool)", asMETHOD(T, SetTrigger), asCALL_THISCALL);
+    engine->RegisterObjectMethod(className, "bool get_trigger() const", asMETHOD(T, IsTrigger), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_categoryBits(int)", asMETHOD(T, SetCategoryBits), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_categoryBits(int)", asMETHOD(T, SetCategoryBits), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "int get_categoryBits() const", asMETHOD(T, GetCategoryBits), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "int get_categoryBits() const", asMETHOD(T, GetCategoryBits), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_maskBits(int)", asMETHOD(T, SetMaskBits), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "void set_maskBits(int)", asMETHOD(T, SetMaskBits), asCALL_THISCALL);

+ 5 - 5
Source/Engine/Urho2D/CollisionShape2D.cpp

@@ -54,7 +54,7 @@ CollisionShape2D::~CollisionShape2D()
 
 
 void CollisionShape2D::RegisterObject(Context* context)
 void CollisionShape2D::RegisterObject(Context* context)
 {
 {
-    ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_BOOL, "Sensor", IsSensor, SetSensor, bool, false, AM_DEFAULT);
+    ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_BOOL, "Trigger", IsTrigger, SetTrigger, bool, false, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Category Bits", GetCategoryBits, SetCategoryBits, int, 0, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Category Bits", GetCategoryBits, SetCategoryBits, int, 0, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Mask Bits", GetMaskBits, SetMaskBits, int, 0, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Mask Bits", GetMaskBits, SetMaskBits, int, 0, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Group Index", GetGroupIndex, SetGroupIndex, int, 0, AM_DEFAULT);
     ACCESSOR_ATTRIBUTE(CollisionShape2D, VAR_INT, "Group Index", GetGroupIndex, SetGroupIndex, int, 0, AM_DEFAULT);
@@ -81,15 +81,15 @@ void CollisionShape2D::OnSetEnabled()
     }
     }
 }
 }
 
 
-void CollisionShape2D::SetSensor(bool sensor)
+void CollisionShape2D::SetTrigger(bool trigger)
 {
 {
-    if (fixtureDef_.isSensor == sensor)
+    if (fixtureDef_.isSensor == trigger)
         return;
         return;
 
 
-    fixtureDef_.isSensor = sensor;
+    fixtureDef_.isSensor = trigger;
 
 
     if (fixture_)
     if (fixture_)
-        fixture_->SetSensor(sensor);
+        fixture_->SetSensor(trigger);
     
     
     MarkNetworkUpdate();
     MarkNetworkUpdate();
 }
 }

+ 4 - 4
Source/Engine/Urho2D/CollisionShape2D.h

@@ -46,8 +46,8 @@ public:
     /// Handle enabled/disabled state change.
     /// Handle enabled/disabled state change.
     virtual void OnSetEnabled();
     virtual void OnSetEnabled();
 
 
-    /// Set sensor (trigger).
-    void SetSensor(bool sensor);
+    /// Set trigger.
+    void SetTrigger(bool trigger);
     /// Set filter category bits.
     /// Set filter category bits.
     void SetCategoryBits(int categoryBits);
     void SetCategoryBits(int categoryBits);
     /// Set filter mask bits.
     /// Set filter mask bits.
@@ -66,8 +66,8 @@ public:
     /// Release fixture.
     /// Release fixture.
     void ReleaseFixture();
     void ReleaseFixture();
 
 
-    /// Return sensor (trigger).
-    bool IsSensor() const { return fixtureDef_.isSensor; }
+    /// Return trigger.
+    bool IsTrigger() const { return fixtureDef_.isSensor; }
     /// Return filter category bits.
     /// Return filter category bits.
     int GetCategoryBits() const { return fixtureDef_.filter.categoryBits; }
     int GetCategoryBits() const { return fixtureDef_.filter.categoryBits; }
     /// Return filter mask bits.
     /// Return filter mask bits.