PxContactStreamIterator

Defined in include/PxContact.h

struct PxContactStreamIterator

A class to iterate over a compressed contact stream.

This supports read-only access to the various contact formats.

Public Types

enum StreamFormat

Values:

enumerator eSIMPLE_STREAM
enumerator eMODIFIABLE_STREAM
enumerator eCOMPRESSED_MODIFIABLE_STREAM

Public Functions

inline PxContactStreamIterator(const PxU8 *contactPatches, const PxU8 *contactPoints, const PxU32 *contactFaceIndices, PxU32 nbPatches, PxU32 nbContacts)

Constructor.

inline bool hasNextPatch() const

Returns whether there are more patches in this stream.

Returns

Whether there are more patches in this stream.

inline PxU32 getTotalContactCount() const

Returns the total contact count.

Returns

Total contact count.

inline PxU32 getTotalPatchCount() const

Returns the total patch count.

Returns

Total patch count.

inline void nextPatch()

Advances iterator to next contact patch.

inline bool hasNextContact() const

Returns if the current patch has more contacts.

Returns

If there are more contacts in the current patch.

inline void nextContact()

Advances to the next contact in the patch.

inline const PxVec3 &getContactNormal() const

Gets the current contact’s normal.

Returns

The current contact’s normal.

inline PxReal getInvMassScale0() const

Gets the inverse mass scale for body 0.

Returns

The inverse mass scale for body 0.

inline PxReal getInvMassScale1() const

Gets the inverse mass scale for body 1.

Returns

The inverse mass scale for body 1.

inline PxReal getInvInertiaScale0() const

Gets the inverse inertia scale for body 0.

Returns

The inverse inertia scale for body 0.

inline PxReal getInvInertiaScale1() const

Gets the inverse inertia scale for body 1.

Returns

The inverse inertia scale for body 1.

inline PxReal getMaxImpulse() const

Gets the contact’s max impulse.

Returns

The contact’s max impulse.

inline const PxVec3 &getTargetVel() const

Gets the contact’s target velocity.

Returns

The contact’s target velocity.

inline const PxVec3 &getContactPoint() const

Gets the contact’s contact point.

Returns

The contact’s contact point.

inline PxReal getSeparation() const

Gets the contact’s separation.

Returns

The contact’s separation.

inline PxU32 getFaceIndex0() const

Gets the contact’s face index for shape 0.

Returns

The contact’s face index for shape 0.

inline PxU32 getFaceIndex1() const

Gets the contact’s face index for shape 1.

Returns

The contact’s face index for shape 1.

inline PxReal getStaticFriction() const

Gets the contact’s static friction coefficient.

Returns

The contact’s static friction coefficient.

inline PxReal getDynamicFriction() const

Gets the contact’s dynamic friction coefficient.

Returns

The contact’s dynamic friction coefficient.

inline PxReal getRestitution() const

Gets the contact’s restitution coefficient.

Returns

The contact’s restitution coefficient.

inline PxReal getDamping() const

Gets the contact’s damping value.

Returns

The contact’s damping value.

inline PxU32 getMaterialFlags() const

Gets the contact’s material flags.

Returns

The contact’s material flags.

inline PxU16 getMaterialIndex0() const

Gets the contact’s material index for shape 0.

Returns

The contact’s material index for shape 0.

inline PxU16 getMaterialIndex1() const

Gets the contact’s material index for shape 1.

Returns

The contact’s material index for shape 1.

inline bool advanceToIndex(const PxU32 initialIndex)

Advances the contact stream iterator to a specific contact index.

Returns

True if advancing was possible

Public Members

PxVec3 zero

Utility zero vector to optimize functions returning zero vectors when a certain flag isn’t set.

Note

This allows us to return by reference instead of having to return by value. Returning by value will go via memory (registers -> stack -> registers), which can cause performance issues on certain platforms.

const PxContactPatch *patch

The patch headers.

const PxContact *contact

The contacts.

const PxU32 *faceIndice

The contact triangle face index.

PxU32 totalPatches

The total number of patches in this contact stream.

PxU32 totalContacts

The total number of contact points in this stream.

PxU32 nextContactIndex

The current contact index.

PxU32 nextPatchIndex

The current patch Index.

PxU32 contactPatchHeaderSize

Size of contact patch header.

Note

This varies whether the patch is modifiable or not.

PxU32 contactPointSize

Contact point size.

Note

This varies whether the patch has feature indices or is modifiable.

StreamFormat mStreamFormat

The stream format.

PxU32 forceNoResponse

Indicates whether this stream is notify-only or not.

bool pointStepped

Internal helper for stepping the contact stream iterator.

PxU32 hasFaceIndices

Specifies if this contactPatch has face indices (handled as bool)

See also

faceIndice