public class CollisionEvent
extends java.lang.Object
CollisionListener
Modifier and Type | Field and Description |
---|---|
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
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
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()
toString
in class java.lang.Object