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

Method limit_length

core/math/vector2.cpp:164–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164Vector2 Vector2::limit_length(real_t p_len) const {
165 const real_t l = length();
166 Vector2 v = *this;
167 if (l > 0 && p_len < l) {
168 v /= l;
169 v *= p_len;
170 }
171
172 return v;
173}
174
175Vector2 Vector2::move_toward(const Vector2 &p_to, real_t p_delta) const {
176 Vector2 v = *this;

Callers 7

setupMethod · 0.45
solveMethod · 0.45
_draw_axisMethod · 0.45
test_vector3.hFile · 0.45
test_vector2.hFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected