chore: Don't set position if values are NaN.

This commit is contained in:
Nolan Darilek 2025-01-06 19:38:57 -05:00
parent 0c8f557886
commit 7738cdb27c

View File

@ -441,14 +441,16 @@ fn update_source_properties(
if let Some(source) = handle.cast_to::<syz::Source3D>().expect("Failed to cast") { if let Some(source) = handle.cast_to::<syz::Source3D>().expect("Failed to cast") {
if let Some(transform) = transform { if let Some(transform) = transform {
let translation = transform.translation(); let translation = transform.translation();
source if !translation.x.is_nan() && !translation.y.is_nan() && !translation.z.is_nan() {
.position() source
.set(( .position()
translation.x as f64, .set((
translation.y as f64, translation.x as f64,
translation.z as f64, translation.y as f64,
)) translation.z as f64,
.expect("Failed to set position"); ))
.expect("Failed to set position");
}
let distance_model = distance_model let distance_model = distance_model
.cloned() .cloned()
.map(|v| *v) .map(|v| *v)