classref: Sync with current master branch (46a568e0a)

This commit is contained in:
Rémi Verschelde
2022-08-31 15:18:54 +02:00
parent b08b95d4f5
commit 465dd176b6
378 changed files with 17124 additions and 13692 deletions

View File

@@ -109,6 +109,8 @@ Methods
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`body_get_collision_mask<class_PhysicsServer2D_method_body_get_collision_mask>` **(** :ref:`RID<class_RID>` body **)** |const| |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`body_get_collision_priority<class_PhysicsServer2D_method_body_get_collision_priority>` **(** :ref:`RID<class_RID>` body **)** |const| |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`body_get_constant_force<class_PhysicsServer2D_method_body_get_constant_force>` **(** :ref:`RID<class_RID>` body **)** |const| |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`body_get_constant_torque<class_PhysicsServer2D_method_body_get_constant_torque>` **(** :ref:`RID<class_RID>` body **)** |const| |
@@ -149,6 +151,8 @@ Methods
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`body_set_collision_mask<class_PhysicsServer2D_method_body_set_collision_mask>` **(** :ref:`RID<class_RID>` body, :ref:`int<class_int>` mask **)** |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`body_set_collision_priority<class_PhysicsServer2D_method_body_set_collision_priority>` **(** :ref:`RID<class_RID>` body, :ref:`float<class_float>` priority **)** |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`body_set_constant_force<class_PhysicsServer2D_method_body_set_constant_force>` **(** :ref:`RID<class_RID>` body, :ref:`Vector2<class_Vector2>` force **)** |
+-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`body_set_constant_torque<class_PhysicsServer2D_method_body_set_constant_torque>` **(** :ref:`RID<class_RID>` body, :ref:`float<class_float>` torque **)** |
@@ -281,7 +285,7 @@ enum **SpaceParameter**:
- **SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS** = **7** --- 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.
- **SPACE_PARAM_SOLVER_ITERATIONS** = **8** --- Constant to set/get the 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.
- **SPACE_PARAM_SOLVER_ITERATIONS** = **8** --- Constant to set/get the number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance.
----
@@ -409,9 +413,9 @@ enum **AreaSpaceOverrideMode**:
.. _class_PhysicsServer2D_constant_BODY_MODE_KINEMATIC:
.. _class_PhysicsServer2D_constant_BODY_MODE_DYNAMIC:
.. _class_PhysicsServer2D_constant_BODY_MODE_RIGID:
.. _class_PhysicsServer2D_constant_BODY_MODE_DYNAMIC_LINEAR:
.. _class_PhysicsServer2D_constant_BODY_MODE_RIGID_LINEAR:
enum **BodyMode**:
@@ -419,9 +423,9 @@ enum **BodyMode**:
- **BODY_MODE_KINEMATIC** = **1** --- Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path.
- **BODY_MODE_DYNAMIC** = **2** --- Constant for dynamic bodies. In this mode, a body can be pushed by other bodies and has forces applied.
- **BODY_MODE_RIGID** = **2** --- Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied.
- **BODY_MODE_DYNAMIC_LINEAR** = **3** --- Constant for linear dynamic bodies. In this mode, a body is dynamic but can not rotate, and only its linear velocity is affected by external forces.
- **BODY_MODE_RIGID_LINEAR** = **3** --- Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces.
----
@@ -850,7 +854,7 @@ This is equivalent to using :ref:`body_add_constant_force<class_PhysicsServer2D_
Adds a constant positioned force to the body that keeps being applied over time until cleared with ``body_set_constant_force(body, Vector2(0, 0))``.
\ ``position`` is the offset from the body origin in global coordinates.
``position`` is the offset from the body origin in global coordinates.
----
@@ -898,7 +902,7 @@ This is equivalent to using :ref:`body_apply_impulse<class_PhysicsServer2D_metho
Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
\ ``position`` is the offset from the body origin in global coordinates.
``position`` is the offset from the body origin in global coordinates.
----
@@ -910,7 +914,7 @@ Applies a positioned impulse to the body.
An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
\ ``position`` is the offset from the body origin in global coordinates.
``position`` is the offset from the body origin in global coordinates.
----
@@ -984,6 +988,14 @@ Returns the physics layer or layers a body can collide with.
----
.. _class_PhysicsServer2D_method_body_get_collision_priority:
- :ref:`float<class_float>` **body_get_collision_priority** **(** :ref:`RID<class_RID>` body **)** |const|
Returns the body's collision priority.
----
.. _class_PhysicsServer2D_method_body_get_constant_force:
- :ref:`Vector2<class_Vector2>` **body_get_constant_force** **(** :ref:`RID<class_RID>` body **)** |const|
@@ -1148,6 +1160,14 @@ Sets the physics layer or layers a body can collide with.
----
.. _class_PhysicsServer2D_method_body_set_collision_priority:
- void **body_set_collision_priority** **(** :ref:`RID<class_RID>` body, :ref:`float<class_float>` priority **)**
Sets the body's collision priority.
----
.. _class_PhysicsServer2D_method_body_set_constant_force:
- void **body_set_constant_force** **(** :ref:`RID<class_RID>` body, :ref:`Vector2<class_Vector2>` force **)**
@@ -1196,7 +1216,7 @@ The force integration function takes 2 arguments:
- void **body_set_max_contacts_reported** **(** :ref:`RID<class_RID>` body, :ref:`int<class_int>` amount **)**
Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0.
----
@@ -1244,7 +1264,7 @@ Enables one way collision on body if ``enable`` is ``true``.
- void **body_set_shape_disabled** **(** :ref:`RID<class_RID>` body, :ref:`int<class_int>` shape_idx, :ref:`bool<class_bool>` disabled **)**
Disables shape in body if ``disable`` is ``true``.
Disables shape in body if ``disabled`` is ``true``.
----