![]() |
VR-Forces Developer's Guide
|
Spatial grid that owns and manages DtBallisticGeometry cells.
Routes per-camera cull, draw, and proximity queries through a single-cell geometry that delegates all spatial work to the GPU.
Public Types | |
| using | MapCellIdsToBallisticGeometry = tbb::concurrent_hash_map< Vector3_int, osg::ref_ptr< DtBallisticGeometry >, DtIndirectCellHasher > |
Public Member Functions | |
| virtual | ~DtBallisticSpatialGrid () |
| virtual osg::ref_ptr< osg::Node > | gridNode () |
| virtual osg::ref_ptr< osg::Node > | gridRenderer () |
| void | shutdown () |
| virtual const MapCellIdsToBallisticGeometry & | mapCellIdsToBallisticGeometry () const |
| DtModelSetId | modelSet () const |
| virtual std::string | modelSetString () const |
| virtual void | update (double deltaTime) |
| virtual Vector3_int | cellIdFor (const Vector3_64 &position) const |
| virtual DtBallisticGeometry * | ts_getOrCreateForCell (const Vector3_int &cellId, bool &created, DtBallisticComputeComponent *computeComponent) |
Public Attributes | |
| friend | DtBallisticSpatialGridCreator |
Protected Member Functions | |
| DtBallisticSpatialGrid (DtDe &de, DtModelSetId modelSet) | |
Protected Attributes | |
| DtDe & | myDe |
| osg::ref_ptr< osg::Node > | myGridNode |
| osg::ref_ptr< DtBallisticRenderer > | myGridRenderer |
| const DtModelSetId | myModelSet |
| AxisAlignedBoundingBox_64 | myInfiniteBoundingBox |
| MapCellIdsToBallisticGeometry | myMapCellIdsToBallisticGeometry |
| std::mutex | myMapCellIdsToBallisticGeometryMutex |
Private Member Functions | |
| DtBallisticSpatialGrid ()=delete | |
| DtBallisticSpatialGrid (const DtBallisticSpatialGrid &other)=delete | |
| DtBallisticSpatialGrid & | operator= (const DtBallisticSpatialGrid &other)=delete |
| using makVrv::DtBallisticSpatialGrid::MapCellIdsToBallisticGeometry = tbb::concurrent_hash_map<Vector3_int, osg::ref_ptr<DtBallisticGeometry>, DtIndirectCellHasher> |
Map of cell IDs to their corresponding ballistic geometry objects.
|
virtual |
Virtual destructor.
|
protected |
Protected constructor; use the creator factory to instantiate.
| de | Simulation environment. |
| modelSet | Model set this grid is associated with. |
|
privatedelete |
Default construction is not supported.
|
privatedelete |
Copy construction is not supported.
|
privatedelete |
Copy assignment is not supported.
|
virtual |
Returns the top-level OSG node that parents all ballistic geometry nodes.
|
virtual |
Returns the OSG renderer node used to draw all geometries.
| void makVrv::DtBallisticSpatialGrid::shutdown | ( | ) |
Neutralizes every owned DtBallisticGeometry cell's compute-component back-reference.
Calls shutdown() on each non-null cell, making their cull and draw paths safe no-ops. Must be called before the shared DtBallisticComputeComponent is deleted on a display-config reload, since the cells hold a non-owning pointer to that component.
|
virtual |
Returns the map of cell IDs to ballistic geometry objects.
| DtModelSetId makVrv::DtBallisticSpatialGrid::modelSet | ( | ) | const |
Returns the model set this grid is associated with.
|
virtual |
Returns a string representation of the model set.
|
virtual |
Called each simulation tick; no-op in the single-cell implementation.
|
virtual |
Returns the cell ID for the given world-space position.
| position | World-space position to look up. |
|
virtual |
Returns the geometry for the given cell, creating it if necessary.
Thread-safe. The created parameter is set to true if a new geometry was created.
| cellId | Cell coordinates. |
| created | Set to true if a new geometry was created. |
| computeComponent | Shared compute component to assign to a newly created geometry. |
| friend makVrv::DtBallisticSpatialGrid::DtBallisticSpatialGridCreator |
Only the creator can create instances.
|
protected |
Reference to the simulation environment.
|
protected |
Top-level OSG node parenting all ballistic geometry nodes.
|
protected |
OSG renderer node for drawing ballistic geometries.
|
protected |
Model set this grid is associated with.
|
protected |
Infinite bounding box returned for all cells.
|
protected |
Map of cell IDs to their corresponding geometry objects.
|
protected |
Mutex protecting myMapCellIdsToBallisticGeometry during cell creation.