-
Notifications
You must be signed in to change notification settings - Fork 0
class_physics2ddirectbodystate
####Inherits: Object ####Category: Core
Direct access object to a physics body in the Physics2DServer.
- Vector2 get_total_gravity ( ) const
- float get_total_linear_damp ( ) const
- float get_total_angular_damp ( ) const
- float get_inverse_mass ( ) const
- float get_inverse_inertia ( ) const
- void set_linear_velocity ( Vector2 velocity )
- Vector2 get_linear_velocity ( ) const
- void set_angular_velocity ( float velocity )
- float get_angular_velocity ( ) const
- void set_transform ( Matrix32 transform )
- Matrix32 get_transform ( ) const
- void set_sleep_state ( bool enabled )
- bool is_sleeping ( ) const
- int get_contact_count ( ) const
- Vector2 get_contact_local_pos ( int contact_idx ) const
- Vector2 get_contact_local_normal ( int contact_idx ) const
- int get_contact_local_shape ( int contact_idx ) const
- RID get_contact_collider ( int contact_idx ) const
- Vector2 get_contact_collider_pos ( int contact_idx ) const
- int get_contact_collider_id ( int contact_idx ) const
- Object get_contact_collider_object ( int contact_idx ) const
- int get_contact_collider_shape ( int contact_idx ) const
- void get_contact_collider_shape_metadata ( int contact_idx ) const
- Vector2 get_contact_collider_velocity_at_pos ( int contact_idx ) const
- float get_step ( ) const
- void integrate_forces ( )
- Physics2DDirectSpaceState get_space_state ( )
Direct access object to a physics body in the Physics2DServer. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body.
- Vector2 get_total_gravity ( ) const
Return the total gravity vector being currently applied to this body.
- float get_inverse_mass ( ) const
Return the inverse of the mass of the body.
- float get_inverse_inertia ( ) const
Return the inverse of the inertia of the body.
- void set_linear_velocity ( Vector2 velocity )
Change the linear velocity of the body.
- Vector2 get_linear_velocity ( ) const
Return the current linear velocity of the body.
- void set_angular_velocity ( float velocity )
Change the angular velocity of the body.
- float get_angular_velocity ( ) const
Return the angular velocity of the body.
- void set_transform ( Matrix32 transform )
Change the transform matrix of the body.
- Matrix32 get_transform ( ) const
Return the transform matrix of the body.
- void set_sleep_state ( bool enabled )
Set the sleeping state of the body, only affects character/rigid bodies.
- bool is_sleeping ( ) const
Return true if this body is currently sleeping (not active).
- int get_contact_count ( ) const
Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts.
Return the local position (of this body) of the contact point.
Return the local shape index of the collision.
Return the RID of the collider.
Return the contact position in the collider.
Return the object id of the collider.
Return the collider object, this depends on how it was created (will return a scene node if such was used to create it).
Return the collider shape index.
Return the linear velocity vector at contact point of the collider.
- float get_step ( ) const
Return the timestep (delta) used for the simulation.
- void integrate_forces ( )
Call the built-in force integration code.
- Physics2DDirectSpaceState get_space_state ( )
Return the current state of space, useful for queries.