166 bool onlyOccupiedVoxels =
true,
167 bool onlyMidPoint =
false )
const = 0;
183 return VoxelGridUtils::getGridPositionFromVoxelIndex(voxelIndex, getElementSize().x());
192 return VoxelGridUtils::getVoxelIndexFromGridPosition(position, getElementSize().x());
214 int lowestAllowedVoxelIndex,
245 std::function<
float(
const agx::Vec3i&)> getCompression,
246 std::function<
bool(
const agx::Vec2i&)> canRemoveIndex,
250 bool useParticleFreeDeformers) = 0;
256 std::function<
float(
const agx::Vec3i& )> getCompression,
257 std::function<
bool(
const agx::Vec2i& )> canRemoveIndex,
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXTERRAIN_EXPORT
Axis aligned bounding box implementation.
A convex class for geometric intersection tests.
The geometry representation used by the collision detection engine.
A HeightField is a collision shape that can be created from a grid structure, like an image.
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Pure virtual interface class for the data storage grid classes we have.
void store(agxStream::OutputArchive &out) const override=0
virtual bool hasIterateSupport() const
virtual void iterateVoxels(GridFunction) const
void restore(agxStream::InputArchive &in) override=0
virtual agx::Vec3 getElementSize() const =0
Get the element size used for the voxel grid.
virtual std::tuple< float, float > getTotalAndLargest() const =0
virtual bool isActiveVoxel(const GridCoord &) const =0
Test if voxel ijk is active.
virtual bool empty()=0
Test if the trid is empty.
virtual float getFloatValue(const GridCoord &ijk) const =0
Return value for voxel ijk.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxTerrain::BasicGrid)
virtual size_t getMemoryUsage() const =0
Get the memory usage.
virtual void clearGrid()=0
Clear the grid.
virtual void setFloatValue(const GridCoord &ijk, float value)=0
Set value for voxel ijk.
virtual agx::HashSet< agx::Vec3i > findGeometryVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Geometry *geometry, agx::Real voxelSize, bool onlyOccupiedVoxels=true, bool onlyMidPoint=false) const =0
Find which voxels that overlap with a geometry.
virtual size_t getNumActiveVoxels() const =0
Return number of active voxels in the data structure.
agx::Vec3 getGridPositionFromVoxelIndex(const agx::Vec3i &voxelIndex) const
virtual agx::Real getTotal() const =0
Returns the sum of all voxel values.
virtual GridCoordVector getActiveVoxelIndices() const =0
agx::Vec3i getVoxelIndexFromGridPosition(agx::Vec3 position) const
std::function< void(GridCoord, float)> GridFunction
virtual void sizeHint(size_t)
Provide the implementation with a hint about the estimated number of voxels that are needed.
Extended pure virtual interface for Grid storage classes.
virtual agx::Vec3iVector findVoxelsInLine(const agx::Line &gridLine) const =0
virtual ActiveZoneIntersectionData removeVolumeInActiveZone(const agx::AffineMatrix4x4 &gridTransformation, const ActiveZoneShapes &activeZoneShapes, const ActiveZoneShapes &innerShape, const agx::Plane &innerShapeBoundary, const agx::Bound3 &activeZoneGeometryBound, const agx::Vec3iVector voxelsInPrimaryActiveZoneLastTimeStep, std::function< float(const agx::Vec3i &)> getCompression, std::function< bool(const agx::Vec2i &)> canRemoveIndex, agx::Real voxelSize, agx::Real minOccupancyRemoval, std::function< agx::Real(const agx::Vec2i &)> getMinAllowedHeight, bool useParticleFreeDeformers)=0
virtual bool findMeshVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Mesh *mesh, agx::Real voxelSize, agx::Vec3iVector &result)=0
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxTerrain::Grid)
virtual void findVoxelSurfaceFromIndex(const agx::Vec3i &index, agx::Vec3i &result)=0
virtual agx::HashSet< agx::Vec3i > findConvexVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Convex *convex, agx::Real voxelSize)=0
virtual agxCollide::BoundingAABB getBoundingBox() const =0
virtual agx::HashSet< agx::Vec3i > findVoxelsAboveTriangles(const agx::AffineMatrix4x4 &gridTransform, const TriangleVector &triangles, agx::Real voxelSize, agx::Real margin)=0
virtual ActiveZoneIntersectionData removeVolumeInShape(const agx::AffineMatrix4x4 &gridTransformation, const ShapeIntersectionTestData &shape, std::function< float(const agx::Vec3i &)> getCompression, std::function< bool(const agx::Vec2i &)> canRemoveIndex, std::function< bool(const agx::Vec3 &, const agx::Vec3i &)> isWithinBoundry, agx::Real voxelSize, agx::Real minOccupancyRemoval, std::function< agx::Real(const agx::Vec2i &)> getMinAllowedHeight)=0
virtual void setValuesBelowHeightField(const agxCollide::HeightField *heightField, agx::Real voxelSize, int lowestAllowedVoxelIndex, BasicGrid *compactionGrid)=0
A BoundT represents a range defined by a minimum and a maximum value.
Inheritance with partial specialization due to bug with ref_ptr containers.
Class representing the mathematical concept of a plane, also called a half- space.
Base class providing referencing counted objects.
Vector containing 'raw' data.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
agx::Vector< std::array< agx::Vec3, 3 > > TriangleVector
std::tuple< const agxCollide::Mesh *, agx::AffineMatrix4x4, agxCollide::BoundingAABB > MeshIntersectionTestData
std::tuple< const agxCollide::Shape *, agx::AffineMatrix4x4, agxCollide::BoundingAABB > ShapeIntersectionTestData
agx::Vector< MeshIntersectionTestData > ActiveZoneShapes
agx::Vec3iVector removedIndices
agx::Real32Vector removedOccupancy
agx::Bound3i indicesInActiveZone