|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.space.octtree.OctTreeNode
public class OctTreeNode
A inner or leaf node of the Tree. If it, as a leaf-node, gets too much Geoms it automatically splits up and becomes an inner node. If the child nodes contain to less elements it will also collapse back to a leaf node.
| Nested Class Summary | |
|---|---|
static class |
OctTreeNode.SplitType
the direction of the split of the TreeNode. |
| Field Summary | |
|---|---|
protected float[] |
aabb
the boundingbox of the OctTreeNode |
protected java.util.Set<Geom> |
geoms
contains the geoms that would fit either in both sub-trees or if not splitted up, all |
protected OctTreeNode |
left
the child TreeNodes |
protected int |
numGeoms
the number of Geoms in this node |
protected OctTreeNode |
right
the child TreeNodes |
protected float |
splitPos
the position of the split |
protected boolean |
splitted
is this node split up? |
protected OctTreeNode.SplitType |
type
the split direction |
| Constructor Summary | |
|---|---|
OctTreeNode(OctTreeNode.SplitType t,
float[] aabb)
Creates a new OctTreeNode with a specified SplitType and boundingbox |
|
| Method Summary | |
|---|---|
void |
add(Geom g)
adds a Geom to this TreeNode |
SimState |
cloneState(ClonedReferences util)
deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. |
void |
collide(java.lang.Object data,
NearCallback callback)
tests for collisions in this tree |
void |
collide2(java.lang.Object data,
Geom geom,
NearCallback callback)
tests for collisions of geom with elements in this tree |
float[] |
getAABB()
returns the AABB of this node |
void |
getGeoms(java.util.Set<Geom> geoms)
|
int |
getNumGeoms()
the Number of Geoms in this treenode |
java.util.Iterator<Geom> |
iterator()
an iterator over the elments in this tree node |
boolean |
remove(Geom g)
removes a Geom |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected OctTreeNode.SplitType type
protected OctTreeNode right
protected OctTreeNode left
protected float[] aabb
protected java.util.Set<Geom> geoms
protected boolean splitted
protected int numGeoms
protected float splitPos
| Constructor Detail |
|---|
public OctTreeNode(OctTreeNode.SplitType t,
float[] aabb)
t - the SplitTypeaabb - the BoundingBox| Method Detail |
|---|
public int getNumGeoms()
public void getGeoms(java.util.Set<Geom> geoms)
public void add(Geom g)
g - the Geom to addpublic boolean remove(Geom g)
g - the Geom to remove
public java.util.Iterator<Geom> iterator()
public void collide(java.lang.Object data,
NearCallback callback)
data - callback -
public void collide2(java.lang.Object data,
Geom geom,
NearCallback callback)
data - geom - callback - public float[] getAABB()
public SimState cloneState(ClonedReferences util)
SimStatedeep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. The util object ensures that multiple clones of the same object are not performed during a clone operation.
cloneState in interface SimStateutil - instanciate a new one if top level cloning
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||