All Superinterfaces:
Comparable<JoltPhysicsObject>, ConstJoltPhysicsObject
All Known Implementing Classes:
Contact

public interface ConstContact extends ConstJoltPhysicsObject
Read-only access to a Contact. (native type: const Contact)
  • Method Details

    • getBodyB

      int getBodyB()
      Return the ID of the colliding body. The contact is unaffected.
      Returns:
      the BodyID value
    • getCanPushCharacter

      boolean getCanPushCharacter()
      Test whether the velocity of the contact point can push the character. The contact is unaffected.
      Returns:
      true if can push, otherwise false
    • getCharacterB

      ConstCharacterVirtual getCharacterB()
      Return the colliding character. The contact is unaffected.
      Returns:
      a new JVM object with the pre-existing native object assigned, or null if no colliding character
    • getContactNormal

      Vec3 getContactNormal()
      Copy the contact normal. The contact is unaffected.
      Returns:
      a new direction vector, pointing toward the character
    • getDistance

      float getDistance()
      Return the contact separation. The contact is unaffected.
      Returns:
      the signed distance (in meters, ≤0→actual contact, >0→predictive contact)
    • getFraction

      float getFraction()
      Return the fraction along the path where the contact takes place. The contact is unaffected.
      Returns:
      the fraction
    • getHadCollision

      boolean getHadCollision()
      Test whether the character has actually collided. The contact is unaffected.
      Returns:
      true if a real collision, false for a predictive contact that never became a real one
    • getIsSensorB

      boolean getIsSensorB()
      Test whether the colliding object is a sensor. The contact is unaffected.
      Returns:
      true for a sensor, otherwise false
    • getLinearVelocity

      Vec3 getLinearVelocity()
      Copy the velocity of the contact point. The contact is unaffected.
      Returns:
      a new velocity vector
    • getMotionTypeB

      EMotionType getMotionTypeB()
      Return the motion type of the colliding object. The contact is unaffected.
      Returns:
      an enum value (not null)
    • getPosition

      RVec3 getPosition()
      Copy the location where the contact occurs. The contact is unaffected.
      Returns:
      a new vector (in system coordinates)
    • getSubShapeIdB

      int getSubShapeIdB()
      Return the sub-shape ID of the colliding body. The contact is unaffected.
      Returns:
      a SubShapeID value
    • getSurfaceNormal

      Vec3 getSurfaceNormal()
      Copy the surface normal of the contact. The contact is unaffected.
      Returns:
      a new direction vector
    • getUserData

      long getUserData()
      Return the user data of the colliding object. The contact is unaffected.
      Returns:
      the data value
    • getWasDiscarded

      boolean getWasDiscarded()
      Test whether the contact was discarded by the contact-validate callback. The contact is unaffected.
      Returns:
      true if discarded, otherwise false