|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.geom.Geom
net.java.dev.joode.space.Space
net.java.dev.joode.space.OctTreeSpace
public class OctTreeSpace
OctTreeSpace orders the elements in an OctTree (a BSPTree to be precise) This way only Geoms close to eachother get tested for collisions. This means a Speed-Improvement from O(n^2) to O(n log n) in average case.
| Field Summary | |
|---|---|
static java.util.HashSet<Geom> |
tmp
|
| Fields inherited from class net.java.dev.joode.geom.Geom |
|---|
aabb, AABB_MAX_X, AABB_MAX_Y, AABB_MAX_Z, AABB_MIN_X, AABB_MIN_Y, AABB_MIN_Z, body, category_bits, collide_bits, dBoxClass, dCapsuleClass, dCircle, dConvex, dCylinderClass, dFirstSpaceClass, dFirstUserClass, dGeomNumClasses, dGeomTransformClass, dHashSpaceClass, dLastSpaceClass, dLastUserClass, dMaxUserClasses, dOctTreeSpaceClass, dPlaneClass, dQuadTreeSpaceClass, dRayClass, dRectangle, dSimpleSpaceClass, dSphereClass, dTriMeshClass, GEOM_AABB_BAD, GEOM_DIRTY, GEOM_ENABLED, GEOM_PLACEABLE, gflags, lpos, parent_space, pos, R, RAY_BACKFACECULL, RAY_CLOSEST_HIT, RAY_FIRSTCONTACT, tmpq, type |
| Constructor Summary | |
|---|---|
OctTreeSpace(Space parent)
Creates a new OctTreeSpace with parent as it's parent-space |
|
| Method Summary | |
|---|---|
void |
add(Geom g)
adds a Geom to this Space. |
void |
cleanGeoms()
turn all dirty geoms into clean geoms by computing their AABBs and any other space data structures that are required. |
OctTreeSpace |
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 of the Geoms in this Space with each other. |
void |
collide2(java.lang.Object data,
Geom geom,
NearCallback callback)
tests for collisions of a Geom with the Geoms in this Space |
void |
computeAABB()
computes the AABB of this Space. |
protected java.util.Iterator<Geom> |
getGeoms()
returns an Iterator through all GeomS in this Space |
void |
getGeoms(java.util.List<Geom> geoms)
adds all the geoms in this space to the passed in list |
int |
getNumGeoms()
returns the Number of Geoms in this Space |
protected boolean |
isEmpty()
tests, if this is Space is empty |
void |
remove(Geom g)
removes a Geom from this Space. |
| Methods inherited from class net.java.dev.joode.space.Space |
|---|
addBodyGeoms, addGeomListener, canCollide, clonePartialSpace, collideAABBs, dGeomMoved, dSpaceCollide2, notifyGeomAdded, notifyGeomRemoved, query, removeBodyGeoms, removeGeomListener, testAABBs |
| Methods inherited from class net.java.dev.joode.geom.Geom |
|---|
AABBTest, clonePartialGeom, destroy, getAABB, getUserData, isEnabled, recomputeAABB, setBody, setPosition, setQuaternion, setQuaternion, setRotation, setUserData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.HashSet<Geom> tmp
| Constructor Detail |
|---|
public OctTreeSpace(Space parent)
parent - the parent space, use null for root-Spaces| Method Detail |
|---|
protected boolean isEmpty()
Space
isEmpty in class Spaceprotected java.util.Iterator<Geom> getGeoms()
Space
getGeoms in class Spacepublic int getNumGeoms()
Space
getNumGeoms in class Spacepublic void getGeoms(java.util.List<Geom> geoms)
Space
getGeoms in class Spacepublic void cleanGeoms()
Space
cleanGeoms in class Spacepublic void computeAABB()
Space
computeAABB in class Space
public void collide(java.lang.Object data,
NearCallback callback)
Space
collide in class Spacedata - the World of collisioncallback - the callback for the collision
public void collide2(java.lang.Object data,
Geom geom,
NearCallback callback)
Space
collide2 in class Spacedata - the World of collisiongeom - the Geom to collide with this Space.callback - the callback for the collisionpublic void add(Geom g)
Space
add in class Spaceg - the Geom to addpublic void remove(Geom g)
remove in class Spaceg - the Geom to removeSpace.remove(net.java.dev.joode.geom.Geom)public OctTreeSpace 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.
util - instanciate a new one if top level cloning
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||