![]() |
VR-Forces Developer's Guide
|
This is a helper class to manage sets of perGeomInstance objects associated with a model instance.
When an instance is added to this container using addInstance, a set of PerGeomInstance objects are created from a model template and associated with a "container" instance id. The container instance id is unique within this container and should not be confused with any other model instance id or model id.
A model template is associated with a model id and associated DtIndirectModelInfo object. This class also tracks how many unique geometries there are for a given model id.
The primary goal of this class is to provide PerGeometryInstance objects that will be copied into a GPU buffer for indirect rendering.
Public Member Functions | |
| DtInstanceContainer () | |
| virtual | ~DtInstanceContainer () |
| virtual void | addInstance (const int modelId, const DtPerGeomInstances &perGeomInstancesTemplate, int geometryLocations, int lightSourceCount, int &outContainerInstanceId, std::vector< PerGeomInstance * > &outPerGeomInstances) |
| virtual bool | removeInstance (int instanceId) |
| virtual bool | hasInstance (int instanceId) const |
| virtual const DtReusablePerGeomInstances & | perGeomInstances () const |
| virtual void | printPerGeomInstances () const |
| virtual int | numValidInstances () const |
| virtual int | numUniqueGeometriesForModel (int modelId) const |
| virtual int | numUniqueGeometries () const |
| virtual bool | instanceEverAdded () const |
| virtual const DtIndirectOffsetAndSize & | perGeomInstanceOffsetAndSize (int instanceId) const |
| virtual void | incrementNumUniqueGeometries (int number) |
| virtual const std::vector< int > & | modelAddedOrder () const |
| virtual unsigned int | maxNumLightSources () const |
| virtual void | setInstanceModelId (int instanceId, int modelId, const DtPerGeomInstances &perGeomInstancesTemplate) |
Protected Types | |
| typedef std::unordered_map < int, DtIndirectOffsetAndSize > | MapInstanceIdToPerGeomInstanceOffsetAndSize |
| typedef std::unordered_map < int, int > | MapInstanceIdToNumLightSources |
Private Member Functions | |
| DtInstanceContainer (const DtInstanceContainer &)=delete | |
| DtInstanceContainer & | operator= (const DtInstanceContainer &)=delete |
|
protected |
|
protected |
| makVrv::DtInstanceContainer::DtInstanceContainer | ( | ) |
CTOR.
|
virtual |
DTOR.
|
privatedelete |
not allowed
|
privatedelete |
not allowed
|
virtual |
add an instance Creates the PerGeomInstances needed from the template and associates them with an instance id. Outputs the container instance id and associated PerGeomInstances objects that were created. The outPerGeomInstances data should be considered temporary and only valid for the caller's immediate use (do not store pointers or references).
remove an instance with a given id
has an instance with a given id?
|
virtual |
returns the memory pool of PerGeomInstance objects
|
virtual |
For debugging. Print the contents.
|
virtual |
the current number of instances in use with this container
get the number of unique geometries that a particular model has
|
virtual |
tracks how many unique geometries there are, for use in buffer memory management
|
virtual |
was an instance ever added to this container? not the same as numValidInstances()
|
virtual |
access the per geom instance offset and size vector
|
virtual |
adds number to myNumUniqueGeometries
|
virtual |
get the vector of model ids in the order that they were added
get the maximum number of light sources that can possibly be rendered by this container
|
virtual |
set the model id of an instance This method is used to swap model texture variants that have the same geometry structure. Calling this method makes assumptions that the given model instance has been registered with this container, and that the given model template size matches the current model template size.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |