summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2023-01-31 00:01:21 +0100
committersmix8 <52464204+smix8@users.noreply.github.com>2023-01-31 18:26:52 +0100
commit026549db2eee3e5b356304e910e15e416f330c5e (patch)
treedbe8084a518c750b1ba3957e3d837cd124561d47 /servers/physics_3d
parent2b710bc336a02ace95eb0588f3b0744923faf004 (diff)
Create default World physics spaces on demand only
Changes that the default physics spaces of World resources are only created on first use.
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/godot_space_3d.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/servers/physics_3d/godot_space_3d.cpp b/servers/physics_3d/godot_space_3d.cpp
index 93572965d2..35f6fa023d 100644
--- a/servers/physics_3d/godot_space_3d.cpp
+++ b/servers/physics_3d/godot_space_3d.cpp
@@ -1250,14 +1250,14 @@ GodotPhysicsDirectSpaceState3D *GodotSpace3D::get_direct_state() {
}
GodotSpace3D::GodotSpace3D() {
- body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_linear", 0.1);
- body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_angular", Math::deg_to_rad(8.0));
- body_time_to_sleep = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"), 0.5);
- solver_iterations = GLOBAL_DEF(PropertyInfo(Variant::INT, "physics/3d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater"), 16);
- contact_recycle_radius = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_recycle_radius", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater"), 0.01);
- contact_max_separation = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater"), 0.05);
- contact_max_allowed_penetration = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_max_allowed_penetration", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater"), 0.01);
- contact_bias = GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "physics/3d/solver/default_contact_bias", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.8);
+ body_linear_velocity_sleep_threshold = GLOBAL_GET("physics/3d/sleep_threshold_linear");
+ body_angular_velocity_sleep_threshold = GLOBAL_GET("physics/3d/sleep_threshold_angular");
+ body_time_to_sleep = GLOBAL_GET("physics/3d/time_before_sleep");
+ solver_iterations = GLOBAL_GET("physics/3d/solver/solver_iterations");
+ contact_recycle_radius = GLOBAL_GET("physics/3d/solver/contact_recycle_radius");
+ contact_max_separation = GLOBAL_GET("physics/3d/solver/contact_max_separation");
+ contact_max_allowed_penetration = GLOBAL_GET("physics/3d/solver/contact_max_allowed_penetration");
+ contact_bias = GLOBAL_GET("physics/3d/solver/default_contact_bias");
broadphase = GodotBroadPhase3D::create_func();
broadphase->set_pair_callback(_broadphase_pair, this);