Add Vector2Dir function to get the direction vector of two given points

This commit is contained in:
Victor Gallet 2024-01-22 20:36:18 +01:00 committed by GitHub
parent c133fee286
commit fd97fd1748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -253,6 +253,14 @@ RMAPI Vector2 Vector2Add(Vector2 v1, Vector2 v2)
return result;
}
// Get direction vector of two points
RMAPI Vector2 Vector2Dir(Vector2 p1, Vector2 p2)
{
Vector2 result = { p2.x - p1.x, p2.y - p1.y };
return result;
}
// Add vector and float value
RMAPI Vector2 Vector2AddValue(Vector2 v, float add)
{