From 443ce9a62b6bb0136c192a6fe46e4c254a895e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Sat, 11 May 2024 21:32:31 +0200 Subject: [PATCH] gizmos: take normal of normal on plane 3d before rotation (#13326) # Objective - Example `render_primitives` is painful to look at for the plane in 3d, the gizmo seems to have extra rotations https://github.com/bevyengine/bevy/assets/8672791/08509624-14ac-4f00-a758-9a14233ef1a9 ## Solution - Take the normal of the normal before rotation, then rotate it ## Testing - Run the example, rotations are more in sync https://github.com/bevyengine/bevy/assets/8672791/91c26ce4-4b7b-4575-ba32-7c32026e4596 --- crates/bevy_gizmos/src/primitives/dim3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_gizmos/src/primitives/dim3.rs b/crates/bevy_gizmos/src/primitives/dim3.rs index 66924fbb3f..8af28f396a 100644 --- a/crates/bevy_gizmos/src/primitives/dim3.rs +++ b/crates/bevy_gizmos/src/primitives/dim3.rs @@ -245,7 +245,7 @@ where let normal = self.rotation * *self.normal; self.gizmos .primitive_3d(self.normal, self.position, self.rotation, self.color); - let normals_normal = normal.any_orthonormal_vector(); + let normals_normal = self.rotation * self.normal.any_orthonormal_vector(); // draws the axes // get rotation for each direction