19 #include <agx/config/AGX_USE_AGXTERRAIN.h>
27 class TerrainDataAtlas;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
#define AGXTERRAIN_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Class that handles and sanity checks the mass logic in the terrain.
void setFluidMass(const agx::Vec3i &voxelIndex, float fluidMass)
float removeFluidMass(const agx::Vec3i &voxelIndex, float fluidMass)
Add fluid mass in a voxel and return the rest mass if the voxel was filled.
float addFluidMass(const agx::Vec3i &voxelIndex, float fluidMass)
Add fluid mass in a voxel and return the rest mass if the voxel was filled.
float getCompactedSolidMass(const agx::Vec3i &voxelIndex) const
Get the compacted mass in a voxel.
float getParticleMass(const agx::Vec3i &voxelIndex) const
Get particle mass in a voxel.
float convertCompactedSolidMassToNominal(const agx::Vec3i &voxelIndex, float compactedOccupancy) const
Converts compacted mass to regular non-compacted mass given the specified voxel compaction.
float removeSolidMassFromColumn(const agx::Vec3i &surfaceVoxelIndex, float mass)
Remove solid mass column wise from surface of the terrain and return the amount of mass that was succ...
float getCompaction(const agx::Vec3i &voxelIndex) const
Get compaction in a voxel.
void setParticleMass(const agx::Vec3i &voxelIndex, float particleMass)
Set particle mass in a voxel.
float removeSolidMass(const agx::Vec3i &voxelIndex, float solidMass)
Remove solid mass from a voxel and return the amount of mass that could not be removed,...
int getSurfaceHeightIndex(const agx::Vec2i terrainIndex)
Get Z value of the surface voxel in the voxel grid structure.
float getFluidMass(const agx::Vec3i &voxelIndex) const
Get fluid mass in a voxel given an index.
float removeSolidMassFromColumn(const agx::Vec2i &voxelIndexXY, float mass)
Remove solid mass column wise from surface of the terrain and return the amount of mass that was succ...
agx::Real getMassInTerrain(size_t massType)
Get the total mass in the terrain of a specific mass type.
float getOccupancyModifier(agx::Vec3i voxelIndex) const
float getSolidMass(const agx::Vec3i &voxelIndex) const
Get the solid mass from a voxel.
void setCompaction(const agx::Vec3i &voxelIndex, float compaction, bool scaleMass=false)
Set compaction on a voxel.
void setGridColumnOccupancy(const agx::Vec2i terrainIndex, int voxelZ, float occupancy)
Set the which voxel is the surface voxel and what the occupancy is in that voxel.
bool verifyMassColumnIntegrity(const agx::Vec2i &voxelIndexXY)
Verify that a mass column in the terrain grid is properly filled, i.e that all submerged voxels under...
std::pair< int, float > getVoxelZAndOccupancyFromLocalHeight(agx::Real height, agx::Real voxelSize)
float addSolidMass(const agx::Vec3i &voxelIndex, float solidMass, float compaction, float occupancyLimit=1.0)
Add solid mass with a given compaction to a voxel and return the rest mass that could not fit.
agx::Real getTotalMassInTerrain()
Get the total mass in the terrain of a all mass types.
bool dilateMassInColumn(const agx::Vec3i &bottomVoxel, agx::Vec3i &newSurfaceVoxel)
Dilate material in a column from a bottom index up to surface.
TerrainMassController(Terrain *terrain)
Construct given terrain instance.
bool isTotalMassOverNominalThreshold(const agx::Vec3i &voxelIndex)
Checks if the total mass in the specified voxel exceeds the allowed nominal threshold.
float addSolidMassToColumn(const agx::Vec3i &surfaceVoxelIndex, float mass, float compaction)
Add solid mass with given compaction column wise on the surface of the terrain and return the amount ...
float removeFluidMassFromColumn(const agx::Vec2i &voxelIndexXY, float mass)
Remove fluid mass column wise from the surface of the terrain.
void setOccupancyInSurfaceVoxel(const agx::Vec2i terrainIndex, float occupancy)
Set occupancy in surface voxel.
float addFluidMassToColumn(const agx::Vec2i &voxelIndexXY, float mass)
Add fluid mass column wise on the surface of the terrain.
float addSolidMassToColumn(const agx::Vec2i &voxelIndexXY, float mass, float compaction)
Add solid mass with given compaction column wise on the surface of the terrain and return the amount ...
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Base class providing referencing counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT > HashTable