Rico P
há 2 anos
committed by
GitHub
ascendente
cometimento
8b8eddc8e2
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: 4AEE18F83AFDEB23
1 ficheiros alterados com
7 adições e
5 eliminações
-
src/raymath.h
|
|
|
@ -703,12 +703,14 @@ RMAPI Vector3 Vector3Normalize(Vector3 v) |
|
|
|
Vector3 result = v; |
|
|
|
|
|
|
|
float length = sqrtf(v.x*v.x + v.y*v.y + v.z*v.z); |
|
|
|
if (length == 0.0f) length = 1.0f; |
|
|
|
float ilength = 1.0f/length; |
|
|
|
if (length != 0.0f) |
|
|
|
{ |
|
|
|
float ilength = 1.0f/length; |
|
|
|
|
|
|
|
result.x *= ilength; |
|
|
|
result.y *= ilength; |
|
|
|
result.z *= ilength; |
|
|
|
result.x *= ilength; |
|
|
|
result.y *= ilength; |
|
|
|
result.z *= ilength; |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|