mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Merge pull request #1096 from devnexen/unroll_dis
VectorLength reduces complexity.
This commit is contained in:
commit
aa259a5d5f
1 changed files with 3 additions and 13 deletions
|
@ -577,19 +577,9 @@ double sqrt(double x);
|
|||
vec_t
|
||||
VectorLength(vec3_t v)
|
||||
{
|
||||
int i;
|
||||
float length;
|
||||
|
||||
length = 0;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
length += v[i] * v[i];
|
||||
}
|
||||
|
||||
length = (float)sqrt(length);
|
||||
|
||||
return length;
|
||||
return sqrtf((v[0] * v[0]) +
|
||||
(v[1] * v[1]) +
|
||||
(v[2] * v[2]));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue