mid.xyz[ k ] = -plane[ 3 ];
else
mid.xyz[ k ] = a->xyz[ k ] + frac * (b->xyz[ k ] - a->xyz[ k ]);
-
- /* set texture coordinates */
- if( k > 1 )
- continue;
- mid.st[ 0 ] = a->st[ 0 ] + frac * (b->st[ 0 ] - a->st[ 0 ]);
- mid.st[ 1 ] = a->st[ 1 ] + frac * (b->st[ 1 ] - a->st[ 1 ]);
}
+ /* set texture coordinates */
+ mid.st[ 0 ] = a->st[ 0 ] + frac * (b->st[ 0 ] - a->st[ 0 ]);
+ mid.st[ 1 ] = a->st[ 1 ] + frac * (b->st[ 1 ] - a->st[ 1 ]);
/* copy midpoint to front and back polygons */
front->v[ front->numVerts++ ] = mid;
-/*
-FilterPointToTraceNodes_r() - ydnar
-debugging tool
-*/
-
-static int FilterPointToTraceNodes_r( vec3_t pt, int nodeNum )
-{
- float dot;
- traceNode_t *node;
-
-
- if( nodeNum < 0 || nodeNum >= numTraceNodes )
- return -1;
-
- node = &traceNodes[ nodeNum ];
-
- if( node->type >= 0 )
- {
- dot = DotProduct( pt, node->plane ) - node->plane[ 3 ];
- if( dot > -0.001f )
- FilterPointToTraceNodes_r( pt, node->children[ 0 ] );
- if( dot < 0.001f )
- FilterPointToTraceNodes_r( pt, node->children[ 1 ] );
- return -1;
- }
-
- Sys_Printf( "%d ", nodeNum );
-
- return nodeNum;
-}
-
-
-
/*
FilterTraceWindingIntoNodes_r() - ydnar
filters a trace winding into the raytracing tree
/* external model */
default:
- frame = IntForKey( e, "_frame" );
- model = LoadModel( (char*) value, frame );
+ frame = 0;
+ if(strcmp("", ValueForKey( e, "_frame")))
+ frame = IntForKey(e, "_frame");
+ else if(strcmp("", ValueForKey( e, "frame")))
+ frame = IntForKey(e, "frame");
+ model = LoadModel( value, frame );
if( model == NULL )
continue;
PopulateWithPicoModel( castShadows, model, transform );
/* external model */
default:
frame = IntForKey( e, "_frame2" );
- model = LoadModel( (char*) value, frame );
+ model = LoadModel( value, frame );
if( model == NULL )
continue;
PopulateWithPicoModel( castShadows, model, transform );
t = t - floor( t );
is = s * si->lightImage->width;
it = t * si->lightImage->height;
+ if(is < 0) is = 0;
+ if(is > si->lightImage->width - 1) is = si->lightImage->width - 1;
+ if(it < 0) it = 0;
+ if(it > si->lightImage->height - 1) it = si->lightImage->height - 1;
/* get pixel */
pixel = si->lightImage->pixels + 4 * (it * si->lightImage->width + is);