diff options
| author | Rémi Verschelde | 2016-10-09 14:08:50 +0200 |
|---|---|---|
| committer | GitHub | 2016-10-09 14:08:50 +0200 |
| commit | 1c6058a5bc3db61aa12c3fae11b216828e2bc5a5 (patch) | |
| tree | c38c4e011451c19f37bd11b59d8925edd59df2b9 /servers | |
| parent | fb856e532e4c7a4fb7a61c1e9431bc664a77dbfc (diff) | |
| parent | 1d09c27ba4b94e677b66d8d2c2b9e38f7829ad38 (diff) | |
| download | godot-1c6058a5bc3db61aa12c3fae11b216828e2bc5a5.tar.gz godot-1c6058a5bc3db61aa12c3fae11b216828e2bc5a5.tar.zst godot-1c6058a5bc3db61aa12c3fae11b216828e2bc5a5.zip | |
Merge pull request #6691 from Faless/expose_more_physics
Expose more 2D/3D physics options in project settings (#5029)
Diffstat (limited to 'servers')
| -rw-r--r-- | servers/physics/space_sw.cpp | 2 | ||||
| -rw-r--r-- | servers/physics/space_sw.h | 1 | ||||
| -rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 14 | ||||
| -rw-r--r-- | servers/physics_2d/space_2d_sw.h | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 707714642..9755c49e2 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -721,7 +721,7 @@ SpaceSW::SpaceSW() { constraint_bias = 0.01; body_linear_velocity_sleep_threshold=GLOBAL_DEF("physics/sleep_threshold_linear",0.1); body_angular_velocity_sleep_threshold=GLOBAL_DEF("physics/sleep_threshold_angular", (8.0 / 180.0 * Math_PI) ); - body_time_to_sleep=0.5; + body_time_to_sleep=GLOBAL_DEF("physics/time_before_sleep",0.5); body_angular_velocity_damp_ratio=10; diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index 3fdef7e62..29eca2690 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -37,6 +37,7 @@ #include "area_pair_sw.h" #include "broad_phase_sw.h" #include "collision_object_sw.h" +#include "globals.h" class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState { diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 3d702ebb9..56bee8b0c 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -1324,14 +1324,14 @@ Space2DSW::Space2DSW() { contact_debug_count=0; locked=false; - contact_recycle_radius=0.01; - contact_max_separation=0.05; - contact_max_allowed_penetration= 0.01; + contact_recycle_radius=1.0; + contact_max_separation=1.5; + contact_max_allowed_penetration= 0.3; - constraint_bias = 0.01; - body_linear_velocity_sleep_treshold=0.01; - body_angular_velocity_sleep_treshold=(8.0 / 180.0 * Math_PI); - body_time_to_sleep=0.5; + constraint_bias = 0.2; + body_linear_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threashold_linear",2.0); + body_angular_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threshold_angular",(8.0 / 180.0 * Math_PI)); + body_time_to_sleep=GLOBAL_DEF("physics_2d/time_before_sleep",0.5); broadphase = BroadPhase2DSW::create_func(); diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index f58e8c3fe..45a3e4ca8 100644 --- a/servers/physics_2d/space_2d_sw.h +++ b/servers/physics_2d/space_2d_sw.h @@ -37,6 +37,7 @@ #include "area_pair_2d_sw.h" #include "broad_phase_2d_sw.h" #include "collision_object_2d_sw.h" +#include "globals.h" class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState { |
