mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
317 lines
20 KiB
ReStructuredText
317 lines
20 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the PhysicsDirectBodyState.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_PhysicsDirectBodyState:
|
|
|
|
PhysicsDirectBodyState
|
|
======================
|
|
|
|
**Inherits:** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`BulletPhysicsDirectBodyState<class_BulletPhysicsDirectBodyState>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_PhysicsDirectBodyState_angular_velocity>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`center_of_mass<class_PhysicsDirectBodyState_center_of_mass>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`inverse_inertia<class_PhysicsDirectBodyState_inverse_inertia>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`inverse_mass<class_PhysicsDirectBodyState_inverse_mass>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_PhysicsDirectBodyState_linear_velocity>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Basis<class_Basis>` | :ref:`principal_inertia_axes<class_PhysicsDirectBodyState_principal_inertia_axes>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`sleeping<class_PhysicsDirectBodyState_sleeping>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`step<class_PhysicsDirectBodyState_step>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`total_angular_damp<class_PhysicsDirectBodyState_total_angular_damp>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`total_gravity<class_PhysicsDirectBodyState_total_gravity>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`total_linear_damp<class_PhysicsDirectBodyState_total_linear_damp>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
| :ref:`Transform<class_Transform>` | :ref:`transform<class_PhysicsDirectBodyState_transform>` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_central_force<class_PhysicsDirectBodyState_add_central_force>` **(** :ref:`Vector3<class_Vector3>` force **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_force<class_PhysicsDirectBodyState_add_force>` **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_torque<class_PhysicsDirectBodyState_add_torque>` **(** :ref:`Vector3<class_Vector3>` torque **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`apply_central_impulse<class_PhysicsDirectBodyState_apply_central_impulse>` **(** :ref:`Vector3<class_Vector3>` j **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`apply_impulse<class_PhysicsDirectBodyState_apply_impulse>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` j **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`apply_torque_impulse<class_PhysicsDirectBodyState_apply_torque_impulse>` **(** :ref:`Vector3<class_Vector3>` j **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_contact_collider<class_PhysicsDirectBodyState_get_contact_collider>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_contact_collider_id<class_PhysicsDirectBodyState_get_contact_collider_id>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Object<class_Object>` | :ref:`get_contact_collider_object<class_PhysicsDirectBodyState_get_contact_collider_object>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_position<class_PhysicsDirectBodyState_get_contact_collider_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_contact_collider_shape<class_PhysicsDirectBodyState_get_contact_collider_shape>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_velocity_at_position<class_PhysicsDirectBodyState_get_contact_collider_velocity_at_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_contact_count<class_PhysicsDirectBodyState_get_contact_count>` **(** **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_contact_impulse<class_PhysicsDirectBodyState_get_contact_impulse>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_normal<class_PhysicsDirectBodyState_get_contact_local_normal>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_position<class_PhysicsDirectBodyState_get_contact_local_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_contact_local_shape<class_PhysicsDirectBodyState_get_contact_local_shape>` **(** :ref:`int<class_int>` contact_idx **)** const |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PhysicsDirectSpaceState<class_PhysicsDirectSpaceState>` | :ref:`get_space_state<class_PhysicsDirectBodyState_get_space_state>` **(** **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`integrate_forces<class_PhysicsDirectBodyState_integrate_forces>` **(** **)** |
|
|
+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_PhysicsDirectBodyState_angular_velocity:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **angular_velocity**
|
|
|
|
+----------+-----------------------------+
|
|
| *Setter* | set_angular_velocity(value) |
|
|
+----------+-----------------------------+
|
|
| *Getter* | get_angular_velocity() |
|
|
+----------+-----------------------------+
|
|
|
|
The angular velocity of the body.
|
|
|
|
.. _class_PhysicsDirectBodyState_center_of_mass:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **center_of_mass**
|
|
|
|
+----------+----------------------+
|
|
| *Getter* | get_center_of_mass() |
|
|
+----------+----------------------+
|
|
|
|
.. _class_PhysicsDirectBodyState_inverse_inertia:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **inverse_inertia**
|
|
|
|
+----------+-----------------------+
|
|
| *Getter* | get_inverse_inertia() |
|
|
+----------+-----------------------+
|
|
|
|
The inverse of the inertia of the body.
|
|
|
|
.. _class_PhysicsDirectBodyState_inverse_mass:
|
|
|
|
- :ref:`float<class_float>` **inverse_mass**
|
|
|
|
+----------+--------------------+
|
|
| *Getter* | get_inverse_mass() |
|
|
+----------+--------------------+
|
|
|
|
The inverse of the mass of the body.
|
|
|
|
.. _class_PhysicsDirectBodyState_linear_velocity:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **linear_velocity**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_linear_velocity(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | get_linear_velocity() |
|
|
+----------+----------------------------+
|
|
|
|
The linear velocity of the body.
|
|
|
|
.. _class_PhysicsDirectBodyState_principal_inertia_axes:
|
|
|
|
- :ref:`Basis<class_Basis>` **principal_inertia_axes**
|
|
|
|
+----------+------------------------------+
|
|
| *Getter* | get_principal_inertia_axes() |
|
|
+----------+------------------------------+
|
|
|
|
.. _class_PhysicsDirectBodyState_sleeping:
|
|
|
|
- :ref:`bool<class_bool>` **sleeping**
|
|
|
|
+----------+------------------------+
|
|
| *Setter* | set_sleep_state(value) |
|
|
+----------+------------------------+
|
|
| *Getter* | is_sleeping() |
|
|
+----------+------------------------+
|
|
|
|
``true`` if this body is currently sleeping (not active).
|
|
|
|
.. _class_PhysicsDirectBodyState_step:
|
|
|
|
- :ref:`float<class_float>` **step**
|
|
|
|
+----------+------------+
|
|
| *Getter* | get_step() |
|
|
+----------+------------+
|
|
|
|
The timestep (delta) used for the simulation.
|
|
|
|
.. _class_PhysicsDirectBodyState_total_angular_damp:
|
|
|
|
- :ref:`float<class_float>` **total_angular_damp**
|
|
|
|
+----------+--------------------------+
|
|
| *Getter* | get_total_angular_damp() |
|
|
+----------+--------------------------+
|
|
|
|
The rate at which the body stops rotating, if there are not any other forces moving it.
|
|
|
|
.. _class_PhysicsDirectBodyState_total_gravity:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **total_gravity**
|
|
|
|
+----------+---------------------+
|
|
| *Getter* | get_total_gravity() |
|
|
+----------+---------------------+
|
|
|
|
The total gravity vector being currently applied to this body.
|
|
|
|
.. _class_PhysicsDirectBodyState_total_linear_damp:
|
|
|
|
- :ref:`float<class_float>` **total_linear_damp**
|
|
|
|
+----------+-------------------------+
|
|
| *Getter* | get_total_linear_damp() |
|
|
+----------+-------------------------+
|
|
|
|
The rate at which the body stops moving, if there are not any other forces moving it.
|
|
|
|
.. _class_PhysicsDirectBodyState_transform:
|
|
|
|
- :ref:`Transform<class_Transform>` **transform**
|
|
|
|
+----------+----------------------+
|
|
| *Setter* | set_transform(value) |
|
|
+----------+----------------------+
|
|
| *Getter* | get_transform() |
|
|
+----------+----------------------+
|
|
|
|
The transformation matrix of the body.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_PhysicsDirectBodyState_add_central_force:
|
|
|
|
- void **add_central_force** **(** :ref:`Vector3<class_Vector3>` force **)**
|
|
|
|
Adds a constant directional force without affecting rotation.
|
|
|
|
This is equivalent to ``add_force(force, Vector3(0,0,0))``.
|
|
|
|
.. _class_PhysicsDirectBodyState_add_force:
|
|
|
|
- void **add_force** **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position **)**
|
|
|
|
Adds a constant force (i.e. acceleration).
|
|
|
|
.. _class_PhysicsDirectBodyState_add_torque:
|
|
|
|
- void **add_torque** **(** :ref:`Vector3<class_Vector3>` torque **)**
|
|
|
|
Adds a constant rotational force (i.e. a motor) without affecting position.
|
|
|
|
.. _class_PhysicsDirectBodyState_apply_central_impulse:
|
|
|
|
- void **apply_central_impulse** **(** :ref:`Vector3<class_Vector3>` j **)**
|
|
|
|
Applies a single directional impulse without affecting rotation.
|
|
|
|
This is equivalent to ``apply_impulse(Vector3(0, 0, 0), impulse)``.
|
|
|
|
.. _class_PhysicsDirectBodyState_apply_impulse:
|
|
|
|
- void **apply_impulse** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` j **)**
|
|
|
|
Apply a positioned impulse (which will be affected by the body mass and shape). This is the equivalent of hitting a billiard ball with a cue: a force that is applied once, and only once. Both the impulse and the position are in global coordinates, and the position is relative to the object's origin.
|
|
|
|
.. _class_PhysicsDirectBodyState_apply_torque_impulse:
|
|
|
|
- void **apply_torque_impulse** **(** :ref:`Vector3<class_Vector3>` j **)**
|
|
|
|
Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the passed in vector.
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider:
|
|
|
|
- :ref:`RID<class_RID>` **get_contact_collider** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider_id:
|
|
|
|
- :ref:`int<class_int>` **get_contact_collider_id** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider_object:
|
|
|
|
- :ref:`Object<class_Object>` **get_contact_collider_object** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider_position:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **get_contact_collider_position** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider_shape:
|
|
|
|
- :ref:`int<class_int>` **get_contact_collider_shape** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_collider_velocity_at_position:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **get_contact_collider_velocity_at_position** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_count:
|
|
|
|
- :ref:`int<class_int>` **get_contact_count** **(** **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_impulse:
|
|
|
|
- :ref:`float<class_float>` **get_contact_impulse** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
Impulse created by the contact. Only implemented for Bullet physics.
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_local_normal:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **get_contact_local_normal** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_local_position:
|
|
|
|
- :ref:`Vector3<class_Vector3>` **get_contact_local_position** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_contact_local_shape:
|
|
|
|
- :ref:`int<class_int>` **get_contact_local_shape** **(** :ref:`int<class_int>` contact_idx **)** const
|
|
|
|
.. _class_PhysicsDirectBodyState_get_space_state:
|
|
|
|
- :ref:`PhysicsDirectSpaceState<class_PhysicsDirectSpaceState>` **get_space_state** **(** **)**
|
|
|
|
.. _class_PhysicsDirectBodyState_integrate_forces:
|
|
|
|
- void **integrate_forces** **(** **)**
|
|
|