diff --git a/crates/bevy_math/src/direction.rs b/crates/bevy_math/src/direction.rs index f5ecf75c08..03cb9f969f 100644 --- a/crates/bevy_math/src/direction.rs +++ b/crates/bevy_math/src/direction.rs @@ -4,6 +4,7 @@ use crate::{ }; use core::f32::consts::FRAC_1_SQRT_2; +use core::fmt; use derive_more::derive::Into; #[cfg(feature = "bevy_reflect")] @@ -325,6 +326,12 @@ impl core::ops::Mul for Rot2 { } } +impl fmt::Display for Dir2 { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + #[cfg(any(feature = "approx", test))] impl approx::AbsDiffEq for Dir2 { type Epsilon = f32; @@ -587,6 +594,12 @@ impl core::ops::Mul for Quat { } } +impl fmt::Display for Dir3 { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + #[cfg(feature = "approx")] impl approx::AbsDiffEq for Dir3 { type Epsilon = f32; @@ -834,6 +847,12 @@ impl core::ops::Mul for Quat { } } +impl fmt::Display for Dir3A { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + #[cfg(feature = "approx")] impl approx::AbsDiffEq for Dir3A { type Epsilon = f32; @@ -1022,6 +1041,12 @@ impl core::ops::Mul for f32 { } } +impl fmt::Display for Dir4 { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + #[cfg(feature = "approx")] impl approx::AbsDiffEq for Dir4 { type Epsilon = f32;