Public Member Functions | Public Attributes | Private Member Functions | List of all members
PxContactStreamIterator Struct Reference

A class to iterate over a compressed contact stream. This supports read-only access to the various contact formats. More...

#include <PxContact.h>

Collaboration diagram for PxContactStreamIterator:
Collaboration graph
[legend]

Public Member Functions

PX_FORCE_INLINE PxContactStreamIterator (const PxU8 *stream, PxU32 size)
 Constructor. More...
 
PX_FORCE_INLINE bool hasNextPatch () const
 Returns whether there are more patches in this stream. More...
 
PX_FORCE_INLINE PxU32 getTotalContactCount () const
 Returns the total contact count. More...
 
PX_INLINE void nextPatch ()
 Advances iterator to next contact patch. More...
 
PX_FORCE_INLINE bool hasNextContact () const
 Returns if the current patch has more contacts. More...
 
PX_FORCE_INLINE void nextContact ()
 Advances to the next contact in the patch. More...
 
PX_FORCE_INLINE const PxVec3getContactNormal () const
 Gets the current contact's normal. More...
 
PX_FORCE_INLINE PxReal getInvMassScale0 () const
 Gets the inverse mass scale for body 0. More...
 
PX_FORCE_INLINE PxReal getInvMassScale1 () const
 Gets the inverse mass scale for body 1. More...
 
PX_FORCE_INLINE PxReal getInvInertiaScale0 () const
 Gets the inverse inertia scale for body 0. More...
 
PX_FORCE_INLINE PxReal getInvInertiaScale1 () const
 Gets the inverse inertia scale for body 1. More...
 
PX_FORCE_INLINE PxReal getMaxImpulse () const
 Gets the contact's max impulse. More...
 
PX_FORCE_INLINE const PxVec3getTargetVel () const
 Gets the contact's target velocity. More...
 
PX_FORCE_INLINE const PxVec3getContactPoint () const
 Gets the contact's contact point. More...
 
PX_FORCE_INLINE PxReal getSeparation () const
 Gets the contact's separation. More...
 
PX_FORCE_INLINE PxU32 getFaceIndex0 () const
 Gets the contact's face index for shape 0. More...
 
PX_FORCE_INLINE PxU32 getFaceIndex1 () const
 Gets the contact's face index for shape 1. More...
 
PX_FORCE_INLINE PxReal getStaticFriction () const
 Gets the contact's static friction coefficient. More...
 
PX_FORCE_INLINE PxReal getDynamicFriction () const
 Gets the contact's static dynamic coefficient. More...
 
PX_FORCE_INLINE PxReal getRestitution () const
 Gets the contact's restitution coefficient. More...
 
PX_FORCE_INLINE PxU32 getMaterialFlags () const
 Gets the contact's material flags. More...
 
PX_FORCE_INLINE PxU16 getMaterialIndex0 () const
 Gets the contact's material index for shape 0. More...
 
PX_FORCE_INLINE PxU16 getMaterialIndex1 () const
 Gets the contact's material index for shape 1. More...
 
bool advanceToIndex (const PxU32 initialIndex)
 Advances the contact stream iterator to a specific contact index. More...
 

Public Attributes

PxVec3 zero
 Utility zero vector to optimize functions returning zero vectors when a certain flag isn't set. More...
 
const PxContactHeaderheader
 The current contact header. More...
 
const PxU8currPtr
 Current pointer in the stream. More...
 
const PxU8endPtr
 Pointer to the end of the stream. More...
 
const PxU8patchStart
 Pointer to the start of the patch. More...
 
const PxU8patchEnd
 Pointer to the end of the patch. More...
 
const PxSimpleContactcontactStart
 Pointer to the first contact in the patch. More...
 
PxU32 streamSize
 Size of the stream in bytes. More...
 
PxU32 nbContactsInPatch
 Total number of contacts in the patch. More...
 
PxU32 currentContact
 Current contact index in the patch. More...
 
PxU32 contactPatchHeaderSize
 Size of contact patch header. More...
 
PxU32 contactPointSize
 Contact point size. More...
 
PxU32 hasFaceIndices
 Indicates whether this stream carries face indices. More...
 
PxU32 contactsWereModifiable
 Indicates whether this stream is created from modifiable contact (internal usage), the variables are still read-only. More...
 
PxU32 forceNoResponse
 Indicates whether this stream is notify-only or not. More...
 

Private Member Functions

PX_FORCE_INLINE const
PxContactPatch
getContactPatch () const
 Internal helper. More...
 
PX_FORCE_INLINE const
PxModifiableContact
getModifiableContact () const
 Internal helper. More...
 
PX_FORCE_INLINE const
PxModifyContactHeader
getModifiableContactHeader () const
 Internal helper. More...
 

Detailed Description

A class to iterate over a compressed contact stream. This supports read-only access to the various contact formats.

Constructor & Destructor Documentation

PX_FORCE_INLINE PxContactStreamIterator::PxContactStreamIterator ( const PxU8 stream,
PxU32  size 
)
inline

Constructor.

Parameters
[in]streamPointer to the start of the stream.
[in]sizeSize of the stream in bytes.

References PxContactHeader::eFORCE_NO_RESPONSE, PxContactHeader::eHAS_FACE_INDICES, PxContactHeader::eMODIFIABLE, PxContactHeader::flags, NULL, and PX_ASSERT.

Member Function Documentation

bool PxContactStreamIterator::advanceToIndex ( const PxU32  initialIndex)
inline

Advances the contact stream iterator to a specific contact index.

References PX_ASSERT.

PX_FORCE_INLINE const PxVec3& PxContactStreamIterator::getContactNormal ( ) const
inline

Gets the current contact's normal.

Returns
The current contact's normal.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE const PxContactPatch& PxContactStreamIterator::getContactPatch ( ) const
inlineprivate

Internal helper.

References PX_ASSERT.

PX_FORCE_INLINE const PxVec3& PxContactStreamIterator::getContactPoint ( ) const
inline

Gets the contact's contact point.

Returns
The contact's contact point.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE PxReal PxContactStreamIterator::getDynamicFriction ( ) const
inline

Gets the contact's static dynamic coefficient.

Returns
The contact's static dynamic coefficient.
PX_FORCE_INLINE PxU32 PxContactStreamIterator::getFaceIndex0 ( ) const
inline

Gets the contact's face index for shape 0.

Returns
The contact's face index for shape 0.

References PXC_CONTACT_NO_FACE_INDEX.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE PxU32 PxContactStreamIterator::getFaceIndex1 ( ) const
inline

Gets the contact's face index for shape 1.

Returns
The contact's face index for shape 1.

References PXC_CONTACT_NO_FACE_INDEX.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE PxReal PxContactStreamIterator::getInvInertiaScale0 ( ) const
inline

Gets the inverse inertia scale for body 0.

Returns
The inverse inertia scale for body 0.
PX_FORCE_INLINE PxReal PxContactStreamIterator::getInvInertiaScale1 ( ) const
inline

Gets the inverse inertia scale for body 1.

Returns
The inverse inertia scale for body 1.
PX_FORCE_INLINE PxReal PxContactStreamIterator::getInvMassScale0 ( ) const
inline

Gets the inverse mass scale for body 0.

Returns
The inverse mass scale for body 0.
PX_FORCE_INLINE PxReal PxContactStreamIterator::getInvMassScale1 ( ) const
inline

Gets the inverse mass scale for body 1.

Returns
The inverse mass scale for body 1.
PX_FORCE_INLINE PxU32 PxContactStreamIterator::getMaterialFlags ( ) const
inline

Gets the contact's material flags.

Returns
The contact's material flags.
PX_FORCE_INLINE PxU16 PxContactStreamIterator::getMaterialIndex0 ( ) const
inline

Gets the contact's material index for shape 0.

Returns
The contact's material index for shape 0.
PX_FORCE_INLINE PxU16 PxContactStreamIterator::getMaterialIndex1 ( ) const
inline

Gets the contact's material index for shape 1.

Returns
The contact's material index for shape 1.
PX_FORCE_INLINE PxReal PxContactStreamIterator::getMaxImpulse ( ) const
inline

Gets the contact's max impulse.

Returns
The contact's max impulse.

References PX_MAX_REAL.

PX_FORCE_INLINE const PxModifiableContact& PxContactStreamIterator::getModifiableContact ( ) const
inlineprivate

Internal helper.

References PX_ASSERT.

PX_FORCE_INLINE const PxModifyContactHeader& PxContactStreamIterator::getModifiableContactHeader ( ) const
inlineprivate

Internal helper.

References PX_ASSERT.

PX_FORCE_INLINE PxReal PxContactStreamIterator::getRestitution ( ) const
inline

Gets the contact's restitution coefficient.

Returns
The contact's restitution coefficient.
PX_FORCE_INLINE PxReal PxContactStreamIterator::getSeparation ( ) const
inline

Gets the contact's separation.

Returns
The contact's separation.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE PxReal PxContactStreamIterator::getStaticFriction ( ) const
inline

Gets the contact's static friction coefficient.

Returns
The contact's static friction coefficient.
PX_FORCE_INLINE const PxVec3& PxContactStreamIterator::getTargetVel ( ) const
inline

Gets the contact's target velocity.

Returns
The contact's target velocity.
PX_FORCE_INLINE PxU32 PxContactStreamIterator::getTotalContactCount ( ) const
inline

Returns the total contact count.

Returns
Total contact count.
PX_FORCE_INLINE bool PxContactStreamIterator::hasNextContact ( ) const
inline

Returns if the current patch has more contacts.

Returns
If there are more contacts in the current patch.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE bool PxContactStreamIterator::hasNextPatch ( ) const
inline

Returns whether there are more patches in this stream.

Returns
Whether there are more patches in this stream.

Referenced by PxContactPair::extractContacts().

PX_FORCE_INLINE void PxContactStreamIterator::nextContact ( )
inline

Advances to the next contact in the patch.

References PX_ASSERT.

Referenced by PxContactPair::extractContacts().

PX_INLINE void PxContactStreamIterator::nextPatch ( )
inline

Advances iterator to next contact patch.

Referenced by PxContactPair::extractContacts().

Member Data Documentation

PxU32 PxContactStreamIterator::contactPatchHeaderSize

Size of contact patch header.

Note
This varies whether the patch is modifiable or not.
PxU32 PxContactStreamIterator::contactPointSize

Contact point size.

Note
This varies whether the patch has feature indices or is modifiable.
const PxSimpleContact* PxContactStreamIterator::contactStart

Pointer to the first contact in the patch.

PxU32 PxContactStreamIterator::contactsWereModifiable

Indicates whether this stream is created from modifiable contact (internal usage), the variables are still read-only.

PxU32 PxContactStreamIterator::currentContact

Current contact index in the patch.

const PxU8* PxContactStreamIterator::currPtr

Current pointer in the stream.

const PxU8* PxContactStreamIterator::endPtr

Pointer to the end of the stream.

PxU32 PxContactStreamIterator::forceNoResponse

Indicates whether this stream is notify-only or not.

PxU32 PxContactStreamIterator::hasFaceIndices

Indicates whether this stream carries face indices.

const PxContactHeader* PxContactStreamIterator::header

The current contact header.

PxU32 PxContactStreamIterator::nbContactsInPatch

Total number of contacts in the patch.

const PxU8* PxContactStreamIterator::patchEnd

Pointer to the end of the patch.

const PxU8* PxContactStreamIterator::patchStart

Pointer to the start of the patch.

PxU32 PxContactStreamIterator::streamSize

Size of the stream in bytes.

PxVec3 PxContactStreamIterator::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.

The documentation for this struct was generated from the following file:


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com