297 TerrainDataAtlas* getData() const;
301 agx::HashTable<
agx::Vec3i,
float> m_occupancyModifiers;
#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.
GridElement getVoxelZAndOccupancyFromLocalHeight(agx::Real height)
float getCompaction(const agx::Vec3i &voxelIndex) const
Get compaction in a voxel.
void setFluidOccupancy(const agx::Vec3i &voxelIndex, float fluidMass)
int getSurfaceHeightIndex(const agx::Vec2i terrainIndex) const
Get Z value of the surface voxel in the voxel grid structure.
float getParticleOccupancy(const agx::Vec3i &voxelIndex) const
Get particle mass in a voxel.
TerrainMassOccupancyController(Terrain *terrain)
Construct given terrain instance.
void setCompaction(const agx::Vec3i &voxelIndex, float compaction, bool scaleMass=false)
Set compaction on a voxel.
float addSolidMassKgToColumn(const agx::Vec2i &terrainIndex, float massKg, float compaction)
Add solid mass (in kg) column wise on the surface of the terrain using the specified compaction.
bool verifyOccupancyColumnIntegrity(const agx::Vec2i &terrainIndex) const
Verify that a mass column in the terrain grid is properly filled, i.e that all submerged voxels under...
float addSolidOccupancyToColumn(const agx::Vec2i &terrainIndex, float occupancy, float compaction)
Add solid mass with given compaction column wise on the surface of the terrain and return the amount ...
float addFluidOccupancy(const agx::Vec3i &voxelIndex, float fluidMass)
Add fluid mass in a voxel and return the rest mass if the voxel was filled.
agx::Real getOccupancyInTerrain(TerrainDataAtlas::MassType massType) const
Get the total mass in the terrain of a specific mass type.
float addSolidOccupancy(const agx::Vec3i &voxelIndex, float solidOccupancy, 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.
float getCompactedSolidOccupancy(const agx::Vec3i &voxelIndex) const
Get the compacted mass in a voxel.
bool dilateOccupancyInColumn(const agx::Vec3i &bottomVoxel, agx::Vec3i &newSurfaceVoxel)
Dilate material in a column from a bottom index up to surface.
float removeOccupancyFromColumn(const agx::Vec2i &terrainIndex, float occupancy)
Remove solid mass (in kg) column wise from the surface of the terrain.
void setOccupancyInSurfaceVoxel(const agx::Vec2i terrainIndex, float occupancy)
Set occupancy in surface voxel.
float removeFluidOccupancy(const agx::Vec3i &voxelIndex, float fluidMass)
Add fluid mass in a voxel and return the rest mass if the voxel was filled.
TerrainMassOccupancyController()
float getSolidOccupancy(const agx::Vec3i &voxelIndex) const
Get the solid mass from a voxel.
float getFluidOccupancy(const agx::Vec3i &voxelIndex) const
Get fluid mass in a voxel given an index.
float getOccupancyModifier(agx::Vec3i voxelIndex) const
float convertCompactedSolidOccupancyToNominal(const agx::Vec3i &voxelIndex, float compactedOccupancy) const
Converts compacted mass to regular non-compacted mass given the specified voxel compaction.
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 isTotalOccupancyOverNominalThreshold(const agx::Vec3i &voxelIndex) const
Checks if the total mass in the specified voxel exceeds the allowed nominal threshold.
float addFluidOccupancyToColumn(const agx::Vec2i &terrainIndex, float mass)
Add fluid mass column wise on the surface of the terrain.
float removeSolidOccupancyFromColumn(const agx::Vec2i &terrainIndex, float mass)
Remove solid mass column wise from surface of the terrain and return the amount of mass that was succ...
void setParticleOccupancy(const agx::Vec3i &voxelIndex, float particleMass)
Set particle mass in a voxel.
float addSolidOccupancyToColumn(const agx::Vec3i &surfaceVoxelIndex, float occupancy, float compaction)
Add solid mass with given compaction column wise on the surface of the terrain and return the amount ...
float removeSolidOccupancyFromColumn(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 removeSolidOccupancy(const agx::Vec3i &voxelIndex, float solidOccupancy)
Remove solid mass from a voxel and return the amount of mass that could not be removed,...
float removeFluidOccupancyFromColumn(const agx::Vec2i &terrainIndex, float mass)
Remove fluid mass column wise from the surface of the terrain.
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.