mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 23:31:53 -05:00
Remove redundant "== false" code
Some of this code has been re-organized. f
This commit is contained in:
@@ -167,7 +167,7 @@ Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, c
|
||||
// slide returns the component of the vector along the given plane, specified by its normal vector.
|
||||
Vector2 Vector2::slide(const Vector2 &p_normal) const {
|
||||
#ifdef MATH_CHECKS
|
||||
ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector2());
|
||||
ERR_FAIL_COND_V(!p_normal.is_normalized(), Vector2());
|
||||
#endif
|
||||
return *this - p_normal * this->dot(p_normal);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ Vector2 Vector2::bounce(const Vector2 &p_normal) const {
|
||||
|
||||
Vector2 Vector2::reflect(const Vector2 &p_normal) const {
|
||||
#ifdef MATH_CHECKS
|
||||
ERR_FAIL_COND_V(p_normal.is_normalized() == false, Vector2());
|
||||
ERR_FAIL_COND_V(!p_normal.is_normalized(), Vector2());
|
||||
#endif
|
||||
return 2.0 * p_normal * this->dot(p_normal) - *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user