com.jmex.physics.contact
Interface ContactInfo

All Known Subinterfaces:
CompleteContactInfo
All Known Implementing Classes:
PendingContact

public interface ContactInfo

Interface to query details for a contact of two collision geometries.

Author:
Irrisor

Method Summary
 com.jme.math.Vector3f getContactNormal(com.jme.math.Vector3f store)
           
 com.jme.math.Vector3f getContactPosition(com.jme.math.Vector3f store)
           
 com.jme.math.Vector3f getContactVelocity(com.jme.math.Vector3f store)
           
 void getDefaultFrictionDirections(com.jme.math.Vector3f primaryStore, com.jme.math.Vector3f secondaryStore)
          Query the default for the directions of the friction.
 PhysicsCollisionGeometry getGeometry1()
          First geometry in this contact.
 PhysicsCollisionGeometry getGeometry2()
          Second geometry in this contact.
 PhysicsNode getNode1()
          First node in this contact.
 PhysicsNode getNode2()
          Second node in this contact.
 float getPenetrationDepth()
           
 float getTime()
           
 

Method Detail

getTime

float getTime()
Returns:
elapsed time after the start of the simulation step before the contact occured

getGeometry1

PhysicsCollisionGeometry getGeometry1()
First geometry in this contact. Order is not necessarily defined!

Returns:
contacting geometry
See Also:
getGeometry2()

getGeometry2

PhysicsCollisionGeometry getGeometry2()
Second geometry in this contact. Order is not necessarily defined!

Returns:
contacting geometry
See Also:
getGeometry1()

getNode1

PhysicsNode getNode1()
First node in this contact. Order is not necessarily defined!

Returns:
contacting node
See Also:
getNode2()

getNode2

PhysicsNode getNode2()
Second node in this contact. Order is not necessarily defined!

Returns:
contacting node
See Also:
getNode1()

getContactVelocity

com.jme.math.Vector3f getContactVelocity(com.jme.math.Vector3f store)
Parameters:
store - where to put the value, null to create a new Vector
Returns:
the velocity with which the two objects hit (in direction 'into' object 1)

getContactPosition

com.jme.math.Vector3f getContactPosition(com.jme.math.Vector3f store)
Parameters:
store - where to put the value, null to create a new Vector
Returns:
the position of this contact in world coordinate space

getContactNormal

com.jme.math.Vector3f getContactNormal(com.jme.math.Vector3f store)
Parameters:
store - where to put the value, null to create a new Vector
Returns:
the normal of the contact (vector that is orthogonal to both contacting surfaces in the contact point)

getPenetrationDepth

float getPenetrationDepth()
Returns:
distance the geometries intersect in normal direction, ideally 0 (if contact is detected early enough)
See Also:
getContactNormal(com.jme.math.Vector3f)

getDefaultFrictionDirections

void getDefaultFrictionDirections(com.jme.math.Vector3f primaryStore,
                                  com.jme.math.Vector3f secondaryStore)
Query the default for the directions of the friction. Both directions are perpendicular to each other and perpendicular to the contact normal.

Parameters:
primaryStore - store for first friction direction as specified in ContactHandlingDetails.getFrictionDirection(com.jme.math.Vector3f) (cannot be null)
secondaryStore - second direction store (may be null)