Fix Vector's Bounce Reflect
Fixes Vector 2 and 3 bounce and reflect methods to match gdscript Co-Authored-By: Bruno Campos <brunocu@msn.com> Move calculation to reflect fix commit squash fix style
This commit is contained in:
@@ -180,8 +180,8 @@ struct Vector2 {
|
||||
return -reflect(p_normal);
|
||||
}
|
||||
|
||||
inline Vector2 reflect(const Vector2 &p_vec) const {
|
||||
return p_vec - *this * this->dot(p_vec) * 2.0;
|
||||
inline Vector2 reflect(const Vector2 &p_normal) const {
|
||||
return -(*this -p_normal * this->dot(p_normal) * 2.0);
|
||||
}
|
||||
|
||||
inline real_t angle() const {
|
||||
|
||||
Reference in New Issue
Block a user