X-Git-Url: http://git.localhorst.tv/?p=space.git;a=blobdiff_plain;f=src%2Fgraphics%2FVector.h;h=4cf920bd70b8a6eaeafb8f9f75ab04ce1570ace7;hp=992ba1eef6a8bbdc323b8f612eef14eb2471f7d7;hb=ffd31714f3edb64ebe16b65878750c6cc5c7e884;hpb=699437a474de8b87ccb6749d44adf740e680d620 diff --git a/src/graphics/Vector.h b/src/graphics/Vector.h index 992ba1e..4cf920b 100644 --- a/src/graphics/Vector.h +++ b/src/graphics/Vector.h @@ -142,6 +142,10 @@ constexpr bool operator !=(Vector lhs, Vector rhs) { } +template +constexpr Scalar Cross2D(Vector lhs, Vector rhs) { + return (lhs.x * rhs.y) - (lhs.y * rhs.x); +} template constexpr Scalar Dot(Vector lhs, Vector rhs) { return (lhs.x * rhs.x) + (lhs.y * rhs.y);