diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-01-05 18:37:12 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-01-05 18:37:12 -0300 |
commit | b51f64571151cad5da8e5ed20ef52a8b0ffc3534 (patch) | |
tree | 265653ff8a5627321332c3a96cc2978dc516b5c3 /scene/2d/physics_body_2d.h | |
parent | 1ff0d5c4e57538463081c774dc40a6f8323e6cb9 (diff) |
Changes to 2D physics engine
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-Removed "density" property
-Added instead more flexible "angular damp" and "linear damp"
-Added ability to override angular and linear damp in rigidbody
-Added gravity scale option rigidbody
Test well and iron out bugs, when it works the same will be moved to 3D
Diffstat (limited to 'scene/2d/physics_body_2d.h')
-rw-r--r-- | scene/2d/physics_body_2d.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index ca7b757497..956999ce31 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -119,6 +119,9 @@ private: real_t bounce; real_t mass; real_t friction; + real_t gravity_scale; + real_t linear_damp; + real_t angular_damp; Vector2 linear_velocity; real_t angular_velocity; @@ -198,6 +201,15 @@ public: void set_bounce(real_t p_bounce); real_t get_bounce() const; + void set_gravity_scale(real_t p_gravity_scale); + real_t get_gravity_scale() const; + + void set_linear_damp(real_t p_linear_damp); + real_t get_linear_damp() const; + + void set_angular_damp(real_t p_angular_damp); + real_t get_angular_damp() const; + void set_linear_velocity(const Vector2& p_velocity); Vector2 get_linear_velocity() const; |