mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-11-24 10:15:56 +00:00
Add support for source radii.
This commit is contained in:
parent
0a65d16d44
commit
537f99a598
|
@ -159,6 +159,7 @@ pub struct Sound {
|
||||||
pub reference_distance: f32,
|
pub reference_distance: f32,
|
||||||
pub max_distance: f32,
|
pub max_distance: f32,
|
||||||
pub rolloff_factor: f32,
|
pub rolloff_factor: f32,
|
||||||
|
pub radius: f32,
|
||||||
pub bypass_global_effects: bool,
|
pub bypass_global_effects: bool,
|
||||||
#[reflect(ignore)]
|
#[reflect(ignore)]
|
||||||
pub source: Option<Arc<Mutex<StaticSource>>>,
|
pub source: Option<Arc<Mutex<StaticSource>>>,
|
||||||
|
@ -175,6 +176,7 @@ impl Default for Sound {
|
||||||
reference_distance: 1.,
|
reference_distance: 1.,
|
||||||
max_distance: f32::MAX,
|
max_distance: f32::MAX,
|
||||||
rolloff_factor: 1.,
|
rolloff_factor: 1.,
|
||||||
|
radius: 1.,
|
||||||
bypass_global_effects: false,
|
bypass_global_effects: false,
|
||||||
source: None,
|
source: None,
|
||||||
}
|
}
|
||||||
|
@ -209,6 +211,7 @@ fn sync_source_and_components(
|
||||||
reference_distance: f32,
|
reference_distance: f32,
|
||||||
max_distance: f32,
|
max_distance: f32,
|
||||||
rolloff_factor: f32,
|
rolloff_factor: f32,
|
||||||
|
radius: f32,
|
||||||
bypass_global_effects: bool,
|
bypass_global_effects: bool,
|
||||||
global_effects: &mut Vec<AuxEffectSlot>,
|
global_effects: &mut Vec<AuxEffectSlot>,
|
||||||
) {
|
) {
|
||||||
|
@ -230,6 +233,7 @@ fn sync_source_and_components(
|
||||||
source.set_reference_distance(reference_distance).unwrap();
|
source.set_reference_distance(reference_distance).unwrap();
|
||||||
source.set_max_distance(max_distance).unwrap();
|
source.set_max_distance(max_distance).unwrap();
|
||||||
source.set_rolloff_factor(rolloff_factor).unwrap();
|
source.set_rolloff_factor(rolloff_factor).unwrap();
|
||||||
|
source.set_radius(radius).unwrap();
|
||||||
if !bypass_global_effects {
|
if !bypass_global_effects {
|
||||||
for (send, effect) in global_effects.iter_mut().enumerate() {
|
for (send, effect) in global_effects.iter_mut().enumerate() {
|
||||||
source.set_aux_send(send as i32, effect).unwrap();
|
source.set_aux_send(send as i32, effect).unwrap();
|
||||||
|
@ -251,6 +255,7 @@ fn source_update(
|
||||||
reference_distance,
|
reference_distance,
|
||||||
max_distance,
|
max_distance,
|
||||||
rolloff_factor,
|
rolloff_factor,
|
||||||
|
radius,
|
||||||
bypass_global_effects,
|
bypass_global_effects,
|
||||||
state,
|
state,
|
||||||
..
|
..
|
||||||
|
@ -280,6 +285,7 @@ fn source_update(
|
||||||
reference_distance,
|
reference_distance,
|
||||||
max_distance,
|
max_distance,
|
||||||
rolloff_factor,
|
rolloff_factor,
|
||||||
|
radius,
|
||||||
bypass_global_effects,
|
bypass_global_effects,
|
||||||
&mut **global_effects,
|
&mut **global_effects,
|
||||||
);
|
);
|
||||||
|
@ -302,6 +308,7 @@ fn source_update(
|
||||||
reference_distance,
|
reference_distance,
|
||||||
max_distance,
|
max_distance,
|
||||||
rolloff_factor,
|
rolloff_factor,
|
||||||
|
radius,
|
||||||
bypass_global_effects,
|
bypass_global_effects,
|
||||||
&mut **global_effects,
|
&mut **global_effects,
|
||||||
);
|
);
|
||||||
|
@ -327,6 +334,7 @@ fn source_update(
|
||||||
reference_distance,
|
reference_distance,
|
||||||
max_distance,
|
max_distance,
|
||||||
rolloff_factor,
|
rolloff_factor,
|
||||||
|
radius,
|
||||||
bypass_global_effects,
|
bypass_global_effects,
|
||||||
&mut **global_effects,
|
&mut **global_effects,
|
||||||
);
|
);
|
||||||
|
@ -346,6 +354,7 @@ fn source_update(
|
||||||
reference_distance,
|
reference_distance,
|
||||||
max_distance,
|
max_distance,
|
||||||
rolloff_factor,
|
rolloff_factor,
|
||||||
|
radius,
|
||||||
bypass_global_effects,
|
bypass_global_effects,
|
||||||
&mut **global_effects,
|
&mut **global_effects,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user