[−][src]Struct gdnative_bindings::PhysicsBody
core class PhysicsBody
inherits CollisionObject
(unsafe).
Official documentation
See the documentation of this class in the Godot engine's official documentation.
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
impl PhysicsBody
[src]
pub fn add_collision_exception_with(&self, body: impl AsArg<Node>)
[src]
Adds a body to the list of bodies that this body can't collide with.
pub fn get_collision_exceptions(&self) -> VariantArray
[src]
Returns an array of nodes that were added as collision exceptions for this body.
pub fn collision_layer(&self) -> i64
[src]
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.
pub fn get_collision_layer_bit(&self, bit: i64) -> bool
[src]
Returns an individual bit on the [member collision_layer].
pub fn collision_mask(&self) -> i64
[src]
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.
pub fn get_collision_mask_bit(&self, bit: i64) -> bool
[src]
Returns an individual bit on the [member collision_mask].
pub fn remove_collision_exception_with(&self, body: impl AsArg<Node>)
[src]
Removes a body from the list of bodies that this body can't collide with.
pub fn set_collision_layer(&self, layer: i64)
[src]
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.
pub fn set_collision_layer_bit(&self, bit: i64, value: bool)
[src]
Sets individual bits on the [member collision_layer] bitmask. Use this if you only need to change one layer's value.
pub fn set_collision_mask(&self, mask: i64)
[src]
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.
pub fn set_collision_mask_bit(&self, bit: i64, value: bool)
[src]
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>
pub fn create_shape_owner(&self, owner: impl AsArg<Object>) -> i64
[src]
Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.
pub fn capture_input_on_drag(&self) -> bool
[src]
If [code]true[/code], the [CollisionObject] will continue to receive input events as the mouse is dragged across its shapes.
pub fn get_rid(&self) -> Rid
[src]
Returns the object's [RID].
pub fn get_shape_owners(&self) -> VariantArray
[src]
Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
pub fn is_ray_pickable(&self) -> bool
[src]
If [code]true[/code], the [CollisionObject]'s shapes will respond to [RayCast]s.
pub fn is_shape_owner_disabled(&self, owner_id: i64) -> bool
[src]
If [code]true[/code], the shape owner and its shapes are disabled.
pub fn remove_shape_owner(&self, owner_id: i64)
[src]
Removes the given shape owner.
pub fn set_capture_input_on_drag(&self, enable: bool)
[src]
If [code]true[/code], the [CollisionObject] will continue to receive input events as the mouse is dragged across its shapes.
pub fn set_ray_pickable(&self, ray_pickable: bool)
[src]
If [code]true[/code], the [CollisionObject]'s shapes will respond to [RayCast]s.
pub fn shape_find_owner(&self, shape_index: i64) -> i64
[src]
Returns the [code]owner_id[/code] of the given shape.
pub fn shape_owner_add_shape(&self, owner_id: i64, shape: impl AsArg<Shape>)
[src]
Adds a [Shape] to the shape owner.
pub fn shape_owner_clear_shapes(&self, owner_id: i64)
[src]
Removes all shapes from the shape owner.
pub fn shape_owner_get_owner(
&self,
owner_id: i64
) -> Option<Ref<Object, Shared>>
[src]
&self,
owner_id: i64
) -> Option<Ref<Object, Shared>>
Returns the parent object of the given shape owner.
pub fn shape_owner_get_shape(
&self,
owner_id: i64,
shape_id: i64
) -> Option<Ref<Shape, Shared>>
[src]
&self,
owner_id: i64,
shape_id: i64
) -> Option<Ref<Shape, Shared>>
Returns the [Shape] with the given id from the given shape owner.
pub fn shape_owner_get_shape_count(&self, owner_id: i64) -> i64
[src]
Returns the number of shapes the given shape owner contains.
pub fn shape_owner_get_shape_index(&self, owner_id: i64, shape_id: i64) -> i64
[src]
Returns the child index of the [Shape] with the given id from the given shape owner.
pub fn shape_owner_get_transform(&self, owner_id: i64) -> Transform
[src]
Returns the shape owner's [Transform].
pub fn shape_owner_remove_shape(&self, owner_id: i64, shape_id: i64)
[src]
Removes a shape from the given shape owner.
pub fn shape_owner_set_disabled(&self, owner_id: i64, disabled: bool)
[src]
If [code]true[/code], disables the given shape owner.
pub fn shape_owner_set_transform(&self, owner_id: i64, transform: Transform)
[src]
Sets the [Transform] of the given shape owner.
Trait Implementations
impl Debug for PhysicsBody
[src]
impl Deref for PhysicsBody
[src]
type Target = CollisionObject
The resulting type after dereferencing.
fn deref(&self) -> &CollisionObject
[src]
impl DerefMut for PhysicsBody
[src]
fn deref_mut(&mut self) -> &mut CollisionObject
[src]
impl GodotObject for PhysicsBody
[src]
type RefKind = ManuallyManaged
The memory management kind of this type. This modifies the behavior of the
Ref
smart pointer. See its type-level documentation for more
information. Read more
fn class_name() -> &'static str
[src]
fn null() -> Null<Self>
[src]
fn new() -> Ref<Self, Unique> where
Self: Instanciable,
[src]
Self: Instanciable,
fn cast<T>(&self) -> Option<&T> where
T: GodotObject + SubClass<Self>,
[src]
T: GodotObject + SubClass<Self>,
fn upcast<T>(&self) -> &T where
Self: SubClass<T>,
T: GodotObject,
[src]
Self: SubClass<T>,
T: GodotObject,
unsafe fn assume_shared(&self) -> Ref<Self, Shared>
[src]
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
[src]
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_unique(&self) -> Ref<Self, Unique>
[src]
impl QueueFree for PhysicsBody
[src]
unsafe fn godot_queue_free(obj: *mut godot_object)
[src]
impl Sealed for PhysicsBody
[src]
impl SubClass<CollisionObject> for PhysicsBody
[src]
impl SubClass<Node> for PhysicsBody
[src]
impl SubClass<Object> for PhysicsBody
[src]
impl SubClass<PhysicsBody> for RigidBody
[src]
impl SubClass<PhysicsBody> for StaticBody
[src]
impl SubClass<PhysicsBody> for KinematicBody
[src]
impl SubClass<PhysicsBody> for PhysicalBone
[src]
impl SubClass<PhysicsBody> for VehicleBody
[src]
impl SubClass<Spatial> for PhysicsBody
[src]
Auto Trait Implementations
impl RefUnwindSafe for PhysicsBody
impl !Send for PhysicsBody
impl !Sync for PhysicsBody
impl Unpin for PhysicsBody
impl UnwindSafe for PhysicsBody
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SubClass<T> for T where
T: GodotObject,
[src]
T: GodotObject,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,