typedef struct traceInfo_s
{
shaderInfo_t *si;
- int surfaceNum, castShadows;
+ int surfaceNum, castShadows, skipGrid;
}
traceInfo_t;
{
if( traceInfos[ num ].si == ti->si &&
traceInfos[ num ].surfaceNum == ti->surfaceNum &&
- traceInfos[ num ].castShadows == ti->castShadows )
+ traceInfos[ num ].castShadows == ti->castShadows &&
+ traceInfos[ num ].skipGrid == ti->skipGrid )
return num;
}
/* normal node */
else
- traceNodes[ nodeNum ].children[ i ] = SetupTraceNodes_r( bspNode->children[ i ] );
+ {
+ newNode = SetupTraceNodes_r( bspNode->children[ i ] );
+ traceNodes[ nodeNum ].children[ i ] = newNode;
+ }
+
+ if(traceNodes[ nodeNum ].children[ i ] == 0)
+ Error( "Invalid tracenode allocated" );
}
/* Sys_Printf("node %d children: %d %d\n", nodeNum, traceNodes[ nodeNum ].children[0], traceNodes[ nodeNum ].children[1]); */
ti.si = info->si;
ti.castShadows = info->castShadows;
ti.surfaceNum = model->firstBSPBrush + i;
+ ti.skipGrid = (ds->surfaceType == MST_PATCH);
/* choose which node (normal or skybox) */
if( info->parentSurfaceNum >= 0 )
/* setup trace info */
ti.castShadows = castShadows;
ti.surfaceNum = -1;
+ ti.skipGrid = qtrue; // also ignore picomodels when skipping patches
/* setup trace winding */
memset( &tw, 0, sizeof( tw ) );
if( ti->castShadows != 1 )
return qfalse;
}
-
+
/* receive shadows from same group and worldspawn group */
else if( trace->recvShadows > 1 )
{
return qfalse;
}
+ /* skip patches when doing the grid (FIXME this is an ugly hack) */
+ if( inGrid )
+ {
+ if (ti->skipGrid)
+ return qfalse;
+ }
+
/* begin calculating determinant - also used to calculate u parameter */
CrossProduct( trace->direction, tt->edge2, pvec );
/* check filter for opaque */
if( trace->color[ 0 ] <= 0.001f && trace->color[ 1 ] <= 0.001f && trace->color[ 2 ] <= 0.001f )
{
+ VectorClear( trace->color );
VectorMA( trace->origin, depth, trace->direction, trace->hit );
trace->opaque = qtrue;
return qtrue;