pub struct VoiceManager {
pub voices: HashMap<u64, AudioVoice>,
pub next_voice_id: u64,
pub max_voices: usize,
pub category_limits: HashMap<SoundCategory, usize>,
pub category_counts: HashMap<SoundCategory, usize>,
pub virtual_voices: HashSet<u64>,
pub total_active: usize,
pub total_virtual: usize,
}Fields§
§voices: HashMap<u64, AudioVoice>§next_voice_id: u64§max_voices: usize§category_limits: HashMap<SoundCategory, usize>§category_counts: HashMap<SoundCategory, usize>§virtual_voices: HashSet<u64>§total_active: usize§total_virtual: usizeImplementations§
Source§impl VoiceManager
impl VoiceManager
pub fn new(max_voices: usize) -> Self
pub fn spawn_voice( &mut self, sound_id: u64, category: SoundCategory, pos: Vec3, ) -> Option<u64>
pub fn retire_voice(&mut self, voice_id: u64)
pub fn update_priorities(&mut self, listener_pos: Vec3)
pub fn cull_excess_voices(&mut self, listener_pos: Vec3)
pub fn virtualize_distant_voices( &mut self, listener_pos: Vec3, virtual_threshold_m: f32, )
pub fn voices_by_category(&self, category: SoundCategory) -> Vec<&AudioVoice>
pub fn steal_voice(&mut self, category: SoundCategory) -> Option<u64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VoiceManager
impl RefUnwindSafe for VoiceManager
impl Send for VoiceManager
impl Sync for VoiceManager
impl Unpin for VoiceManager
impl UnsafeUnpin for VoiceManager
impl UnwindSafe for VoiceManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.