VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtBallisticSpatialGrid Class Reference

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
 

Member Typedef Documentation

Map of cell IDs to their corresponding ballistic geometry objects.

Constructor & Destructor Documentation

virtual makVrv::DtBallisticSpatialGrid::~DtBallisticSpatialGrid ( )
virtual

Virtual destructor.

makVrv::DtBallisticSpatialGrid::DtBallisticSpatialGrid ( DtDe &  de,
DtModelSetId  modelSet 
)
protected

Protected constructor; use the creator factory to instantiate.

Parameters
deSimulation environment.
modelSetModel set this grid is associated with.
makVrv::DtBallisticSpatialGrid::DtBallisticSpatialGrid ( )
privatedelete

Default construction is not supported.

makVrv::DtBallisticSpatialGrid::DtBallisticSpatialGrid ( const DtBallisticSpatialGrid &  other)
privatedelete

Copy construction is not supported.

Member Function Documentation

DtBallisticSpatialGrid& makVrv::DtBallisticSpatialGrid::operator= ( const DtBallisticSpatialGrid &  other)
privatedelete

Copy assignment is not supported.

virtual osg::ref_ptr<osg::Node> makVrv::DtBallisticSpatialGrid::gridNode ( )
virtual

Returns the top-level OSG node that parents all ballistic geometry nodes.

virtual osg::ref_ptr<osg::Node> makVrv::DtBallisticSpatialGrid::gridRenderer ( )
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 const MapCellIdsToBallisticGeometry& makVrv::DtBallisticSpatialGrid::mapCellIdsToBallisticGeometry ( ) const
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 std::string makVrv::DtBallisticSpatialGrid::modelSetString ( ) const
virtual

Returns a string representation of the model set.

virtual void makVrv::DtBallisticSpatialGrid::update ( double  deltaTime)
virtual

Called each simulation tick; no-op in the single-cell implementation.

virtual Vector3_int makVrv::DtBallisticSpatialGrid::cellIdFor ( const Vector3_64 &  position) const
virtual

Returns the cell ID for the given world-space position.

Parameters
positionWorld-space position to look up.
Returns
Corresponding cell ID.
virtual DtBallisticGeometry* makVrv::DtBallisticSpatialGrid::ts_getOrCreateForCell ( const Vector3_int &  cellId,
bool &  created,
DtBallisticComputeComponent *  computeComponent 
)
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.

Parameters
cellIdCell coordinates.
createdSet to true if a new geometry was created.
computeComponentShared compute component to assign to a newly created geometry.
Returns
Pointer to the geometry for the given cell.

Member Data Documentation

friend makVrv::DtBallisticSpatialGrid::DtBallisticSpatialGridCreator

Only the creator can create instances.

DtDe& makVrv::DtBallisticSpatialGrid::myDe
protected

Reference to the simulation environment.

osg::ref_ptr<osg::Node> makVrv::DtBallisticSpatialGrid::myGridNode
protected

Top-level OSG node parenting all ballistic geometry nodes.

osg::ref_ptr<DtBallisticRenderer> makVrv::DtBallisticSpatialGrid::myGridRenderer
protected

OSG renderer node for drawing ballistic geometries.

const DtModelSetId makVrv::DtBallisticSpatialGrid::myModelSet
protected

Model set this grid is associated with.

AxisAlignedBoundingBox_64 makVrv::DtBallisticSpatialGrid::myInfiniteBoundingBox
protected

Infinite bounding box returned for all cells.

MapCellIdsToBallisticGeometry makVrv::DtBallisticSpatialGrid::myMapCellIdsToBallisticGeometry
protected

Map of cell IDs to their corresponding geometry objects.

std::mutex makVrv::DtBallisticSpatialGrid::myMapCellIdsToBallisticGeometryMutex
protected

Mutex protecting myMapCellIdsToBallisticGeometry during cell creation.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)