RavEngine
Loading...
Searching...
No Matches
physx::Cm::Collection Class Reference
Inheritance diagram for physx::Cm::Collection:
[legend]
Collaboration diagram for physx::Cm::Collection:
[legend]

Public Types

typedef CollectionHashMap< PxBase *, PxSerialObjectId > ObjectToIdMap
 
typedef CollectionHashMap< PxSerialObjectId, PxBase * > IdToObjectMap
 

Public Member Functions

virtual void add (PxBase &object, PxSerialObjectId ref)
 Adds a PxBase object to the collection.
 
virtual void remove (PxBase &object)
 Removes a PxBase member object from the collection.
 
virtual bool contains (PxBase &object) const
 Returns whether the collection contains a certain PxBase object.
 
virtual void addId (PxBase &object, PxSerialObjectId id)
 Adds an id to a member PxBase object.
 
virtual void removeId (PxSerialObjectId id)
 Removes id from a contained PxBase object.
 
virtual PxBase * find (PxSerialObjectId ref) const
 Looks for a PxBase object given a PxSerialObjectId value.
 
virtual void add (PxCollection &collection)
 Adds all PxBase objects and their ids of collection to this collection.
 
virtual void remove (PxCollection &collection)
 Removes all PxBase objects of collection from this collection.
 
virtual PxU32 getNbObjects () const
 Gets number of PxBase objects in this collection.
 
virtual PxBase & getObject (PxU32 index) const
 Gets the PxBase object of this collection given its index.
 
virtual PxU32 getObjects (PxBase **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
 Copies member PxBase pointers to a user specified buffer.
 
virtual PxU32 getNbIds () const
 Gets number of PxSerialObjectId names in this collection.
 
virtual PxSerialObjectId getId (const PxBase &object) const
 Gets the PxSerialObjectId name of a PxBase object within the collection.
 
virtual PxU32 getIds (PxSerialObjectId *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
 Copies member PxSerialObjectId values to a user specified buffer.
 
void release ()
 Deletes a collection object.
 
PX_INLINE void internalAdd (PxBase *s, PxSerialObjectId id=PX_SERIAL_OBJECT_ID_INVALID)
 
PX_INLINE PxU32 internalGetNbObjects () const
 
PX_INLINE PxBase * internalGetObject (PxU32 i) const
 
PX_INLINE const ObjectToIdMap::Entry * internalGetObjects () const
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Public Attributes

IdToObjectMap mIds
 
ObjectToIdMap mObjects
 

Member Function Documentation

◆ add() [1/2]

void Collection::add ( PxBase &  object,
PxSerialObjectId  id 
)
virtual

Adds a PxBase object to the collection.

Adds a PxBase object to the collection. Optionally a PxSerialObjectId can be provided in order to resolve dependencies between collections. A PxSerialObjectId value of PX_SERIAL_OBJECT_ID_INVALID means the object remains without id. Objects can be added regardless of other objects they require. If the object is already in the collection, the ID will be set if it was PX_SERIAL_OBJECT_ID_INVALID previously, otherwise the operation fails.

Parameters
[in]objectObject to be added to the collection
[in]idOptional PxSerialObjectId id

Implements physx::PxCollection.

◆ add() [2/2]

void Collection::add ( PxCollection &  collection)
virtual

Adds all PxBase objects and their ids of collection to this collection.

PxBase objects already in this collection are ignored. Object ids need to be conflict free, i.e. the same object may not have two different ids within the two collections.

Parameters
[in]collectionCollection to be added

Implements physx::PxCollection.

◆ addId()

void Collection::addId ( PxBase &  object,
PxSerialObjectId  id 
)
virtual

Adds an id to a member PxBase object.

If the object is already associated with an id within the collection, the id is replaced. May only be called for objects that are members of the collection. The id needs to be unique within the collection.

Parameters
[in]objectMember PxBase object
[in]idPxSerialObjectId id to be given to the object

Implements physx::PxCollection.

◆ contains()

bool Collection::contains ( PxBase &  object) const
virtual

Returns whether the collection contains a certain PxBase object.

Parameters
[in]objectPxBase object
Returns
Whether object is contained.

Implements physx::PxCollection.

◆ find()

PxBase * Collection::find ( PxSerialObjectId  id) const
virtual

Looks for a PxBase object given a PxSerialObjectId value.

If there is no PxBase object in the collection with the given id, NULL is returned.

Parameters
[in]idPxSerialObjectId value to look for
Returns
PxBase object with the given id value or NULL

Implements physx::PxCollection.

◆ getId()

PxSerialObjectId Collection::getId ( const PxBase &  object) const
virtual

Gets the PxSerialObjectId name of a PxBase object within the collection.

The PxBase object needs to be a member of the collection.

Parameters
[in]objectPxBase object to get id for
Returns
PxSerialObjectId name of the object or PX_SERIAL_OBJECT_ID_INVALID if the object is unnamed

Implements physx::PxCollection.

◆ getIds()

PxU32 Collection::getIds ( PxSerialObjectId *  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
virtual

Copies member PxSerialObjectId values to a user specified buffer.

Parameters
[out]userBufferArray of PxSerialObjectId values
[in]bufferSizeCapacity of userBuffer
[in]startIndexOffset into list of member PxSerialObjectId values
Returns
number of members PxSerialObjectId values that have been written to the userBuffer

Implements physx::PxCollection.

◆ getNbIds()

PxU32 Collection::getNbIds ( ) const
virtual

Gets number of PxSerialObjectId names in this collection.

Returns
Number of PxSerialObjectId names in this collection

Implements physx::PxCollection.

◆ getNbObjects()

PxU32 Collection::getNbObjects ( ) const
virtual

Gets number of PxBase objects in this collection.

Returns
Number of objects in this collection

Implements physx::PxCollection.

◆ getObject()

PxBase & Collection::getObject ( PxU32  index) const
virtual

Gets the PxBase object of this collection given its index.

Parameters
[in]indexPxBase index in [0, getNbObjects())
Returns
PxBase object at index index

Implements physx::PxCollection.

◆ getObjects()

PxU32 Collection::getObjects ( PxBase **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const
virtual

Copies member PxBase pointers to a user specified buffer.

Parameters
[out]userBufferArray of PxBase pointers
[in]bufferSizeCapacity of userBuffer
[in]startIndexOffset into list of member PxBase objects
Returns
number of members PxBase objects that have been written to the userBuffer

Implements physx::PxCollection.

◆ release()

void physx::Cm::Collection::release ( )
inlinevirtual

Deletes a collection object.

This function only deletes the collection object, i.e. the container class. It doesn't delete objects that are part of the collection.

See also
PxCreateCollection()

Implements physx::PxCollection.

◆ remove() [1/2]

void Collection::remove ( PxBase &  object)
virtual

Removes a PxBase member object from the collection.

Object needs to be contained by the collection.

Parameters
[in]objectPxBase object to be removed

Implements physx::PxCollection.

◆ remove() [2/2]

void Collection::remove ( PxCollection &  collection)
virtual

Removes all PxBase objects of collection from this collection.

PxBase objects not present in this collection are ignored. Ids of objects which are removed are also removed.

Parameters
[in]collectionCollection to be removed

Implements physx::PxCollection.

◆ removeId()

void Collection::removeId ( PxSerialObjectId  id)
virtual

Removes id from a contained PxBase object.

May only be called for ids that are associated with an object in the collection.

Parameters
[in]idPxSerialObjectId value

Implements physx::PxCollection.


The documentation for this class was generated from the following files: