pub struct DynamicSourceManager { /* private fields */ }Expand description
Dynamic source manager for handling moving sources
Implementations§
Source§impl DynamicSourceManager
impl DynamicSourceManager
Sourcepub fn add_source(&mut self, source: SoundSource) -> Result<()>
pub fn add_source(&mut self, source: SoundSource) -> Result<()>
Add dynamic source
Sourcepub fn remove_source(&mut self, source_id: &str) -> Option<DynamicSource>
pub fn remove_source(&mut self, source_id: &str) -> Option<DynamicSource>
Remove dynamic source
Sourcepub fn update_source_motion(
&mut self,
source_id: &str,
position: Position3D,
velocity: Position3D,
acceleration: Position3D,
) -> Result<()>
pub fn update_source_motion( &mut self, source_id: &str, position: Position3D, velocity: Position3D, acceleration: Position3D, ) -> Result<()>
Update source motion
Sourcepub async fn process_dynamic_sources(
&mut self,
listener_position: Position3D,
listener_velocity: Position3D,
) -> Result<()>
pub async fn process_dynamic_sources( &mut self, listener_position: Position3D, listener_velocity: Position3D, ) -> Result<()>
Process all dynamic sources with Doppler effects
Sourcepub fn sources(&self) -> &HashMap<String, DynamicSource>
pub fn sources(&self) -> &HashMap<String, DynamicSource>
Get all dynamic sources
Sourcepub fn get_source(&self, source_id: &str) -> Option<&DynamicSource>
pub fn get_source(&self, source_id: &str) -> Option<&DynamicSource>
Get dynamic source by ID
Sourcepub fn get_source_mut(&mut self, source_id: &str) -> Option<&mut DynamicSource>
pub fn get_source_mut(&mut self, source_id: &str) -> Option<&mut DynamicSource>
Get mutable dynamic source by ID
Sourcepub fn predict_source_positions(
&self,
prediction_time: Duration,
) -> HashMap<String, Position3D>
pub fn predict_source_positions( &self, prediction_time: Duration, ) -> HashMap<String, Position3D>
Predict source positions for latency compensation
Trait Implementations§
Source§impl Clone for DynamicSourceManager
impl Clone for DynamicSourceManager
Source§fn clone(&self) -> DynamicSourceManager
fn clone(&self) -> DynamicSourceManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicSourceManager
impl RefUnwindSafe for DynamicSourceManager
impl Send for DynamicSourceManager
impl Sync for DynamicSourceManager
impl Unpin for DynamicSourceManager
impl UnsafeUnpin for DynamicSourceManager
impl UnwindSafe for DynamicSourceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more