mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-27 06:13:23 +00:00
Modify PF_findradius to not use sqrtf
This commit is contained in:
parent
d23aa08f8c
commit
d274e43580
1 changed files with 5 additions and 2 deletions
|
@ -1106,7 +1106,9 @@ void PF_findradius (void)
|
||||||
chain = (edict_t *)sv.edicts;
|
chain = (edict_t *)sv.edicts;
|
||||||
|
|
||||||
org = G_VECTOR(OFS_PARM0);
|
org = G_VECTOR(OFS_PARM0);
|
||||||
|
|
||||||
rad = G_FLOAT(OFS_PARM1);
|
rad = G_FLOAT(OFS_PARM1);
|
||||||
|
rad *= rad;
|
||||||
|
|
||||||
ent = NEXT_EDICT(sv.edicts);
|
ent = NEXT_EDICT(sv.edicts);
|
||||||
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
|
for (i=1 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
|
||||||
|
@ -1116,8 +1118,9 @@ void PF_findradius (void)
|
||||||
if (ent->v.solid == SOLID_NOT)
|
if (ent->v.solid == SOLID_NOT)
|
||||||
continue;
|
continue;
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++)
|
||||||
eorg[j] = org[j] - (ent->v.origin[j] + (ent->v.mins[j] + ent->v.maxs[j])*0.5);
|
eorg[j] = org[j] - (ent->v.origin[j] + (ent->v.mins[j] + ent->v.maxs[j])*0.5);
|
||||||
if (Length(eorg) > rad)
|
|
||||||
|
if (DotProduct(eorg, eorg) > rad)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ent->v.chain = EDICT_TO_PROG(chain);
|
ent->v.chain = EDICT_TO_PROG(chain);
|
||||||
|
|
Loading…
Reference in a new issue