Struct rg3d_sound::source::spatial::SpatialSource[][src]

pub struct SpatialSource { /* fields omitted */ }
Expand description

See module docs.

Implementations

Sets position of source in world space.

Returns positions of source.

Sets radius of imaginable sphere around source in which no distance attenuation is applied.

Returns radius of source.

Sets rolloff factor. Rolloff factor is used in distance attenuation and has different meaning in various distance models. It is applicable only for InverseDistance and ExponentDistance distance models. See DistanceModel docs for formulae.

Returns rolloff factor.

Sets maximum distance until which distance gain will be applicable. Basically it doing this min(max(distance, radius), max_distance) which clamps distance in radius..max_distance range. From listener’s perspective this will sound like source has stopped decreasing its volume even if distance continue to grow.

Returns max distance.

Returns shared reference to inner generic source.

Returns mutable reference to inner generic source.

Methods from Deref<Target = GenericSource>

Sets new name of the sound source.

Returns the name of the sound source.

Returns the name of the sound source.

Changes buffer of source. Returns old buffer. Source will continue playing from beginning, old position will be discarded.

Returns current buffer if any.

Marks buffer for single play. It will be automatically destroyed when it will finish playing.

Notes

Make sure you not using handles to “play once” sounds, attempt to get reference of “play once” sound may result in panic if source already deleted. Looping sources will never be automatically deleted because their playback never stops.

Returns true if this source is marked for single play, false - otherwise.

Sets new gain (volume) of sound. Value should be in 0..1 range, but it is not clamped and larger values can be used to “overdrive” sound.

Notes

Physical volume has non-linear scale (logarithmic) so perception of sound at 0.25 gain will be different if logarithmic scale was used.

Returns current gain (volume) of sound. Value is in 0..1 range.

Sets panning coefficient. Value must be in -1..+1 range. Where -1 - only left channel will be audible, 0 - both, +1 - only right.

Returns current panning coefficient in -1..+1 range. For more info see set_panning. Default value is 0.

Returns status of sound source.

Changes status to Playing.

Changes status to Paused

Enabled or disables sound looping. Looping sound will never stop by itself, but can be stopped or paused by calling stop or pause methods. Useful for music, ambient sounds, etc.

Returns looping status.

Sets sound pitch. Defines “tone” of sounds. Default value is 1.0

Returns pitch of sound source.

Stops sound source. Automatically rewinds streaming buffers.

Returns playback duration.

Sets playback duration.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.