diff options
| author | Ray <[email protected]> | 2017-07-28 20:58:38 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2017-07-28 20:58:38 +0200 |
| commit | d071418cba7491ce6302ba14ed84acb8cc5f2063 (patch) | |
| tree | 707463362354fca808669e0c68151fbb25af2314 /src/raymath.h | |
| parent | 2a263f7b5f6110dbcbfe8c5cc1be23d17fe534b6 (diff) | |
| download | raylib-d071418cba7491ce6302ba14ed84acb8cc5f2063.tar.gz raylib-d071418cba7491ce6302ba14ed84acb8cc5f2063.zip | |
Added Vector3MultiplyV()
To multiply Vector3 by Vector3
Diffstat (limited to 'src/raymath.h')
| -rw-r--r-- | src/raymath.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/raymath.h b/src/raymath.h index cd45c0b5..a06a4f9e 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -140,6 +140,7 @@ RMDEF Vector3 Vector3Zero(void); // Vector with RMDEF Vector3 Vector3One(void); // Vector with components value 1.0f RMDEF Vector3 Vector3Add(Vector3 v1, Vector3 v2); // Add two vectors RMDEF Vector3 Vector3Multiply(Vector3 v, float scalar); // Multiply vector by scalar +RMDEF Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2); // Multiply vector by vector RMDEF Vector3 Vector3Subtract(Vector3 v1, Vector3 v2); // Substract two vectors RMDEF Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2); // Calculate two vectors cross product RMDEF Vector3 Vector3Perpendicular(Vector3 v); // Calculate one vector perpendicular vector @@ -329,6 +330,18 @@ RMDEF Vector3 Vector3Multiply(Vector3 v, float scalar) return v; } +// Multiply vector by vector +RMDEF Vector3 Vector3MultiplyV(Vector3 v1, Vector3 v2) +{ + Vector3 result; + + result.x = v1.x * v2.x; + result.y = v1.y * v2.y; + result.z = v1.z * v2.z; + + return result; +} + // Calculate two vectors cross product RMDEF Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2) { |
