mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-12-03 13:35:56 +00:00
Remove println calls and convert transforms more efficiently.
This commit is contained in:
parent
2ca07730ab
commit
a8b6102f31
|
@ -236,12 +236,10 @@ fn source_update(
|
|||
source.set_gain(gain).unwrap();
|
||||
source.set_looping(looping);
|
||||
source.set_pitch(pitch).unwrap();
|
||||
//println!("Global: {:?}, transform: {:?}", global_transform, transform);
|
||||
let translation = global_transform
|
||||
.map(|v| v.translation)
|
||||
.or_else(|| transform.map(|v| v.translation));
|
||||
if let Some(translation) = translation {
|
||||
//println!("Translation: {:?}", translation);
|
||||
source.set_relative(false);
|
||||
source
|
||||
.set_position([translation.x, translation.y, translation.z])
|
||||
|
@ -295,8 +293,8 @@ fn listener_update(
|
|||
for (_, transform, global_transform) in query.iter() {
|
||||
let transform: Option<Transform> = global_transform
|
||||
.map(|v| {
|
||||
let matrix = v.compute_matrix();
|
||||
Transform::from_matrix(matrix)
|
||||
let transform: Transform = (*v).into();
|
||||
transform
|
||||
})
|
||||
.or_else(|| transform.cloned());
|
||||
if let Some(transform) = transform {
|
||||
|
|
Loading…
Reference in New Issue
Block a user