Class BSPTree

java.lang.Object
net.mtrop.doom.bsp.BSPTree

public class BSPTree extends Object
BSP Tree Abstraction.
Author:
Matthew Tropiano
  • Constructor Details

    • BSPTree

      public BSPTree()
  • Method Details

    • getSegments

      public List<BSPSegment> getSegments()
      Returns:
      the underlying list of segments.
    • setSegments

      public void setSegments(Iterable<BSPSegment> segments)
      Replaces the list of segments in the map. Input objects are copied to the underlying list.
      Parameters:
      segments - the new list of segments.
    • addSegment

      public void addSegment(BSPSegment segment)
      Adds a segment to this map.
      Parameters:
      segment - the segment to add.
    • getSegmentCount

      public int getSegmentCount()
      Returns:
      the amount of segments in this map.
    • getSegment

      public BSPSegment getSegment(int i)
      Gets the segment at a specific index.
      Parameters:
      i - the desired index.
      Returns:
      the segment at the index, or null if the index is out of range.
    • getSubsectors

      public List<BSPSubsector> getSubsectors()
      Returns:
      the underlying list of subsectors.
    • setSubsectors

      public void setSubsectors(Iterable<BSPSubsector> subsectors)
      Replaces the list of subsectors in the map. Input objects are copied to the underlying list.
      Parameters:
      subsectors - the new list of subsectors.
    • addSubsector

      public void addSubsector(BSPSubsector subsector)
      Adds a subsector to this map.
      Parameters:
      subsector - the subsector to add.
    • getSubsectorCount

      public int getSubsectorCount()
      Returns:
      the amount of subsectors in this map.
    • getSubsector

      public BSPSubsector getSubsector(int i)
      Gets the subsector at a specific index.
      Parameters:
      i - the desired index.
      Returns:
      the subsector at the index, or null if the index is out of range.
    • getNodes

      public List<BSPNode> getNodes()
      Returns:
      the underlying list of nodes.
    • setNodes

      public void setNodes(Iterable<BSPNode> nodes)
      Replaces the list of nodes in the map. Input objects are copied to the underlying list.
      Parameters:
      nodes - the new list of nodes.
    • addNode

      public void addNode(BSPNode node)
      Adds a node to this map.
      Parameters:
      node - the node to add.
    • getNodeCount

      public int getNodeCount()
      Returns:
      the amount of nodes in this map.
    • getNode

      public BSPNode getNode(int i)
      Gets the node at a specific index.
      Parameters:
      i - the desired index.
      Returns:
      the node at the index, or null if the index is out of range.