![]() |
VR-Forces Developer's Guide
|
Manages a bunch of 'cells' for a given cell size (similar to a sparse octree) each cell has a.
Classes | |
| struct | InstanceTrackingStruct |
Public Types | |
| enum | InstanceTrackingType { INSTANCE_ADD_REGULAR, INSTANCE_REMOVE_REGULAR, INSTANCE_ADD_MOVE_NEW_CELL, INSTANCE_REMOVE_MOVE_OLD_CELL, INSTANCE_REMOVE_MOVE_CANCEL_NEW_CELL, INSTANCE_REMOVE_CELL_PAGED_OUT } |
| using | MapCellIdsToIndirectGeometry = tbb::concurrent_hash_map< Vector3_int, osg::ref_ptr< DtIndirectEntityGeometry >, DtIndirectCellHasher > |
| using | MapCellIdsToDebugCellDrawables = std::unordered_map< Vector3_int, osg::ref_ptr< osg::Drawable >, DtIndirectCellHasher > |
| using | InstanceTrackingRequestsVector = tbb::concurrent_vector< InstanceTrackingStruct > |
Public Attributes | |
| friend | DtIndirectGeometryGridCreator |
Protected Member Functions | |
| DtIndirectGeometryGrid (DtDe &de, DtModelSetId modelSet) | |
Protected Attributes | |
| DtDe & | myDe |
| osg::ref_ptr< osg::Node > | myGridNode |
| osg::ref_ptr < DtIndirectGeometryRenderer > | myGridRenderer |
| MapCellIdsToIndirectGeometry | myMapCellIdsToIndirectGeometry |
| boost::mutex | myMapCellIdsToDebugCellDrawablesMutex |
| MapCellIdsToDebugCellDrawables | myMapCellIdsToDebugCellDrawables |
| DtIndirectModelsContainer * | myModelsContainer |
| Vector3_64 | myCellSize |
| Vector3_64 | myCellPadding |
| boost::mutex | myMapCellIdsToIndirectGeometryMutex |
| std::unordered_map < Vector3_int, std::unordered_map< int, int > , DtIndirectCellHasher > | myMapCellToModelInstances |
| std::unordered_map< int, int > | myModelIdToNumInstances |
| DtIndirectLimitTextureStrategy * | myLimitTextureStrategy |
| const DtModelSetId | myModelSet = DtModelSetId::Unspecified |
| AxisAlignedBoundingBox_64 | myInfiniteBoundingBox |
| InstanceTrackingRequestsVector | myInstanceTrackingRequests |
| bool | myMutexesEnabled |
Private Member Functions | |
| DtIndirectGeometryGrid ()=delete | |
| DtIndirectGeometryGrid (const DtIndirectGeometryGrid &other)=delete | |
| DtIndirectGeometryGrid & | operator= (const DtIndirectGeometryGrid &other)=delete |
| using makVrv::DtIndirectGeometryGrid::MapCellIdsToIndirectGeometry = tbb::concurrent_hash_map<Vector3_int, osg::ref_ptr<DtIndirectEntityGeometry>, DtIndirectCellHasher> |
The map of a cell 'id' to its corresponding indirect geometry.
| using makVrv::DtIndirectGeometryGrid::MapCellIdsToDebugCellDrawables = std::unordered_map<Vector3_int, osg::ref_ptr<osg::Drawable>, DtIndirectCellHasher > |
The map of a cell 'id' to its corresponding debug drawable.
| using makVrv::DtIndirectGeometryGrid::InstanceTrackingRequestsVector = tbb::concurrent_vector<InstanceTrackingStruct> |
Concurrent vector for storing indirect tracking info. As indirect geomtries can be created in multiple threads so can the tracking info Tracking requests are ticked in processInstanceTrackingRequests.
|
virtual |
DTOR.
|
protected |
CTOR.
|
privatedelete |
default constructor not implemented
|
privatedelete |
Copy Constructor not implemented – Copy Not Allowed.
|
privatedelete |
Assignment Operator Not implemented – Assignment Not Allowed.
|
virtual |
get an indirect geometry for this cell, or create one created parameter indicates whether this was created anew Called by the background update tickables which run in parallel so this function has a mutex in order to be thread safe
|
virtual |
Attempt to find an indirect geometry for this cell Can return nullptr.
|
virtual |
remove a cell and indirect geometry for the given cell
|
virtual |
get the cell id for a given position
|
virtual |
get the cell center of a given cell
|
virtual |
get AABB
|
virtual |
get AABB with padding
|
virtual |
get the internal models' container
|
virtual |
set/get the cell size
|
virtual |
set/get the cell size
|
virtual |
set/get the cell padding. If an entity position is out of a cell (as determined by cellIdFor(), then we can further determine if its still in the old cell expanded with this padding. This is useful for retaining the entity within an old cell, if they flip/flop on the edges of 2 cells (e.g. buoys)
|
virtual |
set/get the cell padding. If an entity position is out of a cell (as determined by cellIdFor(), then we can further determine if its still in the old cell expanded with this padding. This is useful for retaining the entity within an old cell, if they flip/flop on the edges of 2 cells (e.g. buoys)
|
virtual |
get the underlying top level grid node that is the parent of the indirect geometries
|
virtual |
get the map of cell ids to indirect geometries
|
virtual |
get the map of cell ids to indirect geometries (const version)
|
virtual |
Places a tracking request on InstanceTrackingRequestsVector. Thread safe.
|
virtual |
Iterates through myInstanceTrackingRequests calling trackInstances. Not thread safe.
|
virtual |
track the model ids to num of instances for a cell
|
virtual |
access
|
virtual |
access. non-const
| DtModelSetId makVrv::DtIndirectGeometryGrid::modelSet | ( | void | ) | const |
model set that this grid is for
|
virtual |
get the underlying top level grid renderer node that is used to draw the geometries
|
virtual |
utility
| friend makVrv::DtIndirectGeometryGrid::DtIndirectGeometryGridCreator |
only creator can created
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
the cell size
|
protected |
the cell 'padding'
|
protected |
|
protected |
map of a cell to a map of model ids to number of instances of those model ids, in the cell
map of model ids to number of instances of those model ids, for the entire grid
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |