|
RavEngine
|
Collection class for serialization. More...
#include <PxCollection.h>
Public Member Functions | |
| virtual void | add (PxBase &object, PxSerialObjectId id=PX_SERIAL_OBJECT_ID_INVALID)=0 |
| Adds a PxBase object to the collection. | |
| virtual void | remove (PxBase &object)=0 |
| Removes a PxBase member object from the collection. | |
| virtual bool | contains (PxBase &object) const =0 |
| Returns whether the collection contains a certain PxBase object. | |
| virtual void | addId (PxBase &object, PxSerialObjectId id)=0 |
| Adds an id to a member PxBase object. | |
| virtual void | removeId (PxSerialObjectId id)=0 |
| Removes id from a contained PxBase object. | |
| virtual void | add (PxCollection &collection)=0 |
| Adds all PxBase objects and their ids of collection to this collection. | |
| virtual void | remove (PxCollection &collection)=0 |
| Removes all PxBase objects of collection from this collection. | |
| virtual PxU32 | getNbObjects () const =0 |
| Gets number of PxBase objects in this collection. | |
| virtual PxBase & | getObject (PxU32 index) const =0 |
| Gets the PxBase object of this collection given its index. | |
| virtual PxU32 | getObjects (PxBase **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
| Copies member PxBase pointers to a user specified buffer. | |
| virtual PxBase * | find (PxSerialObjectId id) const =0 |
| Looks for a PxBase object given a PxSerialObjectId value. | |
| virtual PxU32 | getNbIds () const =0 |
| Gets number of PxSerialObjectId names in this collection. | |
| virtual PxU32 | getIds (PxSerialObjectId *userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
| Copies member PxSerialObjectId values to a user specified buffer. | |
| virtual PxSerialObjectId | getId (const PxBase &object) const =0 |
| Gets the PxSerialObjectId name of a PxBase object within the collection. | |
| virtual void | release ()=0 |
| Deletes a collection object. | |
Collection class for serialization.
A collection is a set of PxBase objects. PxBase objects can be added to the collection regardless of other objects they depend on. Objects may be named using PxSerialObjectId values in order to resolve dependencies between objects of different collections.
Serialization and deserialization only work through collections.
A scene is typically serialized using the following steps:
For example the code may look like this:
A scene is typically deserialized using the following steps:
For example the code may look like this:
|
pure 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.
| [in] | object | Object to be added to the collection |
| [in] | id | Optional PxSerialObjectId id |
Implemented in physx::Cm::Collection.
|
pure 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.
| [in] | collection | Collection to be added |
Implemented in physx::Cm::Collection.
|
pure 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.
| [in] | object | Member PxBase object |
| [in] | id | PxSerialObjectId id to be given to the object |
Implemented in physx::Cm::Collection.
|
pure virtual |
Returns whether the collection contains a certain PxBase object.
| [in] | object | PxBase object |
Implemented in physx::Cm::Collection.
|
pure 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.
| [in] | id | PxSerialObjectId value to look for |
Implemented in physx::Cm::Collection.
|
pure virtual |
Gets the PxSerialObjectId name of a PxBase object within the collection.
The PxBase object needs to be a member of the collection.
| [in] | object | PxBase object to get id for |
Implemented in physx::Cm::Collection.
|
pure virtual |
Copies member PxSerialObjectId values to a user specified buffer.
| [out] | userBuffer | Array of PxSerialObjectId values |
| [in] | bufferSize | Capacity of userBuffer |
| [in] | startIndex | Offset into list of member PxSerialObjectId values |
Implemented in physx::Cm::Collection.
|
pure virtual |
Gets number of PxSerialObjectId names in this collection.
Implemented in physx::Cm::Collection.
|
pure virtual |
Gets number of PxBase objects in this collection.
Implemented in physx::Cm::Collection.
|
pure virtual |
Gets the PxBase object of this collection given its index.
| [in] | index | PxBase index in [0, getNbObjects()) |
Implemented in physx::Cm::Collection.
|
pure virtual |
Copies member PxBase pointers to a user specified buffer.
| [out] | userBuffer | Array of PxBase pointers |
| [in] | bufferSize | Capacity of userBuffer |
| [in] | startIndex | Offset into list of member PxBase objects |
Implemented in physx::Cm::Collection.
|
pure virtual |
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.
Implemented in physx::Cm::Collection.
|
pure virtual |
Removes a PxBase member object from the collection.
Object needs to be contained by the collection.
| [in] | object | PxBase object to be removed |
Implemented in physx::Cm::Collection.
|
pure 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.
| [in] | collection | Collection to be removed |
Implemented in physx::Cm::Collection.
|
pure virtual |
Removes id from a contained PxBase object.
May only be called for ids that are associated with an object in the collection.
| [in] | id | PxSerialObjectId value |
Implemented in physx::Cm::Collection.