Struct gdnative_bindings_lily::Physics2DDirectBodyStateSW [−][src]
pub struct Physics2DDirectBodyStateSW { /* fields omitted */ }
Expand description
core class Physics2DDirectBodyStateSW
inherits Physics2DDirectBodyState
(unsafe).
Official documentation
See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.
Class hierarchy
Physics2DDirectBodyStateSW inherits methods from:
Safety
All types in the Godot API have “interior mutability” in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Methods from Deref<Target = Physics2DDirectBodyState>
Adds a constant directional force without affecting rotation.
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
Adds a constant rotational force.
Applies a directional impulse without affecting rotation.
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). The offset uses the rotation of the global coordinate system, but is centered at the object’s origin.
Applies a rotational impulse to the body.
The body’s rotational velocity.
Returns the collider’s [RID].
Returns the collider’s object id.
Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it).
Returns the contact position in the collider.
Returns the collider’s shape index.
Returns the collided shape’s metadata. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
Returns the linear velocity vector at the collider’s contact point.
Returns the number of contacts this body has with other bodies. Note: By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody2D.contact_monitor].
Returns the local normal at the contact point.
Returns the local position of the contact point.
Returns the local shape index of the collision.
The inverse of the inertia of the body.
The inverse of the mass of the body.
The body’s linear velocity.
Returns the current state of the space, useful for queries.
The rate at which the body stops rotating, if there are not any other forces moving it.
The total gravity vector being currently applied to this body.
The rate at which the body stops moving, if there are not any other forces moving it.
The body’s transformation matrix.
Calls the built-in force integration code.
If true
, this body is currently sleeping (not active).
The body’s rotational velocity.
The body’s linear velocity.
If true
, this body is currently sleeping (not active).
The body’s transformation matrix.
Trait Implementations
type Target = Physics2DDirectBodyState
type Target = Physics2DDirectBodyState
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
type RefKind = ManuallyManaged
type RefKind = ManuallyManaged
Creates an explicitly null reference of Self
as a method argument. This makes type
inference easier for the compiler compared to Option
. Read more
Creates a new instance of Self
using a zero-argument constructor, as a Unique
reference. Read more
Performs a dynamic reference downcast to target type. Read more
Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more
Creates a persistent reference to the same Godot object with shared thread access. Read more
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
Creates a persistent reference to the same Godot object with thread-local thread access. Read more
Creates a persistent reference to the same Godot object with unique access. Read more
Recovers a instance ID previously returned by Object::get_instance_id
if the object is
still alive. See also TRef::try_from_instance_id
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Physics2DDirectBodyStateSW
impl !Send for Physics2DDirectBodyStateSW
impl !Sync for Physics2DDirectBodyStateSW
impl Unpin for Physics2DDirectBodyStateSW
impl UnwindSafe for Physics2DDirectBodyStateSW