From a8b6102f310205922d84c9b7095786e072e12620 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 8 Jan 2021 18:58:42 -0600 Subject: [PATCH] Remove println calls and convert transforms more efficiently. --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0f2a06c..ad37739 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 = 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 {