Package physx.physics

Class PxContactPair

java.lang.Object
physx.NativeObject
physx.physics.PxContactPair

public class PxContactPair extends NativeObject
Contact report pair information.

Instances of this class are passed to PxSimulationEventCallback.onContact(). If contact reports have been requested for a pair of shapes (see #PxPairFlag), then the corresponding contact information will be provided through this structure.

  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxContactPair

      protected PxContactPair()
    • PxContactPair

      protected PxContactPair(long address)
  • Method Details

    • wrapPointer

      public static PxContactPair wrapPointer(long address)
    • arrayGet

      public static PxContactPair arrayGet(long baseAddress, int index)
    • destroy

      public void destroy()
    • getShapes

      public PxShape getShapes(int index)
      Parameters:
      index - Array index
      Returns:
      WebIDL type: PxShape
    • setShapes

      public void setShapes(int index, PxShape value)
      Parameters:
      index - Array index
      value - WebIDL type: PxShape
    • getContactCount

      public byte getContactCount()
      Number of contact points stored in the contact stream
    • setContactCount

      public void setContactCount(byte value)
      Number of contact points stored in the contact stream
    • getPatchCount

      public byte getPatchCount()
      Number of contact patches stored in the contact stream
    • setPatchCount

      public void setPatchCount(byte value)
      Number of contact patches stored in the contact stream
    • getFlags

      public PxContactPairFlags getFlags()
      Additional information on the contact report pair.
    • setFlags

      public void setFlags(PxContactPairFlags value)
      Additional information on the contact report pair.
    • getEvents

      public PxPairFlags getEvents()
      Flags raised due to the contact.

      The events field is a combination of:

      <ul> <li>PxPairFlag::eNOTIFY_TOUCH_FOUND,</li> <li>PxPairFlag::eNOTIFY_TOUCH_PERSISTS,</li> <li>PxPairFlag::eNOTIFY_TOUCH_LOST,</li> <li>PxPairFlag::eNOTIFY_TOUCH_CCD,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_FOUND,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_PERSISTS,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_LOST</li> </ul>

      See the documentation of #PxPairFlag for an explanation of each.

      Note: eNOTIFY_TOUCH_CCD can get raised even if the pair did not request this event. However, in such a case it will only get raised in combination with one of the other flags to point out that the other event occured during a CCD pass.

    • setEvents

      public void setEvents(PxPairFlags value)
      Flags raised due to the contact.

      The events field is a combination of:

      <ul> <li>PxPairFlag::eNOTIFY_TOUCH_FOUND,</li> <li>PxPairFlag::eNOTIFY_TOUCH_PERSISTS,</li> <li>PxPairFlag::eNOTIFY_TOUCH_LOST,</li> <li>PxPairFlag::eNOTIFY_TOUCH_CCD,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_FOUND,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_PERSISTS,</li> <li>PxPairFlag::eNOTIFY_THRESHOLD_FORCE_LOST</li> </ul>

      See the documentation of #PxPairFlag for an explanation of each.

      Note: eNOTIFY_TOUCH_CCD can get raised even if the pair did not request this event. However, in such a case it will only get raised in combination with one of the other flags to point out that the other event occured during a CCD pass.

    • extractContacts

      public int extractContacts(PxContactPairPoint userBuffer, int bufferSize)
      Extracts the contact points from the stream and stores them in a convenient format.
      Parameters:
      userBuffer - Array of PxContactPairPoint structures to extract the contact points to. The number of contacts for a pair is defined by #contactCount
      bufferSize - Number of PxContactPairPoint structures the provided buffer can store.
      Returns:
      Number of contact points written to the buffer.
      See Also: