Package net.mtrop.doom.bsp
Class BSPTree
java.lang.Object
net.mtrop.doom.bsp.BSPTree
BSP Tree Abstraction.
- Author:
- Matthew Tropiano
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a node to this map.void
addSegment
(BSPSegment segment) Adds a segment to this map.void
addSubsector
(BSPSubsector subsector) Adds a subsector to this map.getNode
(int i) Gets the node at a specific index.int
getNodes()
getSegment
(int i) Gets the segment at a specific index.int
getSubsector
(int i) Gets the subsector at a specific index.int
void
Replaces the list of nodes in the map.void
setSegments
(Iterable<BSPSegment> segments) Replaces the list of segments in the map.void
setSubsectors
(Iterable<BSPSubsector> subsectors) Replaces the list of subsectors in the map.
-
Constructor Details
-
BSPTree
public BSPTree()
-
-
Method Details
-
getSegments
- Returns:
- the underlying list of segments.
-
setSegments
Replaces the list of segments in the map. Input objects are copied to the underlying list.- Parameters:
segments
- the new list of segments.
-
addSegment
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
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
- Returns:
- the underlying list of subsectors.
-
setSubsectors
Replaces the list of subsectors in the map. Input objects are copied to the underlying list.- Parameters:
subsectors
- the new list of subsectors.
-
addSubsector
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
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
- Returns:
- the underlying list of nodes.
-
setNodes
Replaces the list of nodes in the map. Input objects are copied to the underlying list.- Parameters:
nodes
- the new list of nodes.
-
addNode
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
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.
-