VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBallisticSpatialGrid.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
16 
18 
19 #include <vrvMath/DtVector3.h>
21 
22 #include <osg/Node>
23 
24 #include <tbb/concurrent_hash_map.h>
25 
26 #include <mutex>
27 #include <unordered_map>
28 
29 namespace makVrv
30 {
31  class DtDe;
32  class DtBallisticGeometry;
33  class DtBallisticRenderer;
34  class DtBallisticComputeComponent;
35 
38 
41 
43  template <>
44  inline const char* creatorTypeName<DtBallisticSpatialGrid>(void) { return "DtBallisticSpatialGridCreator"; }
45 
51  {
52  public:
54  using MapCellIdsToBallisticGeometry = tbb::concurrent_hash_map<Vector3_int, osg::ref_ptr<DtBallisticGeometry>, DtIndirectCellHasher>;
55 
56  public:
59 
61  virtual ~DtBallisticSpatialGrid();
62 
63  protected:
69 
70  private:
72  DtBallisticSpatialGrid() = delete;
73 
75  DtBallisticSpatialGrid(const DtBallisticSpatialGrid& other) = delete;
76 
78  DtBallisticSpatialGrid& operator=(const DtBallisticSpatialGrid& other) = delete;
79 
80  public:
82  virtual osg::ref_ptr<osg::Node> gridNode();
83 
85  virtual osg::ref_ptr<osg::Node> gridRenderer();
86 
92  void shutdown();
93 
95  virtual const MapCellIdsToBallisticGeometry& mapCellIdsToBallisticGeometry() const;
96 
98  DtModelSetId modelSet() const;
99 
101  virtual std::string modelSetString() const;
102 
104  virtual void update(double deltaTime);
105 
110  virtual Vector3_int cellIdFor(const Vector3_64& position) const;
111 
120  virtual DtBallisticGeometry* ts_getOrCreateForCell(const Vector3_int& cellId, bool& created, DtBallisticComputeComponent* computeComponent);
121 
122  protected:
125 
128 
131 
134 
137 
142  };
143 } // namespace makVrv
DtVirtualBaseClassCreator< DtBallisticSpatialGrid, const DtModelSetId & > DtBallisticSpatialGridCreator
creator
Definition: DtBallisticSpatialGrid.h:37
const DtModelSetId myModelSet
Model set this grid is associated with.
Definition: DtBallisticSpatialGrid.h:133
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
OSG Drawable that drives per-camera GPU cull and draw for a ballistic spatial cell.
Definition: DtBallisticGeometry.h:58
DtDe & myDe
Reference to the simulation environment.
Definition: DtBallisticSpatialGrid.h:124
3 dimensional vector
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
Axis Aligned Bounding Box class.
friend DtBallisticSpatialGridCreator
Only the creator can create instances.
Definition: DtBallisticSpatialGrid.h:58
AxisAlignedBoundingBox_64 myInfiniteBoundingBox
Infinite bounding box returned for all cells.
Definition: DtBallisticSpatialGrid.h:136
Spatial grid that owns and manages DtBallisticGeometry cells.
Definition: DtBallisticSpatialGrid.h:50
const char * creatorTypeName< DtBallisticSpatialGrid >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtBallisticSpatialGrid.h:44
Interface for GPU compute operations driving the ballistic simulation pipeline.
Definition: DtBallisticComputeComponent.h:71
tbb::concurrent_hash_map< Vector3_int, osg::ref_ptr< DtBallisticGeometry >, DtIndirectCellHasher > MapCellIdsToBallisticGeometry
Map of cell IDs to their corresponding ballistic geometry objects.
Definition: DtBallisticSpatialGrid.h:54
osg::ref_ptr< DtBallisticRenderer > myGridRenderer
OSG renderer node for drawing ballistic geometries.
Definition: DtBallisticSpatialGrid.h:130
osg::ref_ptr< osg::Node > myGridNode
Top-level OSG node parenting all ballistic geometry nodes.
Definition: DtBallisticSpatialGrid.h:127
MapCellIdsToBallisticGeometry myMapCellIdsToBallisticGeometry
Map of cell IDs to their corresponding geometry objects.
Definition: DtBallisticSpatialGrid.h:139
std::mutex myMapCellIdsToBallisticGeometryMutex
Mutex protecting myMapCellIdsToBallisticGeometry during cell creation.
Definition: DtBallisticSpatialGrid.h:141
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
DtModelSetId
Definition: DtModelSetEnums.h:19
hash for Vector3Int (cell ids), so that we can map cell ids to the corresponding indirect geometry ...
Definition: DtIndirectCellHasher.h:19
Contains makVrv::DtIndirectCellHasher class.
Contains various enum classes relating to model sets.

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)