com.jmex.physics
Class CollisionGroup

java.lang.Object
  extended by com.jmex.physics.CollisionGroup

public abstract class CollisionGroup
extends java.lang.Object

The collision groups provides a concept to get more control about the collision detection that is performed by the physics engine. Each physics node can be assigned to a collision group. For each collision group one can define which other groups can collide with nodes in this group.

See Also:
collidesWith(CollisionGroup, boolean)

Field Summary
protected  PhysicsSpace space
           
 
Constructor Summary
protected CollisionGroup(PhysicsSpace space, java.lang.String name)
           
 
Method Summary
 void collidesWith(CollisionGroup group, boolean collides)
          Specify whether or not the nodes in this group collide with nodes from the other group.
 void delete()
           
 java.util.List<CollisionGroup> getCollidesWith()
           
 java.lang.String getName()
           
protected abstract  void nodeAdded(PhysicsNode node)
           
protected abstract  void nodeRemoved(PhysicsNode node)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

space

protected final PhysicsSpace space
Constructor Detail

CollisionGroup

protected CollisionGroup(PhysicsSpace space,
                         java.lang.String name)
Method Detail

getName

public java.lang.String getName()

collidesWith

public void collidesWith(CollisionGroup group,
                         boolean collides)
Specify whether or not the nodes in this group collide with nodes from the other group.

Parameters:
group - group to specify collision detection with (may be this)
collides - true to enable collision detection between groups, false to disable

getCollidesWith

public java.util.List<CollisionGroup> getCollidesWith()

delete

public void delete()

nodeAdded

protected abstract void nodeAdded(PhysicsNode node)

nodeRemoved

protected abstract void nodeRemoved(PhysicsNode node)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object