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 /servers/physics_2d/area_2d_sw.h | |
parent | 1ff0d5c4e57538463081c774dc40a6f8323e6cb9 (diff) | |
download | redot-engine-b51f64571151cad5da8e5ed20ef52a8b0ffc3534.tar.gz |
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 'servers/physics_2d/area_2d_sw.h')
-rw-r--r-- | servers/physics_2d/area_2d_sw.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h index 0eda1050fa..d94b2f9ccf 100644 --- a/servers/physics_2d/area_2d_sw.h +++ b/servers/physics_2d/area_2d_sw.h @@ -47,7 +47,8 @@ class Area2DSW : public CollisionObject2DSW{ Vector2 gravity_vector; bool gravity_is_point; float point_attenuation; - float density; + float linear_damp; + float angular_damp; int priority; ObjectID monitor_callback_id; @@ -128,8 +129,11 @@ public: _FORCE_INLINE_ void set_point_attenuation(float p_point_attenuation) { point_attenuation=p_point_attenuation; } _FORCE_INLINE_ float get_point_attenuation() const { return point_attenuation; } - _FORCE_INLINE_ void set_density(float p_density) { density=p_density; } - _FORCE_INLINE_ float get_density() const { return density; } + _FORCE_INLINE_ void set_linear_damp(float p_linear_damp) { linear_damp=p_linear_damp; } + _FORCE_INLINE_ float get_linear_damp() const { return linear_damp; } + + _FORCE_INLINE_ void set_angular_damp(float p_angular_damp) { angular_damp=p_angular_damp; } + _FORCE_INLINE_ float get_angular_damp() const { return angular_damp; } _FORCE_INLINE_ void set_priority(int p_priority) { priority=p_priority; } _FORCE_INLINE_ int get_priority() const { return priority; } |