- Don't spend time trying to minimize the number of splitters we consider for mini-BSPs. For

typical polyobjects, this costs more time than it saves.

SVN r2476 (polyobjects)
This commit is contained in:
Randy Heit 2010-07-30 04:09:30 +00:00
parent 1db702fb4a
commit 14c6c53709
3 changed files with 23 additions and 1 deletions

View file

@ -94,7 +94,7 @@ void FNodeBuilder::BuildMini(bool makeGLNodes, bool enableSSE2)
{ {
GLNodes = makeGLNodes; GLNodes = makeGLNodes;
EnableSSE2 = enableSSE2; EnableSSE2 = enableSSE2;
GroupSegPlanes(); GroupSegPlanesSimple();
BuildTree(); BuildTree();
} }

View file

@ -230,6 +230,7 @@ private:
void MakeSegsFromSides (); void MakeSegsFromSides ();
int CreateSeg (int linenum, int sidenum); int CreateSeg (int linenum, int sidenum);
void GroupSegPlanes (); void GroupSegPlanes ();
void GroupSegPlanesSimple ();
void FindPolyContainers (TArray<FPolyStart> &spots, TArray<FPolyStart> &anchors); void FindPolyContainers (TArray<FPolyStart> &spots, TArray<FPolyStart> &anchors);
bool GetPolyExtents (int polynum, fixed_t bbox[4]); bool GetPolyExtents (int polynum, fixed_t bbox[4]);
int MarkLoop (DWORD firstseg, int loopnum); int MarkLoop (DWORD firstseg, int loopnum);

View file

@ -350,6 +350,27 @@ void FNodeBuilder::GroupSegPlanes ()
PlaneChecked.Reserve ((planenum + 7) / 8); PlaneChecked.Reserve ((planenum + 7) / 8);
} }
// Just create one plane per seg. Should be good enough for mini BSPs.
void FNodeBuilder::GroupSegPlanesSimple()
{
Planes.Resize(Segs.Size());
for (int i = 0; i < (int)Segs.Size(); ++i)
{
FPrivSeg *seg = &Segs[i];
FSimpleLine *pline = &Planes[i];
seg->next = i+1;
seg->hashnext = NULL;
seg->planenum = i;
seg->planefront = true;
pline->x = Vertices[seg->v1].x;
pline->y = Vertices[seg->v1].y;
pline->dx = Vertices[seg->v2].x - Vertices[seg->v1].x;
pline->dy = Vertices[seg->v2].y - Vertices[seg->v1].y;
}
Segs.Last().next = DWORD_MAX;
PlaneChecked.Reserve((Segs.Size() + 7) / 8);
}
// Find "loops" of segs surrounding polyobject's origin. Note that a polyobject's origin // Find "loops" of segs surrounding polyobject's origin. Note that a polyobject's origin
// is not solely defined by the polyobject's anchor, but also by the polyobject itself. // is not solely defined by the polyobject's anchor, but also by the polyobject itself.
// For the split avoidance to work properly, you must have a convex, complete loop of // For the split avoidance to work properly, you must have a convex, complete loop of