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.
- Author:
- normenhansen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionPhysicsCollisionEvent(int type, PhysicsCollisionObject source, PhysicsCollisionObject nodeB, com.bulletphysics.collision.narrowphase.ManifoldPoint cp) -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()used by event factory, called when event is destroyedfloatfloatfloatfloatfloatfloatintintcom.jme3.math.Vector3fcom.jme3.math.Vector3fintcom.jme3.math.Vector3fcom.jme3.math.Vector3fcom.jme3.scene.SpatialgetNodeA()com.jme3.scene.SpatialgetNodeB()com.jme3.math.Vector3fintintcom.jme3.math.Vector3fcom.jme3.math.Vector3fintgetType()booleanvoidrefactor(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
public com.jme3.scene.Spatial getNodeA()- Returns:
- A Spatial if the UserObject of the PhysicsCollisionObject is a Spatial
-
getNodeB
public com.jme3.scene.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
public com.jme3.math.Vector3f getLateralFrictionDir1() -
getLateralFrictionDir2
public com.jme3.math.Vector3f getLateralFrictionDir2() -
isLateralFrictionInitialized
public boolean isLateralFrictionInitialized() -
getLifeTime
public int getLifeTime() -
getLocalPointA
public com.jme3.math.Vector3f getLocalPointA() -
getLocalPointB
public com.jme3.math.Vector3f getLocalPointB() -
getNormalWorldOnB
public com.jme3.math.Vector3f getNormalWorldOnB() -
getPartId0
public int getPartId0() -
getPartId1
public int getPartId1() -
getPositionWorldOnA
public com.jme3.math.Vector3f getPositionWorldOnA() -
getPositionWorldOnB
public com.jme3.math.Vector3f getPositionWorldOnB() -
getUserPersistentData
-