Browse Source

Add Lua binding for Constraint2D.

aster2013 11 years ago
parent
commit
1f90e248e9

+ 19 - 0
Source/Engine/LuaScript/pkgs/Urho2D/ConstraintDistance2D.pkg

@@ -0,0 +1,19 @@
+$#include "ConstraintDistance2D.h"
+
+class ConstraintDistance2D : Constraint2D
+{
+    void SetOwnerBodyAnchor(const Vector2& anchor);
+    void SetOtherBodyAnchor(const Vector2& anchor);
+    void SetFrequencyHz(float frequencyHz);
+    void SetDampingRatio(float dampingRatio);
+
+    const Vector2& GetOwnerBodyAnchor() const;
+    const Vector2& GetOtherBodyAnchor() const;
+    float GetFrequencyHz() const;
+    float GetDampingRatio() const;
+
+    tolua_property__get_set Vector2& ownerBodyAnchor;
+    tolua_property__get_set Vector2& otherBodyAnchor;
+    tolua_property__get_set float frequencyHz;
+    tolua_property__get_set float dampingRatio;
+};

+ 16 - 0
Source/Engine/LuaScript/pkgs/Urho2D/ConstraintFriction2D.pkg

@@ -0,0 +1,16 @@
+$#include "ConstraintFriction2D.h"
+
+class ConstraintFriction2D : Constraint2D
+{
+    void SetAnchorPoint(const Vector2& anchor);
+    void SetMaxForce(float maxForce);
+    void SetMaxTorque(float maxTorque);
+
+    const Vector2& GetAnchorPoint() const;
+    float GetMaxForce() const;
+    float GetMaxTorque() const;
+
+    tolua_property__get_set Vector2& anchorPoint;
+    tolua_property__get_set float maxForce;
+    tolua_property__get_set float maxTorque;
+};

+ 22 - 0
Source/Engine/LuaScript/pkgs/Urho2D/ConstraintPulley2D.pkg

@@ -0,0 +1,22 @@
+$#include "ConstraintPulley2D.h"
+
+class ConstraintPulley2D : Constraint2D
+{
+    void SetOwnerBodyGroundAnchor(const Vector2& groundAnchor);
+    void SetOtherBodyGroundAnchor(const Vector2& groundAnchor);
+    void SetOwnerBodyAnchor(const Vector2& anchor);
+    void SetOtherBodyAnchor(const Vector2& anchor);
+    void SetRatio(float ratio);
+
+    const Vector2& GetOwnerBodyGroundAnchor() const;
+    const Vector2& GetOtherBodyGroundAnchor() const;
+    const Vector2& GetOwnerBodyAnchor() const;
+    const Vector2& GetOtherBodyAnchor() const;
+    float GetRatio() const;
+
+    tolua_property__get_set Vector2& ownerBodyGroundAnchor;
+    tolua_property__get_set Vector2& otherBodyGroundAnchor;
+    tolua_property__get_set Vector2& ownerBodyAnchor;
+    tolua_property__get_set Vector2& otherBodyAnchor;
+    tolua_property__get_set float ratio;
+};