Constraint.pkg 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. $#include "Constraint.h"
  2. enum ConstraintType
  3. {
  4. CONSTRAINT_POINT = 0,
  5. CONSTRAINT_HINGE,
  6. CONSTRAINT_SLIDER,
  7. CONSTRAINT_CONETWIST
  8. };
  9. class Constraint : public Component
  10. {
  11. void SetConstraintType(ConstraintType type);
  12. void SetOtherBody(RigidBody* body);
  13. void SetPosition(const Vector3& position);
  14. void SetRotation(const Quaternion& rotation);
  15. void SetAxis(const Vector3& axis);
  16. void SetOtherPosition(const Vector3& position);
  17. void SetOtherRotation(const Quaternion& rotation);
  18. void SetOtherAxis(const Vector3& axis);
  19. void SetWorldPosition(const Vector3& position);
  20. void SetHighLimit(const Vector2& limit);
  21. void SetLowLimit(const Vector2& limit);
  22. void SetERP(float erp);
  23. void SetCFM(float cfm);
  24. void SetDisableCollision(bool disable);
  25. PhysicsWorld* GetPhysicsWorld() const;
  26. ConstraintType GetConstraintType() const;
  27. RigidBody* GetOwnBody() const;
  28. RigidBody* GetOtherBody() const;
  29. const Vector3& GetPosition() const;
  30. const Quaternion& GetRotation() const;
  31. const Vector3& GetOtherPosition() const;
  32. const Quaternion& GetOtherRotation() const;
  33. Vector3 GetWorldPosition() const;
  34. const Vector2& GetHighLimit() const;
  35. const Vector2& GetLowLimit() const;
  36. float GetERP() const;
  37. float GetCFM() const;
  38. bool GetDisableCollision() const;
  39. tolua_readonly tolua_property__get_set PhysicsWorld* physicsWorld;
  40. tolua_property__get_set ConstraintType constraintType;
  41. tolua_readonly tolua_property__get_set RigidBody* ownBody;
  42. tolua_property__get_set RigidBody* otherBody;
  43. tolua_property__get_set Vector3& position;
  44. tolua_property__get_set Quaternion& rotation;
  45. tolua_property__get_set Vector3& axis; // Write only property.
  46. tolua_property__get_set Vector3& otherPosition;
  47. tolua_property__get_set Quaternion& otherRotation;
  48. tolua_property__get_set Vector3& otherAxis; // Write only property.
  49. tolua_property__get_set Vector3 worldPosition;
  50. tolua_property__get_set Vector2& highLimit;
  51. tolua_property__get_set Vector2& lowLimit;
  52. tolua_property__get_set float ERP;
  53. tolua_property__get_set float CFM;
  54. tolua_property__get_set bool disableCollision;
  55. };
  56. ${
  57. #define TOLUA_DISABLE_tolua_get_Constraint_axis_ref
  58. #define tolua_get_Constraint_axis_ref NULL
  59. #define TOLUA_DISABLE_tolua_get_Constraint_otherAxis_ref
  60. #define tolua_get_Constraint_otherAxis_ref NULL
  61. $}