diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-10 22:10:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 22:10:41 +0100 |
commit | 0ba7103beac97ac33247e2b0ae5253c0f0c44801 (patch) | |
tree | 065700dcf546801fd5af968d4a85781c005e5047 /doc | |
parent | 0fba151446fe077e2b732812bbd70d0383b9558b (diff) | |
parent | 8682adcb8726459d2a0366dcea0a59ce742bee43 (diff) |
Merge pull request #55702 from nekomatata/physics-solver-settings
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Joint2D.xml | 1 | ||||
-rw-r--r-- | doc/classes/PhysicsServer2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/PhysicsServer3D.xml | 9 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 39 | ||||
-rw-r--r-- | doc/classes/Shape2D.xml | 3 | ||||
-rw-r--r-- | doc/classes/Shape3D.xml | 4 |
6 files changed, 49 insertions, 9 deletions
diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml index b003224ad4..6b32d680eb 100644 --- a/doc/classes/Joint2D.xml +++ b/doc/classes/Joint2D.xml @@ -11,6 +11,7 @@ <members> <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0"> When [member node_a] and [member node_b] move in different directions the [code]bias[/code] controls how fast the joint pulls them back to their original position. The lower the [code]bias[/code] the more the two bodies can pull on the joint. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/2d/solver/default_constraint_bias] is used. </member> <member name="disable_collision" type="bool" setter="set_exclude_nodes_from_collision" getter="get_exclude_nodes_from_collision" default="true"> If [code]true[/code], [member node_a] and [member node_b] can not collide. diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 556e2dae85..bfb4ca58ef 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -789,7 +789,7 @@ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter"> - Constant to set/get the maximum distance a shape can be from another before they are considered separated. + Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter"> Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 027c593de3..b264590055 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -1333,7 +1333,7 @@ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1" enum="SpaceParameter"> - Constant to set/get the maximum distance a shape can be from another before they are considered separated. + Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. </constant> <constant name="SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION" value="2" enum="SpaceParameter"> Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. @@ -1350,12 +1350,7 @@ <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="6" enum="SpaceParameter"> Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. </constant> - <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO" value="7" enum="SpaceParameter"> - </constant> - <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="8" enum="SpaceParameter"> - Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. - </constant> - <constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="9" enum="SpaceParameter"> + <constant name="SPACE_PARAM_SOLVER_ITERATIONS" value="7" enum="SpaceParameter"> Constant to set/get the number of solver iterations for contacts and constraints. The greater the amount of iterations, the more accurate the collisions and constraints will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. </constant> <constant name="BODY_AXIS_LINEAR_X" value="1" enum="BodyAxis"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ce9f41410a..a6303a8caf 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1421,6 +1421,26 @@ <member name="physics/2d/sleep_threshold_linear" type="float" setter="" getter="" default="2.0"> Threshold linear velocity under which a 2D physics body will be considered inactive. See [constant PhysicsServer2D.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD]. </member> + <member name="physics/2d/solver/contact_max_allowed_penetration" type="float" setter="" getter="" default="0.3"> + Maximum distance a shape can penetrate another shape before it is considered a collision. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION]. + </member> + <member name="physics/2d/solver/contact_max_separation" type="float" setter="" getter="" default="1.5"> + Maximum distance a shape can be from another before they are considered separated and the contact is discarded. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_MAX_SEPARATION]. + </member> + <member name="physics/2d/solver/contact_recycle_radius" type="float" setter="" getter="" default="1.0"> + Maximum distance a pair of bodies has to move before their collision status has to be recalculated. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_RECYCLE_RADIUS]. + </member> + <member name="physics/2d/solver/default_constraint_bias" type="float" setter="" getter="" default="0.2"> + Default solver bias for all physics constraints. Defines how much bodies react to enforce constraints. See [constant PhysicsServer2D.SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS]. + Individual constraints can have a specific bias value (see [member Joint2D.bias]). + </member> + <member name="physics/2d/solver/default_contact_bias" type="float" setter="" getter="" default="0.8"> + Default solver bias for all physics contacts. Defines how much bodies react to enforce contact separation. See [constant PhysicsServer2D.SPACE_PARAM_CONTACT_DEFAULT_BIAS]. + Individual shapes can have a specific bias value (see [member Shape2D.custom_solver_bias]). + </member> + <member name="physics/2d/solver/solver_iterations" type="int" setter="" getter="" default="16"> + Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer2D.SPACE_PARAM_SOLVER_ITERATIONS]. + </member> <member name="physics/2d/time_before_sleep" type="float" setter="" getter="" default="0.5"> Time (in seconds) of inactivity before which a 2D physics body will put to sleep. See [constant PhysicsServer2D.SPACE_PARAM_BODY_TIME_TO_SLEEP]. </member> @@ -1468,10 +1488,29 @@ Sets whether 3D physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. </member> <member name="physics/3d/sleep_threshold_angular" type="float" setter="" getter="" default="0.139626"> + Threshold angular velocity under which a 3D physics body will be considered inactive. See [constant PhysicsServer3D.SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD]. </member> <member name="physics/3d/sleep_threshold_linear" type="float" setter="" getter="" default="0.1"> + Threshold linear velocity under which a 3D physics body will be considered inactive. See [constant PhysicsServer3D.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD]. + </member> + <member name="physics/3d/solver/contact_max_allowed_penetration" type="float" setter="" getter="" default="0.01"> + Maximum distance a shape can penetrate another shape before it is considered a collision. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION]. + </member> + <member name="physics/3d/solver/contact_max_separation" type="float" setter="" getter="" default="0.05"> + Maximum distance a shape can be from another before they are considered separated and the contact is discarded. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_MAX_SEPARATION]. + </member> + <member name="physics/3d/solver/contact_recycle_radius" type="float" setter="" getter="" default="0.01"> + Maximum distance a pair of bodies has to move before their collision status has to be recalculated. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_RECYCLE_RADIUS]. + </member> + <member name="physics/3d/solver/default_contact_bias" type="float" setter="" getter="" default="0.8"> + Default solver bias for all physics contacts. Defines how much bodies react to enforce contact separation. See [constant PhysicsServer3D.SPACE_PARAM_CONTACT_DEFAULT_BIAS]. + Individual shapes can have a specific bias value (see [member Shape3D.custom_solver_bias]). + </member> + <member name="physics/3d/solver/solver_iterations" type="int" setter="" getter="" default="16"> + Number of solver iterations for all contacts and constraints. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. See [constant PhysicsServer3D.SPACE_PARAM_SOLVER_ITERATIONS]. </member> <member name="physics/3d/time_before_sleep" type="float" setter="" getter="" default="0.5"> + Time (in seconds) of inactivity before which a 3D physics body will put to sleep. See [constant PhysicsServer3D.SPACE_PARAM_BODY_TIME_TO_SLEEP]. </member> <member name="physics/common/enable_object_picking" type="bool" setter="" getter="" default="true"> Enables [member Viewport.physics_object_picking] on the root viewport. diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 9746519173..4c12ee36f6 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -65,7 +65,8 @@ </methods> <members> <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> - The shape's custom solver bias. + The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/2d/solver/default_contact_bias] is used. </member> </members> </class> diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml index 67af52768f..010b993327 100644 --- a/doc/classes/Shape3D.xml +++ b/doc/classes/Shape3D.xml @@ -18,6 +18,10 @@ </method> </methods> <members> + <member name="custom_solver_bias" type="float" setter="set_custom_solver_bias" getter="get_custom_solver_bias" default="0.0"> + The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. + When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used. + </member> <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04"> The collision margin for the shape. Used in Bullet Physics only. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. |