diff options
author | Keuin <[email protected]> | 2022-04-11 21:32:45 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-11 21:32:45 +0800 |
commit | f6661b0243cb359fb4929aee06d1247944f3d2dd (patch) | |
tree | f3bf29543bdfb89cb563bbb93337c404f46f7a70 /vec.h | |
parent | d10ff99fc9bee538ebc7da23ba2f8b476ef151e1 (diff) |
Implement vec3::zero().
Diffstat (limited to 'vec.h')
-rw-r--r-- | vec.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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}; } |