19 #include <osg/Drawable>
20 #include <osg/Uniform>
22 #include <osg/StateSet>
24 #include <unordered_map>
36 class DtBallisticRenderer;
37 class DtBallisticDrawComponent;
38 class DtBallisticComputeComponent;
39 class DtBallisticRunTimeSettings;
40 class DtBallisticProjectile;
41 class DtBallisticRendererUserData;
87 virtual void setName(
const std::string& name)
override;
95 virtual const unsigned int id(
void)
const;
103 virtual const char* className()
const;
106 virtual void drawImplementation(osg::RenderInfo& renderInfo)
const;
114 virtual void debugDrawImplementation(osg::RenderInfo& renderInfo,
118 virtual void accept(osg::NodeVisitor& nv);
131 virtual void releaseGLObjects(osg::State* state)
const override;
134 virtual void accept(osg::PrimitiveFunctor& functor)
const override;
139 virtual void setLocalOriginTransform(
const osg::Matrixd& localOriginTransform);
147 virtual void perCameraUpdateAndCull(
const osg::Camera* camera,
const osg::Matrix& modelViewMatrix,
const osg::FrameStamp* frameStamp,
DtBallisticRendererUserData* userData);
165 virtual void removeProjectile(
int slot);
168 int projectileCount()
const;
176 bool hasSlot(
int slot)
const;
183 virtual void drawImplementation(osg::RenderInfo& renderInfo,
const osg::Matrixd& modelViewMatrix
184 ,
bool isLightBin,
bool isDepthBin,
bool isShadowPass
std::unordered_map< int, DtBallisticProjectile * > myActiveSlots
Map of active pool slot indices to their projectile pointers for this cell. Non-owning pointers; life...
Definition: DtBallisticGeometry.h:196
Vector3_int myCellId
Spatial cell ID assigned by DtBallisticSpatialGrid.
Definition: DtBallisticGeometry.h:209
std::atomic< int > myProjectileCount
Cached count of myActiveSlots.size(); written from the main thread, read from render threads...
Definition: DtBallisticGeometry.h:200
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::Matrixd myLocalOriginTransformMatrix
Local-origin transform matrix anchoring this geometry in world space.
Definition: DtBallisticGeometry.h:203
DtVirtualBaseClassCreator< DtBallisticGeometry, DtBallisticComputeComponent & > DtBallisticGeometryCreator
creator
Definition: DtBallisticGeometry.h:45
OSG Drawable that drives per-camera GPU cull and draw for a ballistic spatial cell.
Definition: DtBallisticGeometry.h:58
const char * creatorTypeName< DtBallisticGeometry >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtBallisticGeometry.h:52
OSG Drawable that batches and issues GPU draw calls for all ballistic geometries. ...
Definition: DtBallisticRenderer.h:46
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
const DtBallisticRunTimeSettings & myBallisticRunTimeSettings
Reference to the shared ballistic runtime settings.
Definition: DtBallisticGeometry.h:221
CPU-side pool slot descriptor for a single GPU-simulated bullet.
Definition: DtBallisticProjectile.h:23
DtBallisticDrawComponent * myDrawComponent
Shared draw component; non-owning pointer.
Definition: DtBallisticGeometry.h:214
DtBallisticRenderer * myBallisticRenderer
Non-owning pointer to the renderer that owns this geometry.
Definition: DtBallisticGeometry.h:218
Interface for the ballistic rendering draw pass.
Definition: DtBallisticDrawComponent.h:52
Interface for GPU compute operations driving the ballistic simulation pipeline.
Definition: DtBallisticComputeComponent.h:71
A generic OpenGL buffer. This can be: -> a vertex buffer -> an index buffer -> a shader storage buffe...
Definition: DtGlBuffer.h:29
DtBallisticComputeComponent * myComputeComponent
Shared compute component used for GPU dispatches; non-owning and set to null by shutdown() after the ...
Definition: DtBallisticGeometry.h:191
DtDe & myDe
Reference to the simulation environment.
Definition: DtBallisticGeometry.h:188
Singleton holding runtime-tweakable settings for the ballistic system.
Definition: DtBallisticRunTimeSettings.h:43
Contains DLL export macros.
Per-camera data used by DtBallisticRenderer to drive GPU cull and draw for one camera.
Definition: DtBallisticRendererUserData.h:71
osg::ref_ptr< osg::StateSet > myDrawStateSet
OSG state set applied during the draw pass.
Definition: DtBallisticGeometry.h:212
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
friend DtBallisticGeometryCreator
Definition: DtBallisticGeometry.h:61
unsigned int myId
Unique integer ID for this geometry instance.
Definition: DtBallisticGeometry.h:206