Package com.jme3.bullet.collision
Class PhysicsCollisionEvent
java.lang.Object
java.util.EventObject
com.jme3.bullet.collision.PhysicsCollisionEvent
- All Implemented Interfaces:
Serializable
A CollisionEvent stores all information about a collision in the PhysicsWorld.
Do not store this Object, as it will be reused after the collision() method has been called.
Get/reference all data you need in the collide method.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionPhysicsCollisionEvent
(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, com.bulletphysics.collision.narrowphase.ManifoldPoint cp) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clean()
used by event factory, called when event is destroyedfloat
float
float
float
float
float
int
int
int
getNodeA()
getNodeB()
int
int
int
getType()
boolean
void
refactor
(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, com.bulletphysics.collision.narrowphase.ManifoldPoint cp) used by event factory, called when event reusedMethods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
TYPE_ADDED
public static final int TYPE_ADDED- See Also:
-
TYPE_PROCESSED
public static final int TYPE_PROCESSED- See Also:
-
TYPE_DESTROYED
public static final int TYPE_DESTROYED- See Also:
-
-
Constructor Details
-
PhysicsCollisionEvent
public PhysicsCollisionEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, com.bulletphysics.collision.narrowphase.ManifoldPoint cp)
-
-
Method Details
-
clean
public void clean()used by event factory, called when event is destroyed -
refactor
public void refactor(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, com.bulletphysics.collision.narrowphase.ManifoldPoint cp) used by event factory, called when event reused- Parameters:
type
- the desired typesource
- the desired first object (alias created)nodeB
- the desired 2nd object (alias created)cp
- the desired manifold (alias created)
-
getType
public int getType() -
getNodeA
- Returns:
- A Spatial if the UserObject of the PhysicsCollisionObject is a Spatial
-
getNodeB
- Returns:
- A Spatial if the UserObject of the PhysicsCollisionObject is a Spatial
-
getObjectA
-
getObjectB
-
getAppliedImpulse
public float getAppliedImpulse() -
getAppliedImpulseLateral1
public float getAppliedImpulseLateral1() -
getAppliedImpulseLateral2
public float getAppliedImpulseLateral2() -
getCombinedFriction
public float getCombinedFriction() -
getCombinedRestitution
public float getCombinedRestitution() -
getDistance1
public float getDistance1() -
getIndex0
public int getIndex0() -
getIndex1
public int getIndex1() -
getLateralFrictionDir1
-
getLateralFrictionDir2
-
isLateralFrictionInitialized
public boolean isLateralFrictionInitialized() -
getLifeTime
public int getLifeTime() -
getLocalPointA
-
getLocalPointB
-
getNormalWorldOnB
-
getPartId0
public int getPartId0() -
getPartId1
public int getPartId1() -
getPositionWorldOnA
-
getPositionWorldOnB
-
getUserPersistentData
-