diff --git a/math/mat4x4.hpp b/math/mat4x4.hpp index 1a5c25e..ca8a989 100644 --- a/math/mat4x4.hpp +++ b/math/mat4x4.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include "vec4.hpp" template struct mat; diff --git a/math/vec3.hpp b/math/vec3.hpp index 7383cee..c05dd72 100644 --- a/math/vec3.hpp +++ b/math/vec3.hpp @@ -147,3 +147,11 @@ inline constexpr T length(vec<3, T> const& v) { return sqrt(dot(v, v)); } + +template +inline constexpr vec<3, T> cross(vec<3, T> const& x, vec<3, T> const& y) +{ + return vec<3, T>(x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y); +}