|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.collision.CollisionManager
public class CollisionManager
A simple, yet extensible, collision manager.
The manager creates Contact joints in the dynamics system (World)
representing collisions that have occured in geometry system (Space)
This simple manager applies a default set of surface parameters to all contacts.
However, before the contacts are added to the world, all listeners are notified of the contact.
The listeners then have the option of vetoing the contact so it does not appear in the dynamics system
or they can alter the properties of the contact itself.
| Field Summary | |
|---|---|
protected Contact[] |
contactBuffer
|
protected JointGroupID |
contactGroup
|
protected JointContact[] |
jointContacts
|
protected int |
numContacts
|
protected SurfaceParameters |
params
|
protected Space |
space
|
protected World |
world
|
| Constructor Summary | |
|---|---|
CollisionManager(World world,
Space space,
SurfaceParameters defaultSurfaceParameters,
boolean ignoreStaticContacts,
int MAX_CONTACTS)
Creates a CollisionManager. |
|
| Method Summary | |
|---|---|
void |
addCollisionListener(CollisionListener l)
Adds a collision listener. |
void |
call(java.lang.Object data,
Geom g1,
Geom g2)
do not call. |
Contact |
getContact(int i)
|
int |
getContactCount()
|
boolean |
ignoreStatic()
tells whether static collisions should be ignored or not |
void |
notifyQuickStep(World w,
float stepSize)
do not call. |
void |
notifyStep(World w,
float stepSize)
do not call. |
void |
removeCollisionListener(CollisionListener l)
Removes a collision listener |
void |
setup(World world,
Space space)
changes the world and space this CollisionManager is listening to |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected World world
protected Space space
protected SurfaceParameters params
protected int numContacts
protected Contact[] contactBuffer
protected JointGroupID contactGroup
protected JointContact[] jointContacts
| Constructor Detail |
|---|
public CollisionManager(World world,
Space space,
SurfaceParameters defaultSurfaceParameters,
boolean ignoreStaticContacts,
int MAX_CONTACTS)
World, so no further configuration is necessary.
world - World contacts should be added tospace - the Space in which collisions are detecteddefaultSurfaceParameters - set of surface parameters contacts are initialized toignoreStaticContacts - whether collisions between static geometries (no bodies) should be allowedMAX_CONTACTS - | Method Detail |
|---|
public void setup(World world,
Space space)
world - space -
public void call(java.lang.Object data,
Geom g1,
Geom g2)
call in interface NearCallbackpublic int getContactCount()
public Contact getContact(int i)
public boolean ignoreStatic()
NearCallback
ignoreStatic in interface NearCallback
public void notifyQuickStep(World w,
float stepSize)
notifyQuickStep in interface WorldStepListener
public void notifyStep(World w,
float stepSize)
notifyStep in interface WorldStepListenerpublic void addCollisionListener(CollisionListener l)
l - public void removeCollisionListener(CollisionListener l)
l -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||