Browse Source

add method to support only adding x or y to vector2

pull/4446/head
cmanlh 2 months ago
parent
commit
5e4d6e17b2
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      src/raymath.h

+ 16
- 0
src/raymath.h View File

@ -264,6 +264,22 @@ RMAPI Vector2 Vector2AddValue(Vector2 v, float add)
return result;
}
// Add vector and x float value
RMAPI Vector2 Vector2AddX(Vector2 v, float x)
{
Vector2 result = { v.x + x, v.y };
return result;
}
// Add vector and y float value
RMAPI Vector2 Vector2AddY(Vector2 v, float y)
{
Vector2 result = { v.x, v.y + y };
return result;
}
// Subtract two vectors (v1 - v2)
RMAPI Vector2 Vector2Subtract(Vector2 v1, Vector2 v2)
{

Loading…
Cancel
Save