예제 #1
0
파일: portals.c 프로젝트: AEonZR/GtkRadiant
/*
==================
MakeTreePortals_r
==================
*/
void MakeTreePortals_r (node_t *node)
{
    int		i;

    CalcNodeBounds (node);
    if (node->mins[0] >= node->maxs[0])
    {
        Sys_Printf ("WARNING: node without a volume\n");
        Sys_Printf("node has %d tiny portals\n", node->tinyportals);
        Sys_Printf("node reference point %1.2f %1.2f %1.2f\n", node->referencepoint[0],
                   node->referencepoint[1],
                   node->referencepoint[2]);
    }

    for (i=0 ; i<3 ; i++)
    {
        if (node->mins[i] < MIN_WORLD_COORD || node->maxs[i] > MAX_WORLD_COORD)
        {
            if(node->portals && node->portals->winding)
                xml_Winding("WARNING: Node With Unbounded Volume", node->portals->winding->p, node->portals->winding->numpoints, qfalse);

            break;
        }
    }
    if (node->planenum == PLANENUM_LEAF)
        return;

    MakeNodePortal (node);
    SplitNodePortals (node);

    MakeTreePortals_r (node->children[0]);
    MakeTreePortals_r (node->children[1]);
}
예제 #2
0
/*
==================
MakeTreePortals_r
==================
*/
void MakeTreePortals_r( node_t *node )
{
	int		i;
	
	CalcNodeBounds( node );
	
	if( node->bounds[0][0] >= node->bounds[1][0] )
	{
		common->DWarning( "node without a volume" );
	}
	
	for( i = 0; i < 3; i++ )
	{
		if( node->bounds[0][i] < MIN_WORLD_COORD || node->bounds[1][i] > MAX_WORLD_COORD )
		{
			common->DWarning( "node with unbounded volume" );
			break;
		}
	}
	
	if( node->planenum == PLANENUM_LEAF )
	{
		return;
	}
	
	MakeNodePortal( node );
	SplitNodePortals( node );
	
	MakeTreePortals_r( node->children[0] );
	MakeTreePortals_r( node->children[1] );
}
예제 #3
0
void MakeTreePortals_r( node_t *node ) {
	int i;

#ifdef ME
	qprintf( "\r%6d", ++c_numportalizednodes );
	if ( cancelconversion ) {
		return;
	}
#endif //ME

	CalcNodeBounds( node );
	if ( node->mins[0] >= node->maxs[0] ) {
		Log_Print( "WARNING: node without a volume\n" );
	}

	for ( i = 0 ; i < 3 ; i++ )
	{
		if ( node->mins[i] < -MAX_MAP_BOUNDS || node->maxs[i] > MAX_MAP_BOUNDS ) {
			Log_Print( "WARNING: node with unbounded volume\n" );
			break;
		}
	}
	if ( node->planenum == PLANENUM_LEAF ) {
		return;
	}

	MakeNodePortal( node );
	SplitNodePortals( node );

	MakeTreePortals_r( node->children[0] );
	MakeTreePortals_r( node->children[1] );
} //end of the function MakeTreePortals_r
예제 #4
0
/*
==================
MakeTreePortals_r
==================
*/
void MakeTreePortals_r (node_t *node)
{
	int		i;

	CalcNodeBounds (node);
	if (node->mins[0] >= node->maxs[0])
	{
		printf ("WARNING: node without a volume\n");
	}

	for (i=0 ; i<3 ; i++)
	{
		if (node->mins[i] < -8000 || node->maxs[i] > 8000)
		{
			printf ("WARNING: node with unbounded volume\n");
			break;
		}
	}
	if (node->planenum == PLANENUM_LEAF)
		return;

	MakeNodePortal (node);
	SplitNodePortals (node);

	MakeTreePortals_r (node->children[0]);
	MakeTreePortals_r (node->children[1]);
}
예제 #5
0
/*
   ================
   FinishVisPortals_r
   ================
 */
void FinishVisPortals2_r( node_t *node ){
	if ( node->planenum == PLANENUM_LEAF ) {
		return;
	}

	MakeNodePortal( node );
	SplitNodePortals( node );

	FinishVisPortals2_r( node->children[0] );
	FinishVisPortals2_r( node->children[1] );
}
예제 #6
0
/*
 * @brief
 */
static void CreateVisPortals_r(node_t * node) {
    // stop as soon as we get to a detail_seperator, which
    // means that everything below is in a single cluster
    if (node->plane_num == PLANENUM_LEAF || node->detail_seperator)
        return;

    MakeNodePortal(node);
    SplitNodePortals(node);

    CreateVisPortals_r(node->children[0]);
    CreateVisPortals_r(node->children[1]);
}
예제 #7
0
/*
==================
BuildBspTree_r
==================
*/
void BuildBspTree_r (node_t *node)
{
	surface_t		*split;
	qboolean		midsplit;
	surface_t		*allsurfs;

	midsplit = CalcNodeBounds (node);

	DrawSurfaces (node->surfaces);

	split = SelectPartition (node->surfaces, node, midsplit);
	if (!split)
	{	// this is a leaf node
		node->planenum = PLANENUM_LEAF;
		LinkLeafFaces (node->surfaces, node);
		return;
	}

	//
	// these are final polygons
	//
	split->onnode = node;	// can't use again
	allsurfs = node->surfaces;
	node->planenum = split->planenum;
	node->faces = NULL;
	CopyFacesToNode (node, split);
	c_splitnodes++;

	node->children[0] = AllocNode ();
	node->children[1] = AllocNode ();

	//
	// split all the polysurfaces into front and back lists
	//
	SplitNodeSurfaces (allsurfs, node);

	//
	// create the portal that seperates the two children
	//
	MakeNodePortal (node);
	
	//
	// carve the portals on the boundaries of the node
	//
	SplitNodePortals (node);

	//
	// recursively do the children
	//
	BuildBspTree_r (node->children[0]);
	BuildBspTree_r (node->children[1]);
}
예제 #8
0
/*
==================
MakeTreePortals_r
==================
*/
void MakeTreePortals_r (node_t *node)
{
	int		i;

	CalcNodeBounds (node);
	if (node->mins[0] >= node->maxs[0])
	{
		Warning("WARNING: node without a volume\n");
	}

	for (i=0 ; i<3 ; i++)
	{
		if (node->mins[i] < (MIN_COORD_INTEGER-SIDESPACE) || node->maxs[i] > (MAX_COORD_INTEGER+SIDESPACE))
		{
			const char *pMatName = "<NO BRUSH>";
			// split by brush side
			if ( node->side )
			{
				texinfo_t *pTexInfo = &texinfo[node->side->texinfo];
				dtexdata_t *pTexData = GetTexData( pTexInfo->texdata );
				pMatName = TexDataStringTable_GetString( pTexData->nameStringTableID );
			}
			Vector point = node->portals->winding->p[0];
			Warning("WARNING: BSP node with unbounded volume (material: %s, near %s)\n", pMatName, VecToString(point) );
			break;
		}
	}
	if (node->planenum == PLANENUM_LEAF)
		return;

	MakeNodePortal (node);
	SplitNodePortals (node);

	MakeTreePortals_r (node->children[0]);
	MakeTreePortals_r (node->children[1]);
}
예제 #9
0
파일: portals.c 프로젝트: kevlund/ufoai
static void MakeTreePortals_r (node_t *node)
{
	int i;

	CalcNodeBounds(node);
	if (node->mins[0] >= node->maxs[0]) {
		Com_Printf("WARNING: node without a volume\n");
	}

	for (i = 0; i < 3; i++) {
		if (node->mins[i] < -MAX_WORLD_WIDTH || node->maxs[i] > MAX_WORLD_WIDTH) {
			Com_Printf("WARNING: node with unbounded volume %i\n", (int)node->mins[i]);
			break;
		}
	}
	if (node->planenum == PLANENUM_LEAF)
		return;

	MakeNodePortal(node);
	SplitNodePortals(node);

	MakeTreePortals_r(node->children[0]);
	MakeTreePortals_r(node->children[1]);
}