[−][src]Struct gdnative_bindings::AudioStreamPlayer3D
core class AudioStreamPlayer3D inherits Spatial (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.
AudioStreamPlayer3D is a reference-only type. Persistent references can
only exist in the unsafe Ref<AudioStreamPlayer3D> 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
AudioStreamPlayer3D 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 AudioStreamPlayer3D[src]
Constants
pub const ATTENUATION_DISABLED: i64[src]
pub const ATTENUATION_INVERSE_DISTANCE: i64[src]
pub const ATTENUATION_INVERSE_SQUARE_DISTANCE: i64[src]
pub const ATTENUATION_LOGARITHMIC: i64[src]
pub const DOPPLER_TRACKING_DISABLED: i64[src]
pub const DOPPLER_TRACKING_IDLE_STEP: i64[src]
pub const DOPPLER_TRACKING_PHYSICS_STEP: i64[src]
pub const OUT_OF_RANGE_MIX: i64[src]
pub const OUT_OF_RANGE_PAUSE: i64[src]
impl AudioStreamPlayer3D[src]
pub fn new() -> Ref<Self, 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 area_mask(&self) -> i64[src]
Areas in which this sound plays.
pub fn attenuation_filter_cutoff_hz(&self) -> f64[src]
Dampens audio above this frequency, in Hz.
pub fn attenuation_filter_db(&self) -> f64[src]
Amount how much the filter affects the loudness, in dB.
pub fn attenuation_model(&self) -> AttenuationModel[src]
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
pub fn bus(&self) -> GodotString[src]
Bus on which this audio is playing.
pub fn doppler_tracking(&self) -> DopplerTracking[src]
Decides in which step the Doppler effect should be calculated.
pub fn emission_angle(&self) -> f64[src]
The angle in which the audio reaches cameras undampened.
pub fn emission_angle_filter_attenuation_db(&self) -> f64[src]
Dampens audio if camera is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set by this factor, in dB.
pub fn max_db(&self) -> f64[src]
Sets the absolute maximum of the soundlevel, in dB.
pub fn max_distance(&self) -> f64[src]
Sets the distance from which the [member out_of_range_mode] takes effect. Has no effect if set to 0.
pub fn out_of_range_mode(&self) -> OutOfRangeMode[src]
Decides if audio should pause when source is outside of [member max_distance] range.
pub fn pitch_scale(&self) -> f64[src]
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
pub fn get_playback_position(&self) -> f64[src]
Returns the position in the [AudioStream].
pub fn stream(&self) -> Option<Ref<AudioStream, Shared>>[src]
The [AudioStream] object to be played.
pub fn stream_paused(&self) -> bool[src]
If [code]true[/code], the playback is paused. You can resume it by setting [code]stream_paused[/code] to [code]false[/code].
pub fn get_stream_playback(&self) -> Option<Ref<AudioStreamPlayback, Shared>>[src]
Returns the [AudioStreamPlayback] object associated with this [AudioStreamPlayer3D].
pub fn unit_db(&self) -> f64[src]
Base sound level unaffected by dampening, in dB.
pub fn unit_size(&self) -> f64[src]
Factor for the attenuation effect.
pub fn is_autoplay_enabled(&self) -> bool[src]
If [code]true[/code], audio plays when added to scene tree.
pub fn is_emission_angle_enabled(&self) -> bool[src]
If [code]true[/code], the audio should be dampened according to the direction of the sound.
pub fn is_playing(&self) -> bool[src]
If [code]true[/code], audio is playing.
pub fn play(&self, from_position: f64)[src]
Plays the audio from the given position [code]from_position[/code], in seconds.
Default Arguments
from_position-0.0
pub fn seek(&self, to_position: f64)[src]
Sets the position from which audio will be played, in seconds.
pub fn set_area_mask(&self, mask: i64)[src]
Areas in which this sound plays.
pub fn set_attenuation_filter_cutoff_hz(&self, degrees: f64)[src]
Dampens audio above this frequency, in Hz.
pub fn set_attenuation_filter_db(&self, db: f64)[src]
Amount how much the filter affects the loudness, in dB.
pub fn set_attenuation_model(&self, model: i64)[src]
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
pub fn set_autoplay(&self, enable: bool)[src]
If [code]true[/code], audio plays when added to scene tree.
pub fn set_bus(&self, bus: impl Into<GodotString>)[src]
Bus on which this audio is playing.
pub fn set_doppler_tracking(&self, mode: i64)[src]
Decides in which step the Doppler effect should be calculated.
pub fn set_emission_angle(&self, degrees: f64)[src]
The angle in which the audio reaches cameras undampened.
pub fn set_emission_angle_enabled(&self, enabled: bool)[src]
If [code]true[/code], the audio should be dampened according to the direction of the sound.
pub fn set_emission_angle_filter_attenuation_db(&self, db: f64)[src]
Dampens audio if camera is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set by this factor, in dB.
pub fn set_max_db(&self, max_db: f64)[src]
Sets the absolute maximum of the soundlevel, in dB.
pub fn set_max_distance(&self, metres: f64)[src]
Sets the distance from which the [member out_of_range_mode] takes effect. Has no effect if set to 0.
pub fn set_out_of_range_mode(&self, mode: i64)[src]
Decides if audio should pause when source is outside of [member max_distance] range.
pub fn set_pitch_scale(&self, pitch_scale: f64)[src]
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
pub fn set_stream(&self, stream: impl AsArg<AudioStream>)[src]
The [AudioStream] object to be played.
pub fn set_stream_paused(&self, pause: bool)[src]
If [code]true[/code], the playback is paused. You can resume it by setting [code]stream_paused[/code] to [code]false[/code].
pub fn set_unit_db(&self, unit_db: f64)[src]
Base sound level unaffected by dampening, in dB.
pub fn set_unit_size(&self, unit_size: f64)[src]
Factor for the attenuation effect.
pub fn stop(&self)[src]
Stops the audio.
Methods from Deref<Target = Spatial>
pub const NOTIFICATION_ENTER_WORLD: i64[src]
pub const NOTIFICATION_EXIT_WORLD: i64[src]
pub const NOTIFICATION_TRANSFORM_CHANGED: i64[src]
pub const NOTIFICATION_VISIBILITY_CHANGED: i64[src]
pub fn force_update_transform(&self)[src]
Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations.
pub fn gizmo(&self) -> Option<Ref<SpatialGizmo, Shared>>[src]
The [SpatialGizmo] for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor.
pub fn global_transform(&self) -> Transform[src]
World space (global) [Transform] of this node.
pub fn get_parent_spatial(&self) -> Option<Ref<Spatial, Shared>>[src]
Returns the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial].
pub fn rotation(&self) -> Vector3[src]
Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).
[b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful.
pub fn rotation_degrees(&self) -> Vector3[src]
Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).
pub fn scale(&self) -> Vector3[src]
Scale part of the local transformation.
pub fn transform(&self) -> Transform[src]
Local space [Transform] of this node, with respect to the parent node.
pub fn translation(&self) -> Vector3[src]
Local translation of this node.
pub fn get_world(&self) -> Option<Ref<World, Shared>>[src]
Returns the current [World] resource this [Spatial] node is registered to.
pub fn global_rotate(&self, axis: Vector3, angle: f64)[src]
Rotates the global (world) transformation around axis, a unit [Vector3], by specified angle in radians. The rotation axis is in global coordinate system.
pub fn global_scale(&self, scale: Vector3)[src]
Scales the global (world) transformation by the given [Vector3] scale factors.
pub fn global_translate(&self, offset: Vector3)[src]
Moves the global (world) transformation by [Vector3] offset. The offset is in global coordinate system.
pub fn hide(&self)[src]
Disables rendering of this node. Changes [member visible] to [code]false[/code].
pub fn is_local_transform_notification_enabled(&self) -> bool[src]
Returns whether node notifies about its local transformation changes. [Spatial] will not propagate this by default.
pub fn is_scale_disabled(&self) -> bool[src]
Returns whether this node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale.
pub fn is_set_as_toplevel(&self) -> bool[src]
Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations.
pub fn is_transform_notification_enabled(&self) -> bool[src]
Returns whether the node notifies about its global and local transformation changes. [Spatial] will not propagate this by default.
pub fn is_visible(&self) -> bool[src]
If [code]true[/code], this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
pub fn is_visible_in_tree(&self) -> bool[src]
Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree.
pub fn look_at(&self, target: Vector3, up: Vector3)[src]
Rotates itself so that the local -Z axis points towards the [code]target[/code] position.
The transform will first be rotated around the given [code]up[/code] vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the [code]target[/code] and [code]up[/code] vectors.
Operations take place in global space.
pub fn look_at_from_position(
&self,
position: Vector3,
target: Vector3,
up: Vector3
)[src]
&self,
position: Vector3,
target: Vector3,
up: Vector3
)
Moves the node to the specified [code]position[/code], and then rotates itself to point toward the [code]target[/code] as per [method look_at]. Operations take place in global space.
pub fn orthonormalize(&self)[src]
Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform].
pub fn rotate(&self, axis: Vector3, angle: f64)[src]
Rotates the local transformation around axis, a unit [Vector3], by specified angle in radians.
pub fn rotate_object_local(&self, axis: Vector3, angle: f64)[src]
Rotates the local transformation around axis, a unit [Vector3], by specified angle in radians. The rotation axis is in object-local coordinate system.
pub fn rotate_x(&self, angle: f64)[src]
Rotates the local transformation around the X axis by angle in radians.
pub fn rotate_y(&self, angle: f64)[src]
Rotates the local transformation around the Y axis by angle in radians.
pub fn rotate_z(&self, angle: f64)[src]
Rotates the local transformation around the Z axis by angle in radians.
pub fn scale_object_local(&self, scale: Vector3)[src]
Scales the local transformation by given 3D scale factors in object-local coordinate system.
pub fn set_as_toplevel(&self, enable: bool)[src]
Makes the node ignore its parents transformations. Node transformations are only in global space.
pub fn set_disable_scale(&self, disable: bool)[src]
Sets whether the node uses a scale of [code](1, 1, 1)[/code] or its local transformation scale. Changes to the local transformation scale are preserved.
pub fn set_gizmo(&self, gizmo: impl AsArg<SpatialGizmo>)[src]
The [SpatialGizmo] for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor.
pub fn set_global_transform(&self, global: Transform)[src]
World space (global) [Transform] of this node.
pub fn set_identity(&self)[src]
Reset all transformations for this node (sets its [Transform] to the identity matrix).
pub fn set_ignore_transform_notification(&self, enabled: bool)[src]
Sets whether the node ignores notification that its transformation (global or local) changed.
pub fn set_notify_local_transform(&self, enable: bool)[src]
Sets whether the node notifies about its local transformation changes. [Spatial] will not propagate this by default.
pub fn set_notify_transform(&self, enable: bool)[src]
Sets whether the node notifies about its global and local transformation changes. [Spatial] will not propagate this by default.
pub fn set_rotation(&self, euler: Vector3)[src]
Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).
[b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful.
pub fn set_rotation_degrees(&self, euler_degrees: Vector3)[src]
Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle).
pub fn set_scale(&self, scale: Vector3)[src]
Scale part of the local transformation.
pub fn set_transform(&self, local: Transform)[src]
Local space [Transform] of this node, with respect to the parent node.
pub fn set_translation(&self, translation: Vector3)[src]
Local translation of this node.
pub fn set_visible(&self, visible: bool)[src]
If [code]true[/code], this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]).
pub fn show(&self)[src]
Enables rendering of this node. Changes [member visible] to [code]true[/code].
pub fn to_global(&self, local_point: Vector3) -> Vector3[src]
Transforms [code]local_point[/code] from this node's local space to world space.
pub fn to_local(&self, global_point: Vector3) -> Vector3[src]
Transforms [code]global_point[/code] from world space to this node's local space.
pub fn translate(&self, offset: Vector3)[src]
Changes the node's position by the given offset [Vector3].
Note that the translation [code]offset[/code] is affected by the node's scale, so if scaled by e.g. [code](10, 1, 1)[/code], a translation by an offset of [code](2, 0, 0)[/code] would actually add 20 ([code]2 * 10[/code]) to the X coordinate.
pub fn translate_object_local(&self, offset: Vector3)[src]
Changes the node's position by the given offset [Vector3] in local space.
pub fn update_gizmo(&self)[src]
Updates the [SpatialGizmo] of this node.
Trait Implementations
impl Debug for AudioStreamPlayer3D[src]
impl Deref for AudioStreamPlayer3D[src]
impl DerefMut for AudioStreamPlayer3D[src]
impl GodotObject for AudioStreamPlayer3D[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 AudioStreamPlayer3D[src]
impl QueueFree for AudioStreamPlayer3D[src]
unsafe fn godot_queue_free(obj: *mut godot_object)[src]
impl Sealed for AudioStreamPlayer3D[src]
impl SubClass<Node> for AudioStreamPlayer3D[src]
impl SubClass<Object> for AudioStreamPlayer3D[src]
impl SubClass<Spatial> for AudioStreamPlayer3D[src]
Auto Trait Implementations
impl RefUnwindSafe for AudioStreamPlayer3D
impl !Send for AudioStreamPlayer3D
impl !Sync for AudioStreamPlayer3D
impl Unpin for AudioStreamPlayer3D
impl UnwindSafe for AudioStreamPlayer3D
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>,