Exemplo n.º 1
0
/*
* R_TraceAgainstLeaf
*/
static int R_TraceAgainstLeaf( mleaf_t *leaf ) {
	unsigned i;
	msurface_t *surf;

	if( leaf->cluster == -1 ) {
		return 1;   // solid leaf

	}
	for( i = 0; i < leaf->numVisSurfaces; i++ ) {
		surf = rsh.worldBrushModel->surfaces + leaf->visSurfaces[i];

		if( surf->fragmentframe == r_traceframecount ) {
			continue;   // do not test the same surface more than once
		}
		surf->fragmentframe = r_traceframecount;

		if( surf->flags & trace_umask ) {
			continue;
		}

		if( surf->mesh.numVerts != 0 ) {
			if( R_TraceAgainstSurface( surf ) ) {
				trace_surface = surf;   // impact surface
			}
		}
	}

	return 0;
}
Exemplo n.º 2
0
/*
=================
R_TraceAgainstLeaf
=================
*/
static int R_TraceAgainstLeaf( mleaf_t *leaf )
{
	msurface_t *surf, **mark;

	if( leaf->cluster == -1 )
		return 1;	// solid leaf

	mark = leaf->firstVisSurface;
	if( mark )
	{
		do
		{
			surf = *mark++;
			if( surf->fragmentframe == r_fragmentframecount )
				continue;	// do not test the same surface more than once
			surf->fragmentframe = r_fragmentframecount;

			if( surf->flags & trace_umask )
				continue;

			if( surf->mesh )
				if( R_TraceAgainstSurface( surf ) )
					trace_surface = surf;	// impact surface
		} while( *mark );
	}

	return 0;
}
Exemplo n.º 3
0
/*
=================
R_TraceAgainstBmodel
=================
*/
static int R_TraceAgainstBmodel( mbrushmodel_t *bmodel )
{
	int i;
	msurface_t *surf;

	for( i = 0; i < bmodel->nummodelsurfaces; i++ )
	{
		surf = bmodel->firstmodelsurface + i;
		if( surf->flags & trace_umask )
			continue;

		if( R_TraceAgainstSurface( surf ) )
			trace_surface = surf;	// impact point
	}

	return 0;
}
Exemplo n.º 4
0
/*
* R_TraceAgainstBmodel
*/
static int R_TraceAgainstBmodel( mbrushmodel_t *bmodel ) {
	unsigned int i;
	msurface_t *surf;

	for( i = 0; i < bmodel->numModelSurfaces; i++ ) {
		surf = rsh.worldBrushModel->surfaces + bmodel->firstModelSurface + i;
		if( surf->flags & trace_umask ) {
			continue;
		}
		if( !R_SurfPotentiallyFragmented( surf ) ) {
			continue;
		}

		if( R_TraceAgainstSurface( surf ) ) {
			trace_surface = surf;   // impact point
		}
	}

	return 0;
}