]> git.nega.tv - josh/narcissus/commitdiff
Add missing axis vectors for `Vec3`
authorJoshua Simmons <josh@nega.tv>
Wed, 7 Sep 2022 20:57:17 +0000 (22:57 +0200)
committerJoshua Simmons <josh@nega.tv>
Wed, 7 Sep 2022 20:57:17 +0000 (22:57 +0200)
narcissus-maths/src/vec3.rs

index c5a3665f31b1e51b6298d65ffbd70bb6f67ef729..b609f88a02d765b9ed8f32d98336b82c4218f1c5 100644 (file)
@@ -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 {