|
|
@ -20,9 +20,9 @@ void frustum_update(int width, int height) |
|
|
int near; |
|
|
int near; |
|
|
gte_ReadGeomScreen(&near); |
|
|
gte_ReadGeomScreen(&near); |
|
|
|
|
|
|
|
|
//FntPrint(-1, "N = %d, W = %d, H = %d\n", near, width, height); |
|
|
|
|
|
|
|
|
// FntPrint(-1, "N = %d, W = %d, H = %d\n", near, width, height); |
|
|
|
|
|
|
|
|
// 2 * near, shifted left for division |
|
|
|
|
|
|
|
|
// 2 * ONE * near |
|
|
near <<= 13; |
|
|
near <<= 13; |
|
|
|
|
|
|
|
|
l.vx = near / width; |
|
|
l.vx = near / width; |
|
|
@ -53,7 +53,7 @@ void frustum_update(int width, int height) |
|
|
// left.vx, left.pad, right.vx, right.pad, top.vz, top.pad, bottom.vz, bottom.pad); |
|
|
// left.vx, left.pad, right.vx, right.pad, top.vz, top.pad, bottom.vz, bottom.pad); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
u_char frustum_pointInside(SVECTOR *point) |
|
|
|
|
|
|
|
|
u_char frustum_pointInside(const SVECTOR *point) |
|
|
{ |
|
|
{ |
|
|
if (m_dot12(left, *point) + left.pad < 0) return 0; |
|
|
if (m_dot12(left, *point) + left.pad < 0) return 0; |
|
|
if (m_dot12(right, *point) + right.pad < 0) return 0; |
|
|
if (m_dot12(right, *point) + right.pad < 0) return 0; |
|
|
@ -62,7 +62,7 @@ u_char frustum_pointInside(SVECTOR *point) |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
u_char frustum_sphereInside(SVECTOR *sphere) |
|
|
|
|
|
|
|
|
u_char frustum_sphereInside(const SVECTOR *sphere) |
|
|
{ |
|
|
{ |
|
|
short radius = -sphere->pad; |
|
|
short radius = -sphere->pad; |
|
|
if (m_dot12(left, *sphere) + left.pad < radius) return 0; |
|
|
if (m_dot12(left, *sphere) + left.pad < radius) return 0; |
|
|
|