|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.bsp2D.BSPTree
The BSPTree class represents a 2D Binary Space Partitioned tree of polygons. The BSPTree is built using a BSPTreeBuilder class, and can be travered using BSPTreeTraverser class.
Nested Class Summary | |
static class |
BSPTree.Leaf
A Leaf of the tree. |
static class |
BSPTree.Node
A Node of the tree. |
Constructor Summary | |
BSPTree(BSPTree.Node root)
Creates a new BSPTree with the specified root node. |
Method Summary | |
java.awt.Rectangle |
calcBounds()
Calculates the 2D boundary of all the polygons in this BSP tree. |
void |
createSurfaces(java.util.List lights)
Creates surface textures for every polygon in this tree. |
BSPTree.Leaf |
getBackLeaf(BSPLine partition)
Gets the Leaf in back of the specified partition. |
BSPTree.Node |
getCollinearNode(BSPLine partition)
Gets the Node that is collinear with the specified partition, or null if no such node exists. |
BSPTree.Leaf |
getFrontLeaf(BSPLine partition)
Gets the Leaf in front of the specified partition. |
BSPTree.Leaf |
getLeaf(float x,
float z)
Gets the leaf the x,z coordinates are in. |
BSPTree.Node |
getRoot()
Gets the root node of this tree. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BSPTree(BSPTree.Node root)
Method Detail |
public BSPTree.Node getRoot()
public java.awt.Rectangle calcBounds()
public BSPTree.Leaf getLeaf(float x, float z)
public BSPTree.Node getCollinearNode(BSPLine partition)
public BSPTree.Leaf getFrontLeaf(BSPLine partition)
public BSPTree.Leaf getBackLeaf(BSPLine partition)
public void createSurfaces(java.util.List lights)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |