|
|||||||||
| 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.SimpleSpace
public class SimpleSpace
A very elemental Space, it does not perform any sorting of the Geoms. It's very useful, if you don't have loads of Geoms, because it keeps the constant factor at a minimum. Simple space tests every pair of memeber geoms for a collision once. So it is of order n squared, where n is the number of geoms within the space At present the bounding box of the space is + and - infinity, though this should change to represents the geoms inside the space so that simple spaces can be nested effeciently
| Field Summary |
|---|
| 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 | |
|---|---|
SimpleSpace(Space parent)
Creates a new SimpleSpace |
|
| 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. |
SimpleSpace |
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 |
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 |
boolean |
isEmpty()
tests, if this is Space is empty |
void |
remove(Geom g)
removes the Geom from this Space. |
| Methods inherited from class net.java.dev.joode.space.Space |
|---|
addBodyGeoms, addGeomListener, canCollide, clonePartialSpace, collideAABBs, computeAABB, 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 |
| Constructor Detail |
|---|
public SimpleSpace(Space parent)
parent - the parent space going to continue this space - use null for root-Spaces| Method Detail |
|---|
protected 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 remove(Geom g)
Space
remove in class Spaceg - the Geom to removepublic boolean isEmpty()
Space
isEmpty in class Spacepublic void add(Geom g)
Space
add in class Spaceg - the Geom to addpublic void cleanGeoms()
Space
cleanGeoms 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 SimpleSpace 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 | ||||||||