Struct gdnative_bindings_lily::Area [−][src]
pub struct Area { /* fields omitted */ }
Expand description
core class Area
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.
Memory management
Non reference counted objects such as the ones of this type are usually owned by the engine.
Area
is a reference-only type. Persistent references can
only exist in the unsafe Ref<Area>
form.
In the cases where Rust code owns an object of this type, for example if the object was just
created on the Rust side and not passed to the engine yet, ownership should be either given
to the engine or the object must be manually destroyed using Ref::free
, or Ref::queue_free
if it is a Node
.
Class hierarchy
Area 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
Constants
Creates a new instance of this object.
Because this type is not reference counted, the lifetime of the returned object is not automatically managed.
Immediately after creation, the object is owned by the caller, and can be
passed to the engine (in which case the engine will be responsible for
destroying the object) or destroyed manually using Ref::free
, or preferably
Ref::queue_free
if it is a Node
.
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from 0
(no damping) to 1
(full damping).
The name of the area’s audio bus.
The area’s physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. 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 layer mask.
The physics layers this area scans to determine collision detection. 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 collision mask.
The area’s gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
The area’s gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from 0
(no damping) to 1
(full damping).
Returns a list of intersecting Areas. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
Returns a list of intersecting PhysicsBodys. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
The degree to which this area applies reverb to its associated audio. Ranges from 0
to 1
with 0.1
precision.
The reverb bus name to use for this area’s associated audio.
The degree to which this area’s reverb is a uniform effect. Ranges from 0
to 1
with 0.1
precision.
Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
If true
, gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override].
If true
, other monitoring areas can detect this area.
If true
, the area detects bodies or areas entering and exiting it.
If true
, the area’s audio bus overrides the default audio bus.
If true
, the area applies reverb to its associated audio.
If true
, the given area overlaps the Area.
Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
If true
, the given physics body overlaps the Area.
Note: The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
The body
argument can either be a PhysicsBody or a GridMap instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from 0
(no damping) to 1
(full damping).
The name of the area’s audio bus.
If true
, the area’s audio bus overrides the default audio bus.
The area’s physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [member collision_mask]. 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.
Set/clear individual bits on the layer mask. This simplifies editing this Area’s layers.
The physics layers this area scans to determine collision detection. 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.
The area’s gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
If true
, gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override].
The area’s gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from 0
(no damping) to 1
(full damping).
If true
, other monitoring areas can detect this area.
If true
, the area detects bodies or areas entering and exiting it.
The area’s priority. Higher priority areas are processed first.
The degree to which this area applies reverb to its associated audio. Ranges from 0
to 1
with 0.1
precision.
The reverb bus name to use for this area’s associated audio.
The degree to which this area’s reverb is a uniform effect. Ranges from 0
to 1
with 0.1
precision.
Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
If true
, the area applies reverb to its associated audio.
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 Area
impl UnwindSafe for Area