Reviewed typo
This commit is contained in:
parent
7787102573
commit
20f4d8c147
1 changed files with 4 additions and 3 deletions
|
@ -99,8 +99,7 @@
|
||||||
// Types and Structures Definition
|
// Types and Structures Definition
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
#if !defined(RL_VECTOR2_TYPE)
|
#if !defined(RL_VECTOR2_TYPE)
|
||||||
//
|
// Vector2 type
|
||||||
type
|
|
||||||
typedef struct Vector2 {
|
typedef struct Vector2 {
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
|
@ -534,10 +533,12 @@ RMAPI float Vector3Distance(Vector3 v1, Vector3 v2)
|
||||||
// Calculate angle between two vectors
|
// Calculate angle between two vectors
|
||||||
RMAPI float Vector3Angle(Vector3 v1, Vector3 v2)
|
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 };
|
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 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 dot = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
||||||
float result = atan2f(len, dot);
|
result = atan2f(len, dot);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue