|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcs2110.collision.BlockTree
public class BlockTree
An instance is a non-empty collection of points organized in a hierarchical binary tree structure.
Constructor Summary | |
---|---|
BlockTree(java.util.ArrayList<Block> blocks)
Constructor: a binary tree containing blocks. |
Method Summary | |
---|---|
boolean |
contains(Vector2D p)
Return true iff this collection of blocks contains point p. |
BoundingBox |
getBox()
Return the bounding box of the collection of blocks. |
int |
getNumBlocks()
Return the number of blocks contained in this tree. |
boolean |
isIntermediate()
Return true iff this is an intermediate node. |
boolean |
isLeaf()
Return true iff this is a leaf node. |
boolean |
overlaps(Vector2D thisD,
BlockTree t,
Vector2D d)
Return true iff (this tree displaced by thisD) and (tree t displaced by d) overlap. |
java.lang.String |
toString()
Return a representation of this instance. |
java.lang.String |
toString(Vector2D d)
Return a represenation of d |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BlockTree(java.util.ArrayList<Block> blocks)
Method Detail |
---|
public BoundingBox getBox()
public boolean isLeaf()
public boolean isIntermediate()
public int getNumBlocks()
public boolean contains(Vector2D p)
public boolean overlaps(Vector2D thisD, BlockTree t, Vector2D d)
thisD
- Displacement of this tree.t
- A tree of blocks.d
- Displacement of tree t.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Vector2D d)
d
- Displacement vector.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |