pub struct DynamicSource {
pub base_source: SoundSource,
pub velocity: Position3D,
pub acceleration: Position3D,
pub motion_history: VecDeque<MotionSnapshot>,
pub doppler_factor: f32,
pub smoothed_doppler_factor: f32,
pub last_doppler_update: Option<Instant>,
}Expand description
Dynamic source with motion tracking and prediction
Fields§
§base_source: SoundSourceBase source
velocity: Position3DVelocity tracking
acceleration: Position3DAcceleration tracking
motion_history: VecDeque<MotionSnapshot>Motion history for prediction
doppler_factor: f32Current Doppler factor
smoothed_doppler_factor: f32Smoothed Doppler factor
last_doppler_update: Option<Instant>Last Doppler update time
Implementations§
Source§impl DynamicSource
impl DynamicSource
Sourcepub fn new(base_source: SoundSource) -> Self
pub fn new(base_source: SoundSource) -> Self
Create new dynamic source
Sourcepub fn update_motion(
&mut self,
position: Position3D,
velocity: Position3D,
acceleration: Position3D,
)
pub fn update_motion( &mut self, position: Position3D, velocity: Position3D, acceleration: Position3D, )
Update motion parameters
Sourcepub fn predict_position(&self, time_delta: Duration) -> Position3D
pub fn predict_position(&self, time_delta: Duration) -> Position3D
Get predicted position after given time
Trait Implementations§
Source§impl Clone for DynamicSource
impl Clone for DynamicSource
Source§fn clone(&self) -> DynamicSource
fn clone(&self) -> DynamicSource
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 DynamicSource
impl RefUnwindSafe for DynamicSource
impl Send for DynamicSource
impl Sync for DynamicSource
impl Unpin for DynamicSource
impl UnsafeUnpin for DynamicSource
impl UnwindSafe for DynamicSource
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