diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index 40c085f2..5b126983 100755 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -30,6 +30,14 @@ pub struct Quaternion { pub coords: Vector4, } +impl Default for Quaternion { + fn default() -> Self { + Quaternion { + coords: Vector4::zeros() + } + } +} + #[cfg(feature = "abomonation-serialize")] impl Abomonation for Quaternion where Vector4: Abomonation @@ -1422,6 +1430,12 @@ impl UnitQuaternion { } } +impl Default for UnitQuaternion { + fn default() -> Self { + Self::identity() + } +} + impl fmt::Display for UnitQuaternion { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(axis) = self.axis() {