diff options
| author | Ray <[email protected]> | 2021-12-10 11:41:45 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-12-10 11:41:45 +0100 |
| commit | 20f4d8c147993b85b1ad1fc1f0b069aca0339544 (patch) | |
| tree | f9c814a9081636caf117d1533ee16acf57e0e315 /src | |
| parent | 77871025739498d5e0837c7807e8da70511c255f (diff) | |
| download | raylib-20f4d8c147993b85b1ad1fc1f0b069aca0339544.tar.gz raylib-20f4d8c147993b85b1ad1fc1f0b069aca0339544.zip | |
Reviewed typo
Diffstat (limited to 'src')
| -rw-r--r-- | src/raymath.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/raymath.h b/src/raymath.h index 352c29e5..97149625 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -99,8 +99,7 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- #if !defined(RL_VECTOR2_TYPE) -// -type +// Vector2 type typedef struct Vector2 { float x; float y; @@ -534,10 +533,12 @@ RMAPI float Vector3Distance(Vector3 v1, Vector3 v2) // Calculate angle between two vectors RMAPI float Vector3Angle(Vector3 v1, Vector3 v2) { + float result = 0.0f; + Vector3 cross = { v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x }; float len = sqrtf(cross.x*cross.x + cross.y*cross.y + cross.z*cross.z); float dot = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); - float result = atan2f(len, dot); + result = atan2f(len, dot); return result; } |
