mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-06 18:06:28 +00:00
Fix inverse length in Vector2Normalize (#2189)
Following the pattern in Vector3Normalize.
This commit is contained in:
@@ -328,8 +328,9 @@ RMAPI Vector2 Vector2Normalize(Vector2 v)
|
|||||||
|
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
result.x = v.x*1.0f/length;
|
float ilength = 1.0f / length;
|
||||||
result.y = v.y*1.0f/length;
|
result.x = v.x * ilength;
|
||||||
|
result.y = v.y * ilength;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user