]> git.nega.tv - josh/narcissus/commitdiff
Add `ONE` associated consts to vector types
authorJoshua Simmons <josh@nega.tv>
Tue, 6 Sep 2022 07:17:41 +0000 (09:17 +0200)
committerJoshua Simmons <josh@nega.tv>
Tue, 6 Sep 2022 07:17:41 +0000 (09:17 +0200)
narcissus-maths/src/vec2.rs
narcissus-maths/src/vec3.rs
narcissus-maths/src/vec4.rs

index f57f634299cb83f9ef3cc41d0f1ad008d0617dcf..3828a61776e5fe346479dd7ba5527488914ddaa6 100644 (file)
@@ -7,6 +7,7 @@ pub struct Vec2 {
 
 impl Vec2 {
     pub const ZERO: Self = Self::splat(0.0);
+    pub const ONE: Self = Self::splat(1.0);
 
     pub const X: Self = Self::new(1.0, 0.0);
     pub const Y: Self = Self::new(0.0, 1.0);
index 4f79ac020248a0126ef57f5e7bb44aa6098c0c6e..dc5fb604ee3860113951039d433a019e1d10c16f 100644 (file)
@@ -8,6 +8,7 @@ pub struct Vec3 {
 
 impl Vec3 {
     pub const ZERO: Self = Self::splat(0.0);
+    pub const ONE: Self = Self::splat(1.0);
 
     pub const X: Self = Self::new(1.0, 0.0, 0.0);
     pub const Y: Self = Self::new(0.0, 1.0, 0.0);
index fe561ac65d231675adf3cc08455f8151dceabe57..4953317650ecc992dc54ce4d53398691b8115b65 100644 (file)
@@ -9,6 +9,7 @@ pub struct Vec4 {
 
 impl Vec4 {
     pub const ZERO: Self = Self::splat(0.0);
+    pub const ONE: Self = Self::splat(1.0);
 
     pub const X: Self = Self::new(1.0, 0.0, 0.0, 0.0);
     pub const Y: Self = Self::new(0.0, 1.0, 0.0, 0.0);