RigidBody2D.pkg 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. $#include "RigidBody2D.h"
  2. enum BodyType2D
  3. {
  4. BT_STATIC = b2_staticBody,
  5. BT_DYNAMIC = b2_dynamicBody,
  6. BT_KINEMATIC = b2_kinematicBody,
  7. };
  8. class RigidBody2D : Component
  9. {
  10. void SetBodyType(BodyType2D bodyType);
  11. void SetMass(float mass);
  12. void SetInertia(float inertia);
  13. void SetMassCenter(const Vector2& center);
  14. void SetUseFixtureMass(bool useFixtureMass);
  15. void SetLinearDamping(float linearDamping);
  16. void SetAngularDamping(float angularDamping);
  17. void SetAllowSleep(bool allowSleep);
  18. void SetFixedRotation(bool fixedRotation);
  19. void SetBullet(bool bullet);
  20. void SetGravityScale(float gravityScale);
  21. void SetAwake(bool awake);
  22. void SetLinearVelocity(const Vector2& linearVelocity);
  23. void SetAngularVelocity(float angularVelocity);
  24. void ApplyForce(const Vector2& force, const Vector2& point, bool wake);
  25. void ApplyForceToCenter(const Vector2& force, bool wake);
  26. void ApplyTorque(float torque, bool wake);
  27. void ApplyLinearImpulse(const Vector2& impulse, const Vector2& point, bool wake);
  28. void ApplyAngularImpulse(float impulse, bool wake);
  29. BodyType2D GetBodyType() const;
  30. float GetMass() const;
  31. float GetInertia() const;
  32. Vector2 GetMassCenter() const;
  33. bool GetUseFixtureMass() const;
  34. float GetLinearDamping() const;
  35. float GetAngularDamping() const;
  36. bool IsAllowSleep() const;
  37. bool IsFixedRotation() const;
  38. bool IsBullet() const;
  39. float GetGravityScale() const;
  40. bool IsAwake() const;
  41. Vector2 GetLinearVelocity() const;
  42. float GetAngularVelocity() const;
  43. tolua_property__get_set BodyType2D bodyType;
  44. tolua_property__get_set float mass;
  45. tolua_property__get_set float inertia;
  46. tolua_property__get_set Vector2 massCenter;
  47. tolua_property__get_set bool useFixtureMass;
  48. tolua_property__get_set float linearDamping;
  49. tolua_property__get_set float angularDamping;
  50. tolua_property__is_set bool allowSleep;
  51. tolua_property__is_set bool fixedRotation;
  52. tolua_property__is_set bool bullet;
  53. tolua_property__get_set float gravityScale;
  54. tolua_property__is_set bool awake;
  55. tolua_property__get_set Vector2 linearVelocity;
  56. tolua_property__get_set float angularVelocity;
  57. };