|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.CollisionEvent
A collision event is caused by a collision of either the camera or an object
with another object. To get a collision event in case of a collision, you
need to implement the CollisionListener interface.
Collision events are send to the listeners after the actual collision
detection/response took place.
CollisionListener
Field Summary | |
static int |
ALGORITHM_ELLIPSOID
The collision event was caused by a ellipsoid-polygon collision detection |
static int |
ALGORITHM_RAY
The collision event was caused by a ray-polygon collision detection |
static int |
ALGORITHM_SPHERE
The collision event was caused by a sphere-polygon collision detection |
static int |
TYPE_SOURCE
The object is the source of the collision that has caused the event |
static int |
TYPE_TARGET
The object is a target of the collision that has caused the event |
Method Summary | |
int |
getAlgorithm()
Return the algorithm used to detect the collision that has caused the event. |
SimpleVector |
getFirstContact()
Returns the position in world space of the first contact, if the event is of type TARGET. |
Object3D |
getObject()
Returns the Object3D that has caused the event (i.e. to which this Listener has been added). |
int[] |
getPolygonIDs()
Returns an array containing all the IDs of the object's polygons that were target of the collision that caused this event. |
Object3D |
getSource()
Returns the source of the collision, if it's an Object3D (or null otherwise). |
Object3D[] |
getTargets()
Returns the target objects that are involved in this collision. |
int |
getType()
Returns the type of the collision event. |
java.lang.String |
toString()
Overwrites toString() from java.lang.Object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TYPE_TARGET
public static final int TYPE_SOURCE
public static final int ALGORITHM_RAY
public static final int ALGORITHM_SPHERE
public static final int ALGORITHM_ELLIPSOID
Method Detail |
public Object3D getObject()
public Object3D[] getTargets()
public Object3D getSource()
public int getType()
TYPE_SOURCE
,
TYPE_TARGET
public int getAlgorithm()
ALGORITHM_RAY
,
ALGORITHM_SPHERE
,
ALGORITHM_ELLIPSOID
public int[] getPolygonIDs()
public SimpleVector getFirstContact()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |