.. 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//doc_classes. .. _class_PhysicsDirectBodyState: PhysicsDirectBodyState ====================== **Inherits:** :ref:`Object` **Inherited By:** :ref:`BulletPhysicsDirectBodyState` **Category:** Core Brief Description ----------------- Properties ---------- +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`angular_velocity` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`center_of_mass` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`inverse_inertia` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`inverse_mass` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`linear_velocity` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`principal_inertia_axes` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`sleeping` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`step` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`total_angular_damp` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`total_gravity` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`total_linear_damp` | +-----------------------------------+---------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`transform` | +-----------------------------------+---------------------------------------------------------------------------------------------+ Methods ------- +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_central_force` **(** :ref:`Vector3` force **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_force` **(** :ref:`Vector3` force, :ref:`Vector3` position **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_torque` **(** :ref:`Vector3` torque **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`apply_central_impulse` **(** :ref:`Vector3` j **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`apply_impulse` **(** :ref:`Vector3` position, :ref:`Vector3` j **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`apply_torque_impulse` **(** :ref:`Vector3` j **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`get_contact_collider` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_contact_collider_id` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_contact_collider_object` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_contact_collider_position` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_contact_collider_shape` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_contact_collider_velocity_at_position` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_contact_count` **(** **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_contact_impulse` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_contact_local_normal` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_contact_local_position` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_contact_local_shape` **(** :ref:`int` contact_idx **)** const | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PhysicsDirectSpaceState` | :ref:`get_space_state` **(** **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`integrate_forces` **(** **)** | +---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_PhysicsDirectBodyState_property_angular_velocity: - :ref:`Vector3` **angular_velocity** +----------+-----------------------------+ | *Setter* | set_angular_velocity(value) | +----------+-----------------------------+ | *Getter* | get_angular_velocity() | +----------+-----------------------------+ The angular velocity of the body. .. _class_PhysicsDirectBodyState_property_center_of_mass: - :ref:`Vector3` **center_of_mass** +----------+----------------------+ | *Getter* | get_center_of_mass() | +----------+----------------------+ .. _class_PhysicsDirectBodyState_property_inverse_inertia: - :ref:`Vector3` **inverse_inertia** +----------+-----------------------+ | *Getter* | get_inverse_inertia() | +----------+-----------------------+ The inverse of the inertia of the body. .. _class_PhysicsDirectBodyState_property_inverse_mass: - :ref:`float` **inverse_mass** +----------+--------------------+ | *Getter* | get_inverse_mass() | +----------+--------------------+ The inverse of the mass of the body. .. _class_PhysicsDirectBodyState_property_linear_velocity: - :ref:`Vector3` **linear_velocity** +----------+----------------------------+ | *Setter* | set_linear_velocity(value) | +----------+----------------------------+ | *Getter* | get_linear_velocity() | +----------+----------------------------+ The linear velocity of the body. .. _class_PhysicsDirectBodyState_property_principal_inertia_axes: - :ref:`Basis` **principal_inertia_axes** +----------+------------------------------+ | *Getter* | get_principal_inertia_axes() | +----------+------------------------------+ .. _class_PhysicsDirectBodyState_property_sleeping: - :ref:`bool` **sleeping** +----------+------------------------+ | *Setter* | set_sleep_state(value) | +----------+------------------------+ | *Getter* | is_sleeping() | +----------+------------------------+ ``true`` if this body is currently sleeping (not active). .. _class_PhysicsDirectBodyState_property_step: - :ref:`float` **step** +----------+------------+ | *Getter* | get_step() | +----------+------------+ The timestep (delta) used for the simulation. .. _class_PhysicsDirectBodyState_property_total_angular_damp: - :ref:`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_property_total_gravity: - :ref:`Vector3` **total_gravity** +----------+---------------------+ | *Getter* | get_total_gravity() | +----------+---------------------+ The total gravity vector being currently applied to this body. .. _class_PhysicsDirectBodyState_property_total_linear_damp: - :ref:`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_property_transform: - :ref:`Transform` **transform** +----------+----------------------+ | *Setter* | set_transform(value) | +----------+----------------------+ | *Getter* | get_transform() | +----------+----------------------+ The transformation matrix of the body. Method Descriptions ------------------- .. _class_PhysicsDirectBodyState_method_add_central_force: - void **add_central_force** **(** :ref:`Vector3` force **)** Adds a constant directional force without affecting rotation. This is equivalent to ``add_force(force, Vector3(0,0,0))``. .. _class_PhysicsDirectBodyState_method_add_force: - void **add_force** **(** :ref:`Vector3` force, :ref:`Vector3` position **)** Adds a constant force (i.e. acceleration). .. _class_PhysicsDirectBodyState_method_add_torque: - void **add_torque** **(** :ref:`Vector3` torque **)** Adds a constant rotational force (i.e. a motor) without affecting position. .. _class_PhysicsDirectBodyState_method_apply_central_impulse: - void **apply_central_impulse** **(** :ref:`Vector3` j **)** Applies a single directional impulse without affecting rotation. This is equivalent to ``apply_impulse(Vector3(0, 0, 0), impulse)``. .. _class_PhysicsDirectBodyState_method_apply_impulse: - void **apply_impulse** **(** :ref:`Vector3` position, :ref:`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_method_apply_torque_impulse: - void **apply_torque_impulse** **(** :ref:`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_method_get_contact_collider: - :ref:`RID` **get_contact_collider** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_collider_id: - :ref:`int` **get_contact_collider_id** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_collider_object: - :ref:`Object` **get_contact_collider_object** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_collider_position: - :ref:`Vector3` **get_contact_collider_position** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_collider_shape: - :ref:`int` **get_contact_collider_shape** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_collider_velocity_at_position: - :ref:`Vector3` **get_contact_collider_velocity_at_position** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_count: - :ref:`int` **get_contact_count** **(** **)** const .. _class_PhysicsDirectBodyState_method_get_contact_impulse: - :ref:`float` **get_contact_impulse** **(** :ref:`int` contact_idx **)** const Impulse created by the contact. Only implemented for Bullet physics. .. _class_PhysicsDirectBodyState_method_get_contact_local_normal: - :ref:`Vector3` **get_contact_local_normal** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_local_position: - :ref:`Vector3` **get_contact_local_position** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_contact_local_shape: - :ref:`int` **get_contact_local_shape** **(** :ref:`int` contact_idx **)** const .. _class_PhysicsDirectBodyState_method_get_space_state: - :ref:`PhysicsDirectSpaceState` **get_space_state** **(** **)** .. _class_PhysicsDirectBodyState_method_integrate_forces: - void **integrate_forces** **(** **)**