diff options
| author | Ray <[email protected]> | 2018-09-13 12:51:45 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-09-13 12:51:45 +0200 |
| commit | f32e23c11bcfca1dc54db09b35aba549f952242c (patch) | |
| tree | 435dac5923037db66cbfb4e4984160a4905d8a50 /src/raymath.h | |
| parent | 37acf0aa221be70f5e2968a82db1c7a400c52ea2 (diff) | |
| parent | 1e1bbaa40b75dab8a534fdb447354adfc02b2333 (diff) | |
| download | raylib-f32e23c11bcfca1dc54db09b35aba549f952242c.tar.gz raylib-f32e23c11bcfca1dc54db09b35aba549f952242c.zip | |
Merge pull request #641 from ChrisDill/master
Added a few missing functions to raymath
Diffstat (limited to 'src/raymath.h')
| -rw-r--r-- | src/raymath.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/raymath.h b/src/raymath.h index c5c6588f..33116532 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -229,6 +229,13 @@ RMDEF Vector2 Vector2Scale(Vector2 v, float scale) return result; } +// Multiply vector by vector +RMDEF Vector2 Vector2MultiplyV(Vector2 v1, Vector2 v2) +{ + Vector2 result = { v1.x*v2.x, v1.y*v2.y }; + return result; +} + // Negate vector RMDEF Vector2 Vector2Negate(Vector2 v) { @@ -243,6 +250,13 @@ RMDEF Vector2 Vector2Divide(Vector2 v, float div) return result; } +// Divide vector by vector +RMDEF Vector2 Vector2DivideV(Vector2 v1, Vector2 v2) +{ + Vector2 result = { v1.x/v2.x, v1.y/v2.y }; + return result; +} + // Normalize provided vector RMDEF Vector2 Vector2Normalize(Vector2 v) { @@ -378,6 +392,20 @@ RMDEF Vector3 Vector3Negate(Vector3 v) return result; } +// Divide vector by a float value +RMDEF Vector3 Vector3Divide(Vector3 v, float div) +{ + Vector3 result = { v.x / div, v.y / div, v.z / div }; + return result; +} + +// Divide vector by vector +RMDEF Vector3 Vector3DivideV(Vector3 v1, Vector3 v2) +{ + Vector3 result = { v1.x/v2.x, v1.y/v2.y, v1.z/v2.z }; + return result; +} + // Normalize provided vector RMDEF Vector3 Vector3Normalize(Vector3 v) { |
