mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-12-04 05:55:56 +00:00
Add additional constraints for listener.
This commit is contained in:
parent
8c69401202
commit
78d36aa4d2
|
@ -266,9 +266,9 @@ impl DerefMut for GlobalEffects {
|
||||||
|
|
||||||
fn update_listener(
|
fn update_listener(
|
||||||
context: ResMut<Context>,
|
context: ResMut<Context>,
|
||||||
query: Query<(&Listener, Option<&Transform>, Option<&GlobalTransform>)>,
|
listener: Query<(Option<&Transform>, Option<&GlobalTransform>), With<Listener>>,
|
||||||
) {
|
) {
|
||||||
for (_, transform, global_transform) in query.iter() {
|
if let Ok((transform, global_transform)) = listener.get_single() {
|
||||||
let transform: Option<Transform> = global_transform
|
let transform: Option<Transform> = global_transform
|
||||||
.map(|v| {
|
.map(|v| {
|
||||||
let transform: Transform = (*v).into();
|
let transform: Transform = (*v).into();
|
||||||
|
@ -293,6 +293,9 @@ fn update_listener(
|
||||||
context.set_position([0., 0., 0.]).ok();
|
context.set_position([0., 0., 0.]).ok();
|
||||||
context.set_orientation(([0., 0., 1.], [0., 1., 0.])).ok();
|
context.set_orientation(([0., 0., 1.], [0., 1., 0.])).ok();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
context.set_position([0., 0., 0.]).ok();
|
||||||
|
context.set_orientation(([0., 0., 1.], [0., 1., 0.])).ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user