26 #include <osg/Drawable>
27 #include <osg/Version>
79 virtual const char*
className()
const {
return "TerrainVoxelDrawable"; }
82 #if OSG_VERSION_GREATER_OR_EQUAL(3,4,0)
83 virtual osg::BoundingSphere computeBound()
const;
84 virtual osg::BoundingBox computeBoundingBox()
const;
107 bool enableVelocityFieldRendering,
117 bool enableRenderVoxelSolidMass,
118 bool enableRenderVoxelFluidMass,
119 bool enableRenderVoxelCompaction,
133 bool enableRenderVoxelBoundingBox);
Abstract representation of a data buffer.
Internal drawable class for drawing the Voxel grid structure.
bool m_enableRenderVoxelCompaction
virtual osg::Object * clone(const osg::CopyOp &) const
TerrainVoxelDrawable(agxTerrain::Terrain *terrain)
bool getRenderVelocityField() const
agx::Vec4f m_maxVoxelColor
agxData::BufferRef m_verticesBuffer
osg::ref_ptr< osgSim::ColorRange > m_colorRange
agxData::BufferRef m_nodesFirstBuffer
void renderVelocityTableLines(const agxTerrain::BasicGrid *solid, const agx::AffineMatrix4x4 &terrainTransform, const agx::HashTable< agx::Vec3i, agx::Vec3f > &velocityTable, agx::Real elementSize, bool enableVelocityFieldRendering, agxData::Buffer *linePositions, agxData::Buffer *lineOffsets)
agxData::BufferRef m_voxelSizeBuffer
bool m_enableRenderVoxelSolidMass
virtual osg::BoundingBox computeBound() const
Compute the bounding box around Drawables's geometry.
void renderVoxels(const agxTerrain::BasicGrid *solid, const agxTerrain::BasicGrid *fluid, const agxTerrain::BasicGrid *compaction, const agx::AffineMatrix4x4 &terrainTransform, agx::Real elementSize, bool enableRenderVoxelSolidMass, bool enableRenderVoxelFluidMass, bool enableRenderVoxelCompaction, agxData::Buffer *verticesBuffer, agxData::Buffer *colorBuffer, agxData::Buffer *voxelSizeBuffer, agxData::Buffer *enableRenderBuffer, std::function< agx::Vec4f(float)> getColor)
virtual const char * className() const
bool m_enableVelocityFieldRendering
agxData::BufferRef m_nodesColorBuffer
agxData::BufferRef m_nodesCountBuffer
agx::TaskRef m_lineKernel
bool getRenderVoxelCompaction() const
bool m_enableRenderVoxelBoundingBox
agx::TaskGroupRef m_renderTask
bool hasEnabledFeatures() const
agxData::BufferRef m_lineOffsets
void setRenderVoxelSolidMass(bool enable)
void setVelocityFieldLineColor(const agx::Vec4 &lineColor)
bool getRenderVoxelSolidMass() const
virtual bool isSameKindAs(const osg::Object *obj) const
bool getRenderVoxelFluidMass() const
agxTerrain::TerrainRef m_terrain
agxData::BufferRef m_voxelEnableRenderBuffer
void onRemoveNotification(agxSDK::Simulation *simulation)
void setMaxVoxelValueColor(const agx::Vec4f &maxVoxelColor)
bool isInitialized() const
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
The actual draw method for the merged bodies.
void setRenderVoxelFluidMass(bool enable)
virtual osg::Object * cloneType() const
void onAddNotification(agxSDK::Simulation *simulation)
bool m_enableRenderVoxelFluidMass
void setRenderVelocityField(bool enable)
virtual ~TerrainVoxelDrawable()
void setRenderVoxelCompaction(bool enable)
agxData::BufferRef m_linePositions
agxData::BufferRef m_colorBuffer
bool getRenderVoxelBoundingBox() const
void setRenderVoxelBoundingBox(bool enable)
void renderInternalNodes(const agxTerrain::BasicGrid *solid, const agx::AffineMatrix4x4 &terrainTransform, agxData::Buffer *nodesVertices, agxData::Buffer *nodesColorBuffer, agxData::Buffer *nodesFirstBuffer, agxData::Buffer *nodesCountBuffer, bool enableRenderVoxelBoundingBox)
agxData::BufferRef m_nodesVertices
virtual const char * libraryName() const
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Pure virtual interface class for the data storage grid classes we have.
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Inheritance with partial specialization due to bug with ref_ptr containers.
A class holding 4 dimensional vectors and providing basic arithmetic.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.