mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-21 11:11:37 +00:00
More non-canonical checks in PlaneTypeForNormal.
This commit is contained in:
parent
c9eb679c41
commit
b91568bbdd
1 changed files with 9 additions and 4 deletions
|
@ -137,6 +137,7 @@ int
|
||||||
PlaneTypeForNormal (const vec3_t normal)
|
PlaneTypeForNormal (const vec3_t normal)
|
||||||
{
|
{
|
||||||
float ax, ay, az;
|
float ax, ay, az;
|
||||||
|
int type;
|
||||||
|
|
||||||
// NOTE: should these have an epsilon around 1.0?
|
// NOTE: should these have an epsilon around 1.0?
|
||||||
if (normal[0] == 1.0)
|
if (normal[0] == 1.0)
|
||||||
|
@ -153,10 +154,14 @@ PlaneTypeForNormal (const vec3_t normal)
|
||||||
az = fabs(normal[2]);
|
az = fabs(normal[2]);
|
||||||
|
|
||||||
if (ax >= ay && ax >= az)
|
if (ax >= ay && ax >= az)
|
||||||
return PLANE_ANYX;
|
type = PLANE_ANYX;
|
||||||
if (ay >= ax && ay >= az)
|
else if (ay >= ax && ay >= az)
|
||||||
return PLANE_ANYY;
|
type = PLANE_ANYY;
|
||||||
return PLANE_ANYZ;
|
else
|
||||||
|
type = PLANE_ANYZ;
|
||||||
|
if (normal[type - PLANE_ANYX] < 0)
|
||||||
|
Sys_Error ("PlaneTypeForNormal: not a canonical vector");
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DISTEPSILON 0.01
|
#define DISTEPSILON 0.01
|
||||||
|
|
Loading…
Reference in a new issue