Struct gdnative_bindings_lily::PhysicsBody [−][src]
pub struct PhysicsBody { /* fields omitted */ }
Expand description
core class PhysicsBody
inherits CollisionObject
(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
PhysicsBody 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
.
Implementations
Adds a body to the list of bodies that this body can’t collide with.
Returns an array of nodes that were added as collision exceptions for this body.
The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
Returns an individual bit on the [member collision_layer].
The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
Returns an individual bit on the [member collision_mask].
Removes a body from the list of bodies that this body can’t collide with.
The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the [member collision_mask] property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
Sets individual bits on the [member collision_layer] bitmask. Use this if you only need to change one layer’s value.
The physics layers this area scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
Sets individual bits on the [member collision_mask] bitmask. Use this if you only need to change one layer’s value.
Methods from Deref<Target = CollisionObject>
Creates a new shape owner for the given object. Returns owner_id
of the new owner for future reference.
If true
, the CollisionObject will continue to receive input events as the mouse is dragged across its shapes.
Returns an [Array] of owner_id
identifiers. You can use these ids in other methods that take owner_id
as an argument.
If true
, the CollisionObject’s shapes will respond to RayCasts.
If true
, the shape owner and its shapes are disabled.
Removes the given shape owner.
If true
, the CollisionObject will continue to receive input events as the mouse is dragged across its shapes.
If true
, the CollisionObject’s shapes will respond to RayCasts.
Returns the owner_id
of the given shape.
Adds a Shape to the shape owner.
Removes all shapes from the shape owner.
Returns the parent object of the given shape owner.
Returns the Shape with the given id from the given shape owner.
Returns the number of shapes the given shape owner contains.
Returns the child index of the Shape with the given id from the given shape owner.
Returns the shape owner’s Transform.
Removes a shape from the given shape owner.
If true
, disables the given shape owner.
Sets the Transform of the given shape owner.
Trait Implementations
type Target = CollisionObject
type Target = CollisionObject
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 PhysicsBody
impl !Send for PhysicsBody
impl !Sync for PhysicsBody
impl Unpin for PhysicsBody
impl UnwindSafe for PhysicsBody