From c75d14586999dc1ef1ff6099adbc1f0abdb46edf Mon Sep 17 00:00:00 2001 From: Antony Date: Fri, 8 Mar 2024 06:20:12 +0000 Subject: [PATCH] Fix gizmos panicking given bad output from `GlobalTransform::to_scale_rotation_translation` (#12375) # Objective Fixes #12360. ## Solution Normalize the rotation `Quat` in `sphere`. --- crates/bevy_gizmos/src/gizmos.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_gizmos/src/gizmos.rs b/crates/bevy_gizmos/src/gizmos.rs index eaef65d54e95f..1bd91741a5ed7 100644 --- a/crates/bevy_gizmos/src/gizmos.rs +++ b/crates/bevy_gizmos/src/gizmos.rs @@ -337,7 +337,7 @@ impl<'w, 's, T: GizmoConfigGroup> Gizmos<'w, 's, T> { SphereBuilder { gizmos: self, position, - rotation, + rotation: rotation.normalize(), radius, color: color.into(), circle_segments: DEFAULT_CIRCLE_SEGMENTS,