summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vec.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/vec.h b/vec.h
index da7abeb..0e0b62d 100644
--- a/vec.h
+++ b/vec.h
@@ -30,6 +30,10 @@ struct vec3 {
T y;
T z;
+ static vec3 zero() {
+ return vec3{0, 0, 0};
+ }
+
vec3 operator+(const vec3 &b) const {
return vec3{.x=x + b.x, .y=y + b.y, .z=z + b.z};
}