public class PhysicsCollisionEvent
extends java.util.EventObject
Do not retain this object, as it will be reused after the collision() method returns. Copy any data you need during the collide() method.
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_ADDED
type value to indicate a new event
|
static int |
TYPE_DESTROYED
type value to indicate a cleaned/destroyed event
|
static int |
TYPE_PROCESSED
type value to indicate an event that has been added to a PhysicsSpace
queue
|
Constructor and Description |
---|
PhysicsCollisionEvent(int type,
PhysicsCollisionObject nodeA,
PhysicsCollisionObject nodeB,
long manifoldPointObjectId)
Instantiate a collision event.
|
Modifier and Type | Method and Description |
---|---|
void |
clean()
Destroy this event.
|
float |
getAppliedImpulse()
Read the collision's applied impulse.
|
float |
getAppliedImpulseLateral1()
Read the collision's applied lateral impulse #1.
|
float |
getAppliedImpulseLateral2()
Read the collision's applied lateral impulse #2.
|
float |
getCombinedFriction()
Read the collision's combined friction.
|
float |
getCombinedRestitution()
Read the collision's combined restitution.
|
float |
getDistance1()
Read the collision's distance #1.
|
int |
getIndex0()
Read the collision's index 0.
|
int |
getIndex1()
Read the collision's index 1.
|
Vector3f |
getLateralFrictionDir1()
Copy the collision's lateral friction direction #1.
|
Vector3f |
getLateralFrictionDir1(Vector3f lateralFrictionDir1)
Copy the collision's lateral friction direction #1.
|
Vector3f |
getLateralFrictionDir2()
Copy the collision's lateral friction direction #2.
|
Vector3f |
getLateralFrictionDir2(Vector3f lateralFrictionDir2)
Copy the collision's lateral friction direction #2.
|
int |
getLifeTime()
Read the collision's lifetime.
|
Vector3f |
getLocalPointA()
Copy the collision's location in the local coordinates of object A.
|
Vector3f |
getLocalPointA(Vector3f localPointA)
Copy the collision's location in the local coordinates of object A.
|
Vector3f |
getLocalPointB()
Copy the collision's location in the local coordinates of object B.
|
Vector3f |
getLocalPointB(Vector3f localPointB)
Copy the collision's location in the local coordinates of object B.
|
Spatial |
getNodeA()
Access the user object of collision object A, provided it's a Spatial.
|
Spatial |
getNodeB()
Access the user object of collision object B, provided it's a Spatial.
|
Vector3f |
getNormalWorldOnB()
Copy the collision's normal on object B.
|
Vector3f |
getNormalWorldOnB(Vector3f normalWorldOnB)
Copy the collision's normal on object B.
|
PhysicsCollisionObject |
getObjectA()
Access collision object A.
|
PhysicsCollisionObject |
getObjectB()
Access collision object B.
|
int |
getPartId0()
Read part identifier 0.
|
int |
getPartId1()
Read part identifier 1.
|
Vector3f |
getPositionWorldOnA()
Copy the collision's location.
|
Vector3f |
getPositionWorldOnA(Vector3f positionWorldOnA)
Copy the collision's location.
|
Vector3f |
getPositionWorldOnB()
Copy the collision's location.
|
Vector3f |
getPositionWorldOnB(Vector3f positionWorldOnB)
Copy the collision's location.
|
int |
getType()
Read the type of event.
|
boolean |
isLateralFrictionInitialized()
Test whether the collision's lateral friction is initialized.
|
void |
refactor(int type,
PhysicsCollisionObject source,
PhysicsCollisionObject nodeB,
long manifoldPointObjectId)
Reuse this event.
|
public static final int TYPE_ADDED
public static final int TYPE_PROCESSED
public static final int TYPE_DESTROYED
public PhysicsCollisionEvent(int type, PhysicsCollisionObject nodeA, PhysicsCollisionObject nodeB, long manifoldPointObjectId)
type
- event type (0=added/1=processed/2=destroyed)nodeA
- 1st involved object (alias created)nodeB
- 2nd involved object (alias created)manifoldPointObjectId
- Bullet identifier of the btManifoldPointpublic void clean()
public void refactor(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, long manifoldPointObjectId)
type
- event type (added/processed/destroyed)source
- 1st involved object (alias created)nodeB
- 2nd involved object (alias created)manifoldPointObjectId
- Bullet identifierpublic int getType()
public Spatial getNodeA()
public Spatial getNodeB()
public PhysicsCollisionObject getObjectA()
public PhysicsCollisionObject getObjectB()
public float getAppliedImpulse()
public float getAppliedImpulseLateral1()
public float getAppliedImpulseLateral2()
public float getCombinedFriction()
public float getCombinedRestitution()
public float getDistance1()
public int getIndex0()
public int getIndex1()
public Vector3f getLateralFrictionDir1()
public Vector3f getLateralFrictionDir1(Vector3f lateralFrictionDir1)
lateralFrictionDir1
- storage for the result (not null, modified)public Vector3f getLateralFrictionDir2()
public Vector3f getLateralFrictionDir2(Vector3f lateralFrictionDir2)
lateralFrictionDir2
- storage for the result (not null, modified)public boolean isLateralFrictionInitialized()
public int getLifeTime()
public Vector3f getLocalPointA()
public Vector3f getLocalPointA(Vector3f localPointA)
localPointA
- storage for the result (not null, modified)public Vector3f getLocalPointB()
public Vector3f getLocalPointB(Vector3f localPointB)
localPointB
- storage for the result (not null, modified)public Vector3f getNormalWorldOnB()
public Vector3f getNormalWorldOnB(Vector3f normalWorldOnB)
normalWorldOnB
- storage for the result (not null, modified)public int getPartId0()
public int getPartId1()
public Vector3f getPositionWorldOnA()
public Vector3f getPositionWorldOnA(Vector3f positionWorldOnA)
positionWorldOnA
- storage for the result (not null, modified)public Vector3f getPositionWorldOnB()