mirror of
https://github.com/yquake2/ref_vk.git
synced 2024-12-03 08:52:10 +00:00
parent
8d0f6aadb1
commit
b31e174966
1 changed files with 2 additions and 13 deletions
|
@ -521,20 +521,9 @@ VectorNormalize(vec3_t v)
|
||||||
vec_t
|
vec_t
|
||||||
VectorNormalize2(vec3_t v, vec3_t out)
|
VectorNormalize2(vec3_t v, vec3_t out)
|
||||||
{
|
{
|
||||||
float length, ilength;
|
VectorCopy(v, out);
|
||||||
|
|
||||||
length = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
|
return VectorNormalize(out);
|
||||||
length = (float)sqrt(length);
|
|
||||||
|
|
||||||
if (length)
|
|
||||||
{
|
|
||||||
ilength = 1 / length;
|
|
||||||
out[0] = v[0] * ilength;
|
|
||||||
out[1] = v[1] * ilength;
|
|
||||||
out[2] = v[2] * ilength;
|
|
||||||
}
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue