20#if defined(SWIG) || AGX_USE_AGXTERRAIN()
27#include <osg/Drawable>
28#include <osgViewer/Viewer>
29#include <osgSim/ColorRange>
30#include <osgSim/ScalarsToColors>
264 bool useRelativeHeights =
false,
265 const osg::Vec4& lowColor = osg::Vec4( 0.0, 0.0, 1.0, 1.0 ),
266 const osg::Vec4& midColor = osg::Vec4( 0.0, 1.0, 0.0, 1.0 ),
267 const osg::Vec4& highColor = osg::Vec4( 1.0, 0.0, 0.0, 1.0 ) );
318 osg::ref_ptr<agxOSG::GeometryNode>
node;
353 bool m_useRelativeHeights =
false;
#define AGX_DECLARE_POINTER_TYPES(type)
A node that can be associated with a collision geometry so that the transformation of this node is up...
Rendering class for the agxTerrain::Terrain.
void setRenderVoxelFluidMass(bool enable)
Enable/disable rendering of fluid mass.
void setRenderVoxelBoundingBox(bool enable)
Enable/disable rendering of voxel bounding boxes.
std::vector< agx::Real > m_originalHeights
virtual void addNotification() override
Called when this listener is added to the simulation.
void setRenderTerrainMaterials(bool enable)
Enable/disable rendering of multiple terrain materials in the voxel grid.
void setVelocityFieldLineColor(const agx::Vec4 &lineColor)
Assign line color of velocity fields in the voxel renderer.
void setRenderCompaction(bool enable, agx::RangeReal compactionRange=agx::RangeReal(0.75, 1.5))
Enable/disable rendering of compaction.
void setTerrainMaterialsColors(const agxRender::ColorVector &colors)
Set the color array to use when rendering different terrain materials.
virtual void last(const agx::TimeStamp &) override
Called after a step is taken in the simulation Implement this method in the derived class to get call...
agxOSG::GeometryNode * getNode() const
agxTerrain::TerrainObserver m_terrain
bool getRenderVelocityField() const
void setRenderHeightField(bool enable)
Enable/disable rendering of the terrain.
SoilParticleMeshData m_soilParticleMeshData
bool getRenderVoxelBoundingBox() const
void setRenderHeights(bool enable, agx::RangeReal heightRange=agx::RangeReal(), bool useRelativeHeights=false, const osg::Vec4 &lowColor=osg::Vec4(0.0, 0.0, 1.0, 1.0), const osg::Vec4 &midColor=osg::Vec4(0.0, 1.0, 0.0, 1.0), const osg::Vec4 &highColor=osg::Vec4(1.0, 0.0, 0.0, 1.0))
Enable/disable rendering of terrain height using a scalar color range.
bool getRenderHeightField() const
void setMaxVoxelValueColor(const agx::Vec4f &maxVoxelColor)
Assign max value color of velocity fields in the voxel renderer.
bool getRenderTerrainMaterials() const
virtual ~TerrainVoxelRenderer()
void setRenderVoxelSolidMass(bool enable)
Enable/disable rendering of solid mass.
osg::ref_ptr< SoilParticleSystemDrawable > m_soilParticleDrawable
bool getRenderSoilParticlesMesh() const
bool getRenderDefaultTerrainMaterial() const
void setRenderVelocityField(bool enable)
Enable/disable rendering of the mass velocity field.
bool getRenderVoxelCompaction() const
void setColor(agx::Vec4f color)
Set color of the terrain.
static TerrainVoxelRenderer * find(const agxTerrain::Terrain *terrain, const agxSDK::Simulation *simulation)
Finds terrain renderer given terrain and simulation.
void setRenderSoilParticles(bool enable)
Enable/disable rendering of solid particles.
const agx::String & getSoilParticleMeshModelFilename() const
virtual void removeNotification() override
Called when this listener is removed from the simulation.
void setSoilParticleMeshData(const agx::String &modelFilename, const agx::String &textureFilename="")
Load soil particle mesh model and texture (optional).
void setRenderVoxelCompaction(bool enable)
Enable/disable rendering of compaction in the voxel grid.
agxRender::ColorVector getTerrainMaterialColors() const
Get the color array to use when rendering different terrain materials.
bool getRenderCompaction() const
void setRenderSoilParticlesMesh(bool enable)
Set enable render particles as triangle meshes.
TerrainVoxelRenderer(agxSDK::TerrainInstance *terrainInstance, osg::Group *group)
Construct a TerrainVoxel renderer given a terrain instance and a visual root.
agxTerrain::Terrain * getTerrain() const
bool getRenderSoilParticles() const
osg::ref_ptr< TerrainVoxelDrawable > m_voxelDrawable
const agx::String & getSoilParticleMeshTextureFilename() const
bool getRenderVoxelFluidMass() const
ContextData m_surfaceContextData
void setRenderDefaultTerrainMaterial(bool enable)
Enable/disable rendering of the default terrain material during rendering of terrain materials (see s...
bool getRenderHeights() const
bool getRenderVoxelSolidMass() const
ContextData m_heightsContextData
TerrainVoxelRenderer(agxTerrain::Terrain *terrain, osg::Group *group)
Construct a TerrainVoxel renderer given a terrain and a visual root.
agx::Vec4f getColor() const
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Derive from this class to implement a listener for simulation step events.
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
A class holding 4 dimensional vectors and providing basic arithmetic.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
AGXOSG_EXPORT void setupTerrainJournalPlaybackSettings(agxSDK::Simulation *simulation)
Setup journal playback settings for each TerrainVoxelRenderer in the specified simulation.
osg::ref_ptr< osgSim::ColorRange > colorRange
osg::ref_ptr< osg::Geode > geode
agx::Bool isValid() const
osg::ref_ptr< agxOSG::GeometryNode > node
osg::observer_ptr< osg::Group > parent
osg::ref_ptr< osg::Vec4Array > colorArray
osg::ref_ptr< osg::Geometry > geometry
osg::ref_ptr< osg::Node > node
osg::ref_ptr< osg::Group > group
agx::String textureFilename
agx::String modelFilename