MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / reflect

Method reflect

core/math/vector2.cpp:193–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193Vector2 Vector2::reflect(const Vector2 &p_normal) const {
194#ifdef MATH_CHECKS
195 ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 " + p_normal.operator String() + "must be normalized.");
196#endif
197 return 2.0f * p_normal * dot(p_normal) - *this;
198}
199
200bool Vector2::is_equal_approx(const Vector2 &p_v) const {
201 return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y);

Callers

nothing calls this directly

Calls 3

Vector2Function · 0.70
is_normalizedMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected