From 5b943581269a224c9dcb91a6783714f7fb80c720 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 1 Dec 2015 21:45:55 +0100 Subject: [PATCH] [DEV] Add cross product at vector2D --- etk/math/Vector2D.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etk/math/Vector2D.h b/etk/math/Vector2D.h index 7949537..753f2a5 100644 --- a/etk/math/Vector2D.h +++ b/etk/math/Vector2D.h @@ -216,6 +216,14 @@ namespace etk { --(*this); return result; } + /** + * @brief Return the cross product + * @param v The other vector in the cross product + */ + btScalar cross(const Vector2D& _v) const { + return m_floats[0] * _v.m_floats[1] + - m_floats[1] * _v.m_floats[0]; + } /** * @brief Return the dot product * @param v The other vector in the dot product