28 #include "../idlib/precompiled.h"
41 template <
class T,
int N>
48 for(
int i=0;
i <
s;
i++)
67 unsigned int size()
const {
117 v.
x = b.
x * a.
w - a.
x * b.
w;
118 v.
y = b.
y * a.
w - a.
y * b.
w;
119 v.
z = b.
z * a.
w - a.
z * b.
w;
129 { t =
a; a =
b; b =
c; c =
t; }
131 { t =
a; a =
b; b =
c; c =
t; }
169 for(
unsigned int i = 0;
i <
p.size();
i++ )
172 for(
unsigned int j = 0;
j < ni.
size();
j++)
186 for(
int i = 0;
i < P-1;
i++ )
193 for(
int ii=0; ii < Si; ii++)
196 int ii1 = (ii+1) % Si;
203 for(
int j =
i+1;
j <
P;
j++ )
209 for(
int jj = 0; jj < Sj; jj++ )
212 int jj1 = (jj+1) % Sj;
213 if(vi[ii0] == vj[jj1] && vi[ii1] == vj[jj0])
226 else if ( vi[ii0] == vj[jj0] && vi[ii1] == vj[jj1] )
228 fprintf(stderr,
"why am I here?\n");
241 for(
unsigned int i = 0;
i <
p.size();
i++ )
249 for(
unsigned int i=0;
i <
v.size();
i++ )
273 if( p.
e.
size() == 0 ) {
321 for(
unsigned int i = 0;
i < 6;
i++) {
322 if( ( oc.
p[
i].plane * light ) > 0 )
326 if( lut[index].e.size() == 0 )
332 for(
int j = 0;
j <
V;
j++ )
340 for(
unsigned int i=0;
i < oc.
p.
size();
i++)
342 if( (oc.
p[
i].plane * light) > 0)
356 for(
int i=0;
i <
I;
i++)
362 for(
int j = 0;
j <
S;
j++)
375 for(
unsigned int i = 0;
i < vpg.
size();
i++)
387 for(
int j = 0;
j <
V;
j++ )
408 for(
unsigned int i = 0;
i < a.
e.
size();
i++)
421 for(
unsigned int i = 0;
i < is.
size();
i+=2 )
427 bool discard =
false;
429 for(
unsigned int j = 0;
j < p.
size();
j++ )
431 float da = a * p[
j].plane;
432 float db = b * p[
j].plane;
433 float rdw = 1/(da - db);
449 c = -db * rdw * a + da * rdw *
b;
454 c = -db * rdw * a + da * rdw *
b;
481 return idMat4( m[ 0], m[ 4], m[ 8], m[12],
482 m[ 1], m[ 5], m[ 9], m[13],
483 m[ 2], m[ 6], m[10], m[14],
484 m[ 3], m[ 7], m[11], m[15] );
494 for(
unsigned int i = 0;
i < p.
e.
size();
i++)
502 for(
unsigned int i = 0;
i < s.
size();
i+=2)
512 for ( i = 0 ; i < 4 ; i ++ ) {
521 for ( i = 0 ; i < 4 ; i ++ ) {
589 for(
unsigned int i = 0;
i < out_segs.
size();
i++ ) {
605 if ( outbounds[0].
x < -1.0
f ) {
606 outbounds[0].x = -1.0f;
608 if ( outbounds[1].
x > 1.0
f ) {
609 outbounds[1].x = 1.0f;
611 if ( outbounds[0].
y < -1.0
f ) {
612 outbounds[0].y = -1.0f;
614 if ( outbounds[1].
y > 1.0
f ) {
615 outbounds[1].y = 1.0f;
624 rect.
x1 = outbounds[0].x * w2 + w2 +
x;
625 rect.
x2 = outbounds[1].x * w2 + w2 +
x;
626 rect.
y1 = outbounds[0].y * h2 + h2 +
y;
627 rect.
y2 = outbounds[1].y * h2 + h2 +
y;
void draw_segments(const viewDef_t *viewDef, const MySegments &s, idVec4 color)
idCVar r_useInteractionScissors("r_useInteractionScissors","2", CVAR_RENDERER|CVAR_INTEGER,"1 = use a custom scissor rectangle for each shadow interaction, 2 = also crop using portal scissors",-2, 2, idCmdSystem::ArgCompletion_Integer<-2, 2 >)
void discard_neighbor_info()
MyArray< int, 4 > MyArrayInt
MyArray(const MyArray< T, N > &cpy)
MyArray< poly, 9 > MyArrayPoly
void polyhedron_edges(polyhedron &a, MySegments &e)
idVec3 Cross(const idVec3 &a) const
float projectionMatrix[16]
unsigned int size() const
idMat4 make_idMat4(const float *m)
virtual void DebugLine(const idVec4 &color, const idVec3 &start, const idVec3 &end, const int lifetime=0, const bool depthTest=false)
bool AddPoint(const idVec3 &v)
void transform(const idMat4 &m)
void clip_segments(const polyhedron &ph, MySegments &is, MySegments &os)
void push_back(const T &i)
idScreenRect R_CalcIntersectionScissor(const idRenderLightLocal *lightDef, const idRenderEntityLocal *entityDef, const viewDef_t *viewDef)
int GetInteger(void) const
virtual void DebugScreenRect(const idVec4 &color, const idScreenRect &rect, const viewDef_t *viewDef, const int lifetime=0)
void Intersect(const idScreenRect &rect)
void world_to_hclip(const viewDef_t *viewDef, const idVec4 &global, idVec4 &clip)
polyhedron PolyhedronFromBounds(const idBounds &b)
idVec4 compute_homogeneous_plane(idVec4 a, idVec4 b, idVec4 c)
MyArrayInt four_ints(int a, int b, int c, int d)
GLubyte GLubyte GLubyte a
virtual void Printf(const char *fmt,...) id_attribute((format(printf
MyArray< idVec4, 16 > MyArrayVec4
srfTriangles_t * frustumTris
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
MyArray< edge, 15 > MyArrayEdge
void draw_polyhedron(const viewDef_t *viewDef, const polyhedron &p, idVec4 color)
polyhedron make_sv(const polyhedron &oc, idVec4 light)
float modelViewMatrix[16]
idVec3 homogeneous_difference(idVec4 a, idVec4 b)
const T & operator[](int i) const
idRenderWorldLocal * renderWorld
char * va(const char *fmt,...)
void add_quad(int va, int vb, int vc, int vd)
idVec3 v4to3(const idVec4 &v)
MyArray< idVec4, 36 > MySegments
struct viewLight_s * viewLight