Rewrite VisualBlockMap to use a quad tree

This commit is contained in:
Magnus Norddahl 2019-12-26 00:39:15 +01:00 committed by spherallic
parent 12ea1aa313
commit b0b1693a62
6 changed files with 306 additions and 445 deletions

View file

@ -3945,14 +3945,7 @@ namespace CodeImp.DoomBuilder.Map
/// <summary>This returns a sector if given coordinates are inside one.</summary> /// <summary>This returns a sector if given coordinates are inside one.</summary>
public Sector GetSectorByCoordinates(Vector2D pos, VisualBlockMap blockmap) public Sector GetSectorByCoordinates(Vector2D pos, VisualBlockMap blockmap)
{ {
// Find nearest sectors using the blockmap return blockmap.GetSectorAt(pos);
List<Sector> possiblesectors = blockmap.GetBlock(blockmap.GetBlockCoordinates(pos)).Sectors;
foreach(Sector s in possiblesectors)
{
if(s.Intersect(pos)) return s;
}
return null;
} }
//mxd //mxd

View file

@ -294,19 +294,7 @@ namespace CodeImp.DoomBuilder.Map
// This determines which sector the thing is in and links it // This determines which sector the thing is in and links it
public void DetermineSector(VisualBlockMap blockmap) public void DetermineSector(VisualBlockMap blockmap)
{ {
// Find nearest sectors using the blockmap sector = blockmap.GetSectorAt(pos);
List<Sector> possiblesectors = blockmap.GetBlock(blockmap.GetBlockCoordinates(pos)).Sectors;
// Check in which sector we are
sector = null;
foreach(Sector s in possiblesectors)
{
if(s.Intersect(pos))
{
sector = s;
break;
}
}
} }
// This determines which sector the thing is in by looking at the BSP tree and links it // This determines which sector the thing is in by looking at the BSP tree and links it

View file

@ -25,33 +25,15 @@ namespace CodeImp.DoomBuilder.VisualModes
{ {
public sealed class VisualBlockEntry public sealed class VisualBlockEntry
{ {
#region ================== Variables public List<Linedef> Lines { get; set; }
public List<Thing> Things { get; set; }
public List<Sector> Sectors { get; set; }
// Members
private List<Linedef> lines;
private List<Thing> things;
private List<Sector> sectors;
#endregion
#region ================== Properties
public List<Linedef> Lines { get { return lines; } }
public List<Thing> Things { get { return things; } }
public List<Sector> Sectors { get { return sectors; } }
#endregion
#region ================== Constructor
// Constructor for empty block
internal VisualBlockEntry() internal VisualBlockEntry()
{ {
lines = new List<Linedef>(2); Lines = new List<Linedef>(2);
things = new List<Thing>(2); Things = new List<Thing>(2);
sectors = new List<Sector>(2); Sectors = new List<Sector>(2);
} }
#endregion
} }
} }

View file

@ -21,402 +21,303 @@ using System.Collections.Generic;
using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Geometry;
using System.Drawing; using System.Drawing;
using System.Diagnostics;
using System.Linq;
#endregion #endregion
namespace CodeImp.DoomBuilder.VisualModes namespace CodeImp.DoomBuilder.VisualModes
{ {
public sealed class VisualBlockMap public sealed class VisualBlockMap
{ {
#region ================== Constants
public const int BLOCK_SIZE_SHIFT = 7;
public const int BLOCK_SIZE = 1 << BLOCK_SIZE_SHIFT;
public const float BLOCK_RADIUS = BLOCK_SIZE * Angle2D.SQRT2;
#endregion
#region ================== Variables
// Blocks
private Dictionary<ulong, VisualBlockEntry> blockmap;
// State
private bool isdisposed;
#endregion
#region ================== Properties
public bool IsDisposed { get { return isdisposed; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
internal VisualBlockMap()
{
// Initialize
blockmap = new Dictionary<ulong,VisualBlockEntry>();
}
// Disposer
internal void Dispose()
{
// Not already disposed?
if(!isdisposed)
{
// Clean up
blockmap = null;
// Done
isdisposed = true;
}
}
#endregion
#region ================== Methods
// This returns the block coordinates
public Point GetBlockCoordinates(Vector2D v)
{
return new Point((int)v.x >> BLOCK_SIZE_SHIFT,
(int)v.y >> BLOCK_SIZE_SHIFT);
}
// This returns the block center in world coordinates
public Vector2D GetBlockCenter(Point p)
{
return new Vector2D((p.X << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1),
(p.Y << BLOCK_SIZE_SHIFT) + (BLOCK_SIZE >> 1));
}
// This returns the key for a block at the given coordinates
// TODO: Could we just use the Point struct as key?
private static ulong GetBlockKey(Point p)
{
return unchecked( ((ulong)(uint)p.X << 32) + (uint)p.Y );
}
// This returns the block with the given coordinates
// Creates the block if it doesn't exist yet
public VisualBlockEntry GetBlock(Point p)
{
ulong k = GetBlockKey(p);
if(blockmap.ContainsKey(k))
{
return blockmap[k];
}
else
{
return (blockmap[k] = new VisualBlockEntry());
}
}
// This clears the blockmap
public void Clear()
{
blockmap = new Dictionary<ulong,VisualBlockEntry>();
}
// This returns a range of blocks in a square
public List<VisualBlockEntry> GetSquareRange(RectangleF rect)
{
// Calculate block coordinates
Point lt = GetBlockCoordinates(new Vector2D(rect.Left, rect.Top));
Point rb = GetBlockCoordinates(new Vector2D(rect.Right, rect.Bottom));
// Go through the range to make a list
int entriescount = (rb.X - lt.X) * (rb.Y - lt.Y);
List<VisualBlockEntry> entries = new List<VisualBlockEntry>(entriescount);
for(int x = lt.X; x <= rb.X; x++)
{
for(int y = lt.Y; y <= rb.Y; y++)
{
entries.Add(GetBlock(new Point(x, y)));
}
}
// Return list
return entries;
}
// This returns a range of blocks in a frustum
public List<VisualBlockEntry> GetFrustumRange(ProjectedFrustum2D frustum)
{
// Make square range from frustum circle
// This will be the range in which we will test blocks
Point lt = GetBlockCoordinates(frustum.Center - frustum.Radius);
Point rb = GetBlockCoordinates(frustum.Center + frustum.Radius);
// Constants we need
float blockfrustumdistance2 = (frustum.Radius * frustum.Radius) + (BLOCK_RADIUS * BLOCK_RADIUS);
// Go through the range to make a list
int entriescount = (rb.X - lt.X) * (rb.Y - lt.Y);
List<VisualBlockEntry> entries = new List<VisualBlockEntry>(entriescount);
for(int x = lt.X; x <= rb.X; x++)
{
for(int y = lt.Y; y <= rb.Y; y++)
{
// First check if the block circle is intersecting the frustum circle
Point block = new Point(x, y);
Vector2D blockcenter = GetBlockCenter(block);
if(Vector2D.DistanceSq(frustum.Center, blockcenter) < blockfrustumdistance2)
{
// Add the block if the block circle is inside the frustum
if(frustum.IntersectCircle(blockcenter, BLOCK_RADIUS)) entries.Add(GetBlock(block));
}
}
}
// Return list
return entries;
}
// This returns all blocks along the given line // This returns all blocks along the given line
public List<VisualBlockEntry> GetLineBlocks(Vector2D v1, Vector2D v2) public List<VisualBlockEntry> GetLineBlocks(Vector2D v1, Vector2D v2)
{ {
// Estimate number of blocks we will go through and create list int x0 = (int)Math.Floor(Math.Min(v1.x, v2.x));
int entriescount = (int)(Vector2D.ManhattanDistance(v1, v2) * 2.0f) / BLOCK_SIZE; int y0 = (int)Math.Floor(Math.Min(v1.y, v2.y));
List<VisualBlockEntry> entries = new List<VisualBlockEntry>(entriescount); int x1 = (int)Math.Floor(Math.Max(v1.x, v2.x)) + 1;
int y1 = (int)Math.Floor(Math.Max(v1.y, v2.y)) + 1;
// Find start and end block var result = new List<VisualBlockEntry>();
Point pos = GetBlockCoordinates(v1); root.GetBlocks(new Rectangle(x0, y0, x1 - x0, y1 - y0), ref result);
Point end = GetBlockCoordinates(v2); return result;
}
// Add this block public List<VisualBlockEntry> GetBlocks(RectangleF box)
entries.Add(GetBlock(pos)); {
var result = new List<VisualBlockEntry>();
root.GetBlocks(ToRectangle(box), ref result);
return result;
}
// Moving outside the block? public List<VisualBlockEntry> GetBlocks(Vector2D pos)
if(pos != end) {
{ var result = new List<VisualBlockEntry>();
// Calculate current block edges root.GetBlocks(new Point((int)Math.Floor(pos.x), (int)Math.Floor(pos.y)), ref result);
float cl = pos.X * BLOCK_SIZE; return result;
float cr = (pos.X + 1) * BLOCK_SIZE; }
float ct = pos.Y * BLOCK_SIZE;
float cb = (pos.Y + 1) * BLOCK_SIZE;
// Line directions // This returns a range of blocks in a frustum
int dirx = Math.Sign(v2.x - v1.x); public List<VisualBlockEntry> GetFrustumRange(ProjectedFrustum2D frustum2D)
int diry = Math.Sign(v2.y - v1.y); {
var frustum = new Frustum();
frustum.planes = new Plane[4]
{
new Plane(frustum2D.Lines[0]),
new Plane(frustum2D.Lines[1]),
new Plane(frustum2D.Lines[2]),
new Plane(frustum2D.Lines[3])
};
// Calculate offset and delta movement over x var result = new List<VisualBlockEntry>();
float posx, deltax; root.GetBlocks(frustum, ref result);
if(dirx >= 0) return result;
{ }
posx = (cr - v1.x) / (v2.x - v1.x);
deltax = BLOCK_SIZE / (v2.x - v1.x);
}
else
{
// Calculate offset and delta movement over x
posx = (v1.x - cl) / (v1.x - v2.x);
deltax = BLOCK_SIZE / (v1.x - v2.x);
}
// Calculate offset and delta movement over y public Sector GetSectorAt(Vector2D pos)
float posy, deltay; {
if(diry >= 0) foreach (VisualBlockEntry e in GetBlocks(pos))
{ {
posy = (cb - v1.y) / (v2.y - v1.y); foreach (Sector s in e.Sectors)
deltay = BLOCK_SIZE / (v2.y - v1.y); {
} if (s.Intersect(pos))
else {
{ return s;
posy = (v1.y - ct) / (v1.y - v2.y); }
deltay = BLOCK_SIZE / (v1.y - v2.y); }
} }
return null;
}
// Continue while not reached the end public void Clear()
while(pos != end) {
{ root = new Node(new Rectangle(MapMinX, MapMinY, MapMaxX - MapMinX, MapMaxY - MapMinY));
// Check in which direction to move }
if(posx < posy)
{
// Move horizontally
posx += deltax;
if(pos.X != end.X) pos.X += dirx;
}
else
{
// Move vertically
posy += deltay;
if(pos.Y != end.Y) pos.Y += diry;
}
// Add lines to this block
entries.Add(GetBlock(pos));
}
}
// Return list
return entries;
}
// This puts a thing in the blockmap
public void AddThingsSet(ICollection<Thing> things)
{
foreach(Thing t in things) AddThing(t);
}
// This puts a thing in the blockmap
public void AddThing(Thing t)
{
//mxd
Point p1 = GetBlockCoordinates(new Vector2D(t.Position.x - t.Size, t.Position.y - t.Size));
Point p2 = GetBlockCoordinates(new Vector2D(t.Position.x + t.Size, t.Position.y + t.Size));
for(int x = p1.X; x <= p2.X; x++)
{
for(int y = p1.Y; y <= p2.Y; y++)
{
VisualBlockEntry block = GetBlock(new Point(x, y));
block.Things.Add(t);
}
}
}
// This puts a secotr in the blockmap
public void AddSectorsSet(ICollection<Sector> sectors) public void AddSectorsSet(ICollection<Sector> sectors)
{ {
foreach(Sector s in sectors) AddSector(s); foreach (Sector s in sectors) AddSector(s);
} }
// This puts a sector in the blockmap public void AddLinedefsSet(ICollection<Linedef> lines)
public void AddSector(Sector s) {
foreach (Linedef line in lines) AddLinedef(line);
}
public void AddThingsSet(ICollection<Thing> things)
{
foreach (Thing t in things) AddThing(t);
}
public void AddSector(Sector sector)
{
root.GetEntry(ToRectangle(sector.BBox)).Sectors.Add(sector);
}
public void AddLinedef(Linedef line)
{
int x0 = (int)Math.Floor(Math.Min(line.Start.Position.x, line.End.Position.x));
int y0 = (int)Math.Floor(Math.Min(line.Start.Position.y, line.End.Position.y));
int x1 = (int)Math.Floor(Math.Max(line.Start.Position.x, line.End.Position.x)) + 1;
int y1 = (int)Math.Floor(Math.Max(line.Start.Position.y, line.End.Position.y)) + 1;
root.GetEntry(new Rectangle(x0, y0, x1 - x0, y1 - y0)).Lines.Add(line);
}
public void AddThing(Thing thing)
{
int x0 = (int)Math.Floor(thing.Position.x - thing.Size);
int x1 = (int)Math.Floor(thing.Position.x + thing.Size) + 1;
int y0 = (int)Math.Floor(thing.Position.y - thing.Size);
int y1 = (int)Math.Floor(thing.Position.y + thing.Size) + 1;
root.GetEntry(new Rectangle(x0, y0, x1 - x0, y1 - y0)).Things.Add(thing);
}
internal void Dispose()
{ {
Point p1 = GetBlockCoordinates(new Vector2D(s.BBox.Left, s.BBox.Top)); Clear();
Point p2 = GetBlockCoordinates(new Vector2D(s.BBox.Right, s.BBox.Bottom));
for(int x = p1.X; x <= p2.X; x++)
{
for(int y = p1.Y; y <= p2.Y; y++)
{
VisualBlockEntry block = GetBlock(new Point(x, y));
block.Sectors.Add(s);
}
}
} }
// This puts a whole set of linedefs in the blocks they cross static Rectangle ToRectangle(RectangleF bbox)
public void AddLinedefsSet(ICollection<Linedef> lines) {
{ int x0 = (int)Math.Floor(bbox.Left);
foreach(Linedef l in lines) AddLinedef(l); int y0 = (int)Math.Floor(bbox.Top);
} int x1 = (int)Math.Floor(bbox.Right) + 1;
int y1 = (int)Math.Floor(bbox.Bottom) + 1;
// This puts a single linedef in all blocks it crosses return new Rectangle(x0, y0, x1 - x0, y1 - y0);
public void AddLinedef(Linedef line) }
{
// Get coordinates const int MapMinX = -32768;
Vector2D v1 = line.Start.Position; const int MapMinY = -32768;
Vector2D v2 = line.End.Position; const int MapMaxX = 32768;
const int MapMaxY = 32768;
// Find start and end block const int MaxLevels = 8;
Point pos = GetBlockCoordinates(v1);
Point end = GetBlockCoordinates(v2); Node root = new Node(new Rectangle(MapMinX, MapMinY, MapMaxX - MapMinX, MapMaxY - MapMinY));
// Horizontal straight line? struct Plane
if(pos.Y == end.Y) {
{ public Plane(Line2D line)
// Simple loop {
int dirx = Math.Sign(v2.x - v1.x); Vector2D dir = line.v2 - line.v1;
for(int x = pos.X; x != end.X; x += dirx) A = -dir.y;
{ B = dir.x;
GetBlock(new Point(x, pos.Y)).Lines.Add(line); D = -(line.v1.x * A + line.v1.y * B);
} }
GetBlock(end).Lines.Add(line);
} public float A, B, D;
// Vertical straight line? }
else if(pos.X == end.X)
{ class Frustum
// Simple loop {
int diry = Math.Sign(v2.y - v1.y); public Plane[] planes;
for(int y = pos.Y; y != end.Y; y += diry) }
{
GetBlock(new Point(pos.X, y)).Lines.Add(line); class Node
} {
GetBlock(end).Lines.Add(line); enum Visibility { Inside, Intersecting, Outside };
}
else public Node(Rectangle bbox)
{ {
// Add lines to this block this.bbox = bbox;
GetBlock(pos).Lines.Add(line); extents = new Vector2D(bbox.Width * 0.5f, bbox.Height * 0.5f);
center = new Vector2D(bbox.X + extents.x, bbox.Y + extents.y);
// Moving outside the block? }
if(pos != end)
{ public void GetBlocks(Frustum frustum, ref List<VisualBlockEntry> list)
// Calculate current block edges {
float cl = pos.X * BLOCK_SIZE; Visibility vis = TestVisibility(frustum);
float cr = (pos.X + 1) * BLOCK_SIZE; if (vis == Visibility.Inside)
float ct = pos.Y * BLOCK_SIZE; {
float cb = (pos.Y + 1) * BLOCK_SIZE; GetAllBlocks(ref list);
}
// Line directions else if (vis == Visibility.Intersecting)
int dirx = Math.Sign(v2.x - v1.x); {
int diry = Math.Sign(v2.y - v1.y); if (visualBlock != null)
list.Add(visualBlock);
// Calculate offset and delta movement over x
float posx, deltax; if (topLeft != null)
if(dirx == 0) {
{ topLeft.GetBlocks(frustum, ref list);
posx = float.MaxValue; topRight.GetBlocks(frustum, ref list);
deltax = float.MaxValue; bottomLeft.GetBlocks(frustum, ref list);
} bottomRight.GetBlocks(frustum, ref list);
else if(dirx > 0) }
{ }
posx = (cr - v1.x) / (v2.x - v1.x); }
deltax = BLOCK_SIZE / (v2.x - v1.x);
} void GetAllBlocks(ref List<VisualBlockEntry> list)
else {
{ if (visualBlock != null)
// Calculate offset and delta movement over x list.Add(visualBlock);
posx = (v1.x - cl) / (v1.x - v2.x);
deltax = BLOCK_SIZE / (v1.x - v2.x); if (topLeft != null)
} {
topLeft.GetAllBlocks(ref list);
// Calculate offset and delta movement over y topRight.GetAllBlocks(ref list);
float posy, deltay; bottomLeft.GetAllBlocks(ref list);
if(diry == 0) bottomRight.GetAllBlocks(ref list);
{ }
posy = float.MaxValue; }
deltay = float.MaxValue;
} Visibility TestVisibility(Frustum frustum)
else if(diry > 0) {
{ Visibility result = Visibility.Inside;
posy = (cb - v1.y) / (v2.y - v1.y); for (int i = 0; i < 4; i++)
deltay = BLOCK_SIZE / (v2.y - v1.y); {
} Visibility vis = TestFrustumLineVisibility(frustum.planes[i]);
else if (vis == Visibility.Outside)
{ return Visibility.Outside;
posy = (v1.y - ct) / (v1.y - v2.y); else if (vis == Visibility.Intersecting)
deltay = BLOCK_SIZE / (v1.y - v2.y); result = Visibility.Intersecting;
} }
return result;
// Continue while not reached the end }
while(pos != end)
{ Visibility TestFrustumLineVisibility(Plane plane)
// Check in which direction to move {
if(posx < posy) float e = extents.x * Math.Abs(plane.A) + extents.y * Math.Abs(plane.B);
{ float s = center.x * plane.A + center.y * plane.B + plane.D;
// Move horizontally if (s - e > 0.0)
posx += deltax; return Visibility.Inside;
if(pos.X != end.X) pos.X += dirx; else if (s + e < 0)
} return Visibility.Outside;
else else
{ return Visibility.Intersecting;
// Move vertically }
posy += deltay;
if(pos.Y != end.Y) pos.Y += diry; public void GetBlocks(Point pos, ref List<VisualBlockEntry> list)
} {
if (visualBlock != null)
// Add lines to this block list.Add(visualBlock);
GetBlock(pos).Lines.Add(line);
} if (topLeft != null)
} {
} if (topLeft.bbox.Contains(pos)) topLeft.GetBlocks(pos, ref list);
} if (topRight.bbox.Contains(pos)) topRight.GetBlocks(pos, ref list);
if (bottomLeft.bbox.Contains(pos)) bottomLeft.GetBlocks(pos, ref list);
#endregion if (bottomRight.bbox.Contains(pos)) bottomRight.GetBlocks(pos, ref list);
} }
}
public void GetBlocks(Rectangle box, ref List<VisualBlockEntry> list)
{
if (visualBlock != null)
list.Add(visualBlock);
if (topLeft != null)
{
if (topLeft.bbox.IntersectsWith(box)) topLeft.GetBlocks(box, ref list);
if (topRight.bbox.IntersectsWith(box)) topRight.GetBlocks(box, ref list);
if (bottomLeft.bbox.IntersectsWith(box)) bottomLeft.GetBlocks(box, ref list);
if (bottomRight.bbox.IntersectsWith(box)) bottomRight.GetBlocks(box, ref list);
}
}
public VisualBlockEntry GetEntry(Rectangle box, int level = 0)
{
if (level == MaxLevels)
{
if (visualBlock == null)
visualBlock = new VisualBlockEntry();
return visualBlock;
}
if (topLeft == null)
CreateChildren();
if (topLeft.bbox.Contains(box)) return topLeft.GetEntry(box, level + 1);
if (topRight.bbox.Contains(box)) return topRight.GetEntry(box, level + 1);
if (bottomLeft.bbox.Contains(box)) return bottomLeft.GetEntry(box, level + 1);
if (bottomRight.bbox.Contains(box)) return bottomRight.GetEntry(box, level + 1);
if (visualBlock == null)
visualBlock = new VisualBlockEntry();
return visualBlock;
}
void CreateChildren()
{
int x0 = bbox.X;
int x1 = bbox.X + bbox.Width / 2;
int x2 = bbox.X + bbox.Width;
int y0 = bbox.Y;
int y1 = bbox.Y + bbox.Height / 2;
int y2 = bbox.Y + bbox.Height;
topLeft = new Node(new Rectangle(x0, y0, x1 - x0, y1 - y0));
topRight = new Node(new Rectangle(x1, y0, x2 - x1, y1 - y0));
bottomLeft = new Node(new Rectangle(x0, y1, x1 - x0, y2 - y1));
bottomRight = new Node(new Rectangle(x1, y1, x2 - x1, y2 - y1));
}
Rectangle bbox;
Vector2D extents;
Vector2D center;
Node topLeft;
Node topRight;
Node bottomLeft;
Node bottomRight;
VisualBlockEntry visualBlock;
}
}
} }

View file

@ -600,15 +600,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Get nearby things // Get nearby things
List<Thing> neighbours = new List<Thing>(); List<Thing> neighbours = new List<Thing>();
RectangleF bbox = new RectangleF(thing.Position.x - thing.Size, thing.Position.y - thing.Size, thing.Size * 2, thing.Size * 2); RectangleF bbox = new RectangleF(thing.Position.x - thing.Size, thing.Position.y - thing.Size, thing.Size * 2, thing.Size * 2);
Point p1 = mode.BlockMap.GetBlockCoordinates(new Vector2D(bbox.Left, bbox.Top)); foreach (var block in mode.BlockMap.GetBlocks(bbox))
Point p2 = mode.BlockMap.GetBlockCoordinates(new Vector2D(bbox.Right, bbox.Bottom)); {
for(int x = p1.X; x <= p2.X; x++) neighbours.AddRange(block.Things);
{ }
for(int y = p1.Y; y <= p2.Y; y++)
{
neighbours.AddRange(mode.BlockMap.GetBlock(new Point(x, y)).Things);
}
}
// Collect things intersecting with target thing // Collect things intersecting with target thing
List<Thing> intersectingthings = new List<Thing>(); List<Thing> intersectingthings = new List<Thing>();

View file

@ -884,20 +884,22 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
Vertex v = sd.IsFront ? sd.Line.End : sd.Line.Start; Vertex v = sd.IsFront ? sd.Line.End : sd.Line.Start;
// Check if a thing is at this vertex // Check if a thing is at this vertex
VisualBlockEntry b = blockmap.GetBlock(blockmap.GetBlockCoordinates(v.Position)); foreach (VisualBlockEntry block in blockmap.GetBlocks(v.Position))
foreach (Thing t in b.Things) {
{ foreach (Thing t in block.Things)
if ((Vector2D)t.Position == v.Position) {
{ if ((Vector2D)t.Position == v.Position)
switch (t.Type) {
{ switch (t.Type)
case 1504: slopefloorthings.Add(t); break; {
case 1505: slopeceilingthings.Add(t); break; case 1504: slopefloorthings.Add(t); break;
} case 1505: slopeceilingthings.Add(t); break;
} }
} }
} }
}
}
// Slope any floor vertices? // Slope any floor vertices?
if (slopefloorthings.Count > 0) if (slopefloorthings.Count > 0)