mirror of
https://github.com/id-Software/quake2-rerelease-dll.git
synced 2025-03-14 12:20:45 +00:00
Converted VectorNormalize to float
This commit is contained in:
parent
884100cc13
commit
9320c9c453
2 changed files with 23 additions and 1 deletions
|
@ -117,6 +117,27 @@ skipwhite:
|
|||
return buffer;
|
||||
}
|
||||
|
||||
// Action Add
|
||||
float VectorNormalize (vec3_t v)
|
||||
{
|
||||
float length, ilength;
|
||||
|
||||
length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
|
||||
|
||||
if (length)
|
||||
{
|
||||
length = sqrtf(length); // FIXME
|
||||
ilength = 1/length;
|
||||
v[0] *= ilength;
|
||||
v[1] *= ilength;
|
||||
v[2] *= ilength;
|
||||
}
|
||||
|
||||
return length;
|
||||
|
||||
}
|
||||
// Action Add end
|
||||
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
|
|
|
@ -220,7 +220,8 @@ size_t Q_strlcat(char* dst, const char* src, size_t siz);
|
|||
//======================================================================
|
||||
|
||||
//void AddPointToBounds (const vec3_t v, vec3_t mins, vec3_t maxs);
|
||||
vec3_t VectorNormalize (vec3_t v); // returns vector length
|
||||
|
||||
float VectorNormalize (vec3_t v); // returns vector length
|
||||
vec3_t VectorNormalize2 (const vec3_t v, vec3_t out);
|
||||
|
||||
int Q_log2 (int val);
|
||||
|
|
Loading…
Reference in a new issue