diff options
Diffstat (limited to 'include/core/Vector2.hpp')
-rw-r--r-- | include/core/Vector2.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/core/Vector2.hpp b/include/core/Vector2.hpp index 72c5c78..99ac60f 100644 --- a/include/core/Vector2.hpp +++ b/include/core/Vector2.hpp @@ -176,6 +176,10 @@ struct Vector2 { return p_vec - *this * this->dot(p_vec); } + inline Vector2 bounce(const Vector2 &p_normal) const { + return -reflect(p_normal); + } + inline Vector2 reflect(const Vector2 &p_vec) const { return p_vec - *this * this->dot(p_vec) * 2.0; } |