diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-12-06 18:10:13 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-12-07 12:08:04 -0700 |
commit | 8682adcb8726459d2a0366dcea0a59ce742bee43 (patch) | |
tree | 5eade5f25ecd9247d3a926d9b27bddc7416287cb /servers/physics_3d/godot_space_3d.h | |
parent | 4bce5e302ef8cc6fcd0caf5137f0c1d3abdb88c2 (diff) | |
download | redot-engine-8682adcb8726459d2a0366dcea0a59ce742bee43.tar.gz |
Add physics solver settings to project settings
Helps with discovery and setup of physics solver settings, in a specific
project settings section for both 2D and 3D.
Other changes for cleanup:
-Removed unused space parameters in 3D
SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS
-Added custom solver bias for Shape3D (same as Shape2D)
-Improved documentation for solver settings
Diffstat (limited to 'servers/physics_3d/godot_space_3d.h')
-rw-r--r-- | servers/physics_3d/godot_space_3d.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/servers/physics_3d/godot_space_3d.h b/servers/physics_3d/godot_space_3d.h index b9aeee7583..fbdb65e29c 100644 --- a/servers/physics_3d/godot_space_3d.h +++ b/servers/physics_3d/godot_space_3d.h @@ -75,10 +75,10 @@ public: private: uint64_t elapsed_time[ELAPSED_TIME_MAX] = {}; - GodotPhysicsDirectSpaceState3D *direct_access; + GodotPhysicsDirectSpaceState3D *direct_access = nullptr; RID self; - GodotBroadPhase3D *broadphase; + GodotBroadPhase3D *broadphase = nullptr; SelfList<GodotBody3D>::List active_list; SelfList<GodotBody3D>::List mass_properties_update_list; SelfList<GodotBody3D>::List state_query_list; @@ -93,13 +93,12 @@ private: GodotArea3D *area = nullptr; - int solver_iterations = 16; + int solver_iterations = 0; - real_t contact_recycle_radius = 0.01; - real_t contact_max_separation = 0.05; - real_t contact_max_allowed_penetration = 0.01; - real_t contact_bias = 0.8; - real_t constraint_bias = 0.01; + real_t contact_recycle_radius = 0.0; + real_t contact_max_separation = 0.0; + real_t contact_max_allowed_penetration = 0.0; + real_t contact_bias = 0.0; enum { INTERSECTION_QUERY_MAX = 2048 @@ -108,10 +107,9 @@ private: GodotCollisionObject3D *intersection_query_results[INTERSECTION_QUERY_MAX]; int intersection_query_subindex_results[INTERSECTION_QUERY_MAX]; - real_t body_linear_velocity_sleep_threshold; - real_t body_angular_velocity_sleep_threshold; - real_t body_time_to_sleep; - real_t body_angular_velocity_damp_ratio; + real_t body_linear_velocity_sleep_threshold = 0.0; + real_t body_angular_velocity_sleep_threshold = 0.0; + real_t body_time_to_sleep = 0.0; bool locked = false; @@ -167,11 +165,9 @@ public: _FORCE_INLINE_ real_t get_contact_max_separation() const { return contact_max_separation; } _FORCE_INLINE_ real_t get_contact_max_allowed_penetration() const { return contact_max_allowed_penetration; } _FORCE_INLINE_ real_t get_contact_bias() const { return contact_bias; } - _FORCE_INLINE_ real_t get_constraint_bias() const { return constraint_bias; } _FORCE_INLINE_ real_t get_body_linear_velocity_sleep_threshold() const { return body_linear_velocity_sleep_threshold; } _FORCE_INLINE_ real_t get_body_angular_velocity_sleep_threshold() const { return body_angular_velocity_sleep_threshold; } _FORCE_INLINE_ real_t get_body_time_to_sleep() const { return body_time_to_sleep; } - _FORCE_INLINE_ real_t get_body_angular_velocity_damp_ratio() const { return body_angular_velocity_damp_ratio; } void update(); void setup(); |