From 0dd27a6efd24c0e7f4bffacffd689068fd928815 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Wed, 7 Sep 2022 22:57:17 +0200 Subject: [PATCH] Add missing axis vectors for `Vec3` --- narcissus-maths/src/vec3.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/narcissus-maths/src/vec3.rs b/narcissus-maths/src/vec3.rs index c5a3665..b609f88 100644 --- a/narcissus-maths/src/vec3.rs +++ b/narcissus-maths/src/vec3.rs @@ -12,6 +12,10 @@ impl_shared!(Vec3, f32, 3); impl_vector!(Vec3, f32, 3); impl Vec3 { + pub const X: Self = Self::new(1.0, 0.0, 0.0); + pub const Y: Self = Self::new(0.0, 1.0, 0.0); + pub const Z: Self = Self::new(0.0, 0.0, 1.0); + /// Creates a new 3d vector with the given `x`, `y` and `z` components. #[inline(always)] pub const fn new(x: f32, y: f32, z: f32) -> Self { -- 2.49.0