diff options
Diffstat (limited to 'vec3.cpp')
| -rw-r--r-- | vec3.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -88,6 +88,13 @@ std::ostream &operator<<(std::ostream &output, const vec3 &v) { return output << v[0] << " " << v[1] << " " << v[2]; } +std::istream &operator>>(std::istream &input, vec3 &v) +{ + if(!(input >> v[0] >> v[1] >> v[2])) + throw "error parsing vector"; + return input; +} + vec3 operator*(scalar scale, const vec3 &v) { return v * scale; |