[−][src]Struct gdnative::api::Area
core class Area
inherits CollisionObject
(unsafe).
Official documentation
See the documentation of this class in the Godot engine's official documentation.
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
impl Area
[src]
Constants
pub const SPACE_OVERRIDE_COMBINE: i64
[src]
pub const SPACE_OVERRIDE_COMBINE_REPLACE: i64
[src]
pub const SPACE_OVERRIDE_DISABLED: i64
[src]
pub const SPACE_OVERRIDE_REPLACE: i64
[src]
pub const SPACE_OVERRIDE_REPLACE_COMBINE: i64
[src]
impl Area
[src]
pub fn new() -> Ref<Area, Unique>
[src]
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
.
pub fn angular_damp(&self) -> f64
[src]
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
pub fn audio_bus(&self) -> GodotString
[src]
The name of the area's audio bus.
pub fn collision_layer(&self) -> i64
[src]
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.
pub fn get_collision_layer_bit(&self, bit: i64) -> bool
[src]
Returns an individual bit on the layer mask.
pub fn collision_mask(&self) -> i64
[src]
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.
pub fn get_collision_mask_bit(&self, bit: i64) -> bool
[src]
Returns an individual bit on the collision mask.
pub fn gravity(&self) -> f64
[src]
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.
pub fn gravity_distance_scale(&self) -> f64
[src]
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
pub fn gravity_vector(&self) -> Vector3D<f32, UnknownUnit>
[src]
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
pub fn linear_damp(&self) -> f64
[src]
The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
pub fn get_overlapping_areas(&self) -> VariantArray<Shared>
[src]
Returns a list of intersecting [Area]s. 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.
pub fn get_overlapping_bodies(&self) -> VariantArray<Shared>
[src]
Returns a list of intersecting [PhysicsBody]s. 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.
pub fn priority(&self) -> f64
[src]
The area's priority. Higher priority areas are processed first.
pub fn reverb_amount(&self) -> f64
[src]
The degree to which this area applies reverb to its associated audio. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision.
pub fn reverb_bus(&self) -> GodotString
[src]
The reverb bus name to use for this area's associated audio.
pub fn reverb_uniformity(&self) -> f64
[src]
The degree to which this area's reverb is a uniform effect. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision.
pub fn space_override_mode(&self) -> SpaceOverride
[src]
Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
pub fn is_gravity_a_point(&self) -> bool
[src]
If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override].
pub fn is_monitorable(&self) -> bool
[src]
If [code]true[/code], other monitoring areas can detect this area.
pub fn is_monitoring(&self) -> bool
[src]
If [code]true[/code], the area detects bodies or areas entering and exiting it.
pub fn is_overriding_audio_bus(&self) -> bool
[src]
If [code]true[/code], the area's audio bus overrides the default audio bus.
pub fn is_using_reverb_bus(&self) -> bool
[src]
If [code]true[/code], the area applies reverb to its associated audio.
pub fn overlaps_area(&self, area: impl AsArg<Node>) -> bool
[src]
If [code]true[/code], the given area overlaps the Area.
[b]Note:[/b] 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.
pub fn overlaps_body(&self, body: impl AsArg<Node>) -> bool
[src]
If [code]true[/code], the given physics body overlaps the Area.
[b]Note:[/b] 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 [code]body[/code] 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).
pub fn set_angular_damp(&self, angular_damp: f64)
[src]
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
pub fn set_audio_bus(&self, name: impl Into<GodotString>)
[src]
The name of the area's audio bus.
pub fn set_audio_bus_override(&self, enable: bool)
[src]
If [code]true[/code], the area's audio bus overrides the default audio bus.
pub fn set_collision_layer(&self, collision_layer: i64)
[src]
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.
pub fn set_collision_layer_bit(&self, bit: i64, value: bool)
[src]
Set/clear individual bits on the layer mask. This simplifies editing this [Area]'s layers.
pub fn set_collision_mask(&self, collision_mask: i64)
[src]
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.
pub fn set_collision_mask_bit(&self, bit: i64, value: bool)
[src]
Set/clear individual bits on the collision mask. This simplifies editing which [Area] layers this [Area] scans.
pub fn set_gravity(&self, gravity: f64)
[src]
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.
pub fn set_gravity_distance_scale(&self, distance_scale: f64)
[src]
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
pub fn set_gravity_is_point(&self, enable: bool)
[src]
If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override].
pub fn set_gravity_vector(&self, vector: Vector3D<f32, UnknownUnit>)
[src]
The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction.
pub fn set_linear_damp(&self, linear_damp: f64)
[src]
The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
pub fn set_monitorable(&self, enable: bool)
[src]
If [code]true[/code], other monitoring areas can detect this area.
pub fn set_monitoring(&self, enable: bool)
[src]
If [code]true[/code], the area detects bodies or areas entering and exiting it.
pub fn set_priority(&self, priority: f64)
[src]
The area's priority. Higher priority areas are processed first.
pub fn set_reverb_amount(&self, amount: f64)
[src]
The degree to which this area applies reverb to its associated audio. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision.
pub fn set_reverb_bus(&self, name: impl Into<GodotString>)
[src]
The reverb bus name to use for this area's associated audio.
pub fn set_reverb_uniformity(&self, amount: f64)
[src]
The degree to which this area's reverb is a uniform effect. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision.
pub fn set_space_override_mode(&self, enable: i64)
[src]
Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values.
pub fn set_use_reverb_bus(&self, enable: bool)
[src]
If [code]true[/code], the area applies reverb to its associated audio.
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<Shared>
[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 Area
[src]
impl Deref for Area
[src]
type Target = CollisionObject
The resulting type after dereferencing.
fn deref(&self) -> &CollisionObject
[src]
impl DerefMut for Area
[src]
fn deref_mut(&mut self) -> &mut CollisionObject
[src]
impl GodotObject for Area
[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 Instanciable for Area
[src]
impl QueueFree for Area
[src]
unsafe fn godot_queue_free(obj: *mut c_void)
[src]
impl SubClass<CollisionObject> for Area
[src]
impl SubClass<Node> for Area
[src]
impl SubClass<Object> for Area
[src]
impl SubClass<Spatial> for Area
[src]
Auto Trait Implementations
impl RefUnwindSafe for Area
impl !Send for Area
impl !Sync for Area
impl Unpin for Area
impl UnwindSafe for Area
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>,