RigidBody2D.pkg 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. $#include "Urho2D/RigidBody2D.h"
  2. enum BodyType2D
  3. {
  4. BT_STATIC = b2_staticBody,
  5. BT_KINEMATIC = b2_kinematicBody,
  6. BT_DYNAMIC = b2_dynamicBody
  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 ApplyLinearImpulseToCenter(const Vector2& impulse, bool wake);
  29. void ApplyAngularImpulse(float impulse, bool wake);
  30. BodyType2D GetBodyType() const;
  31. float GetMass() const;
  32. float GetInertia() const;
  33. Vector2 GetMassCenter() const;
  34. bool GetUseFixtureMass() const;
  35. float GetLinearDamping() const;
  36. float GetAngularDamping() const;
  37. bool IsAllowSleep() const;
  38. bool IsFixedRotation() const;
  39. bool IsBullet() const;
  40. float GetGravityScale() const;
  41. bool IsAwake() const;
  42. Vector2 GetLinearVelocity() const;
  43. float GetAngularVelocity() const;
  44. tolua_property__get_set BodyType2D bodyType;
  45. tolua_property__get_set float mass;
  46. tolua_property__get_set float inertia;
  47. tolua_property__get_set Vector2 massCenter;
  48. tolua_property__get_set bool useFixtureMass;
  49. tolua_property__get_set float linearDamping;
  50. tolua_property__get_set float angularDamping;
  51. tolua_property__is_set bool allowSleep;
  52. tolua_property__is_set bool fixedRotation;
  53. tolua_property__is_set bool bullet;
  54. tolua_property__get_set float gravityScale;
  55. tolua_property__is_set bool awake;
  56. tolua_property__get_set Vector2 linearVelocity;
  57. tolua_property__get_set float angularVelocity;
  58. };