mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-25 04:28:30 +00:00
Update raymath.h (#1802)
This commit is contained in:
@@ -326,7 +326,7 @@ RMDEF Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance)
|
|||||||
float dy = target.y - v.y;
|
float dy = target.y - v.y;
|
||||||
float value = (dx*dx) + (dy*dy);
|
float value = (dx*dx) + (dy*dy);
|
||||||
|
|
||||||
if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance*maxDistance))) result = target;
|
if ((value == 0) || ((maxDistance >= 0) && (value <= maxDistance * maxDistance))) return target;
|
||||||
|
|
||||||
float dist = sqrtf(value);
|
float dist = sqrtf(value);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user