68 bool =
true)
const override;
75 int lowestAllowedVoxelIndex,
102 std::function<
float(
const agx::Vec3i&)> getCompression,
103 std::function<
bool(
const agx::Vec2i&)> canRemoveIndex,
107 bool useParticleFreeDeformers)
override;
113 std::function<
float(
const agx::Vec3i&)> getCompression,
114 std::function<
bool(
const agx::Vec2i&)> canRemoveIndex,
118 bool useParticleFreeDeformers)
override;
157 size_t m_resolutionX;
158 size_t m_resolutionY;
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#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.
Pure virtual interface class for the data storage grid classes we have.
std::function< void(GridCoord, float)> GridFunction
Class implementing the BasicGrid interface.
virtual bool empty() override
Test if the trid is empty.
agx::Vec2i getResolution()
virtual bool hasIterateSupport() const override
virtual void iterateVoxels(GridFunction) const override
virtual agx::Real getTotal() const override
Returns the sum of all voxel values.
virtual agx::HashSet< agx::Vec3i > findConvexVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Convex *convex, agx::Real voxelSize) override
agxCollide::BoundingAABB getBoundingBox() const override
virtual float getFloatValue(const GridCoord &ijk) const override
Return value for voxel ijk.
virtual ActiveZoneIntersectionData removeVolumeInActiveZone(const agx::AffineMatrix4x4 &gridTransformation, const ActiveZoneShapes &activeZoneShapes, const MeshIntersectionTestData &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, agx::Real minAllowedHeight, bool useParticleFreeDeformers) override
virtual void sizeHint(size_t) override
Provide the implementation with a hint about the estimated number of voxels that are needed.
virtual GridCoordVector getActiveVoxelIndices() const override
virtual agx::Vec3 getElementSize() const override
Get the element size used for the voxel grid.
ColumnHeightGrid(const float defaultValue, const size_t resolutionX, const size_t resolutionY, const agx::Int depth, agx::Real voxelSize)
virtual void setValuesBelowHeightField(const agxCollide::HeightField *heightField, agx::Real voxelSize, int lowestAllowedVoxelIndex, BasicGrid *compactionGrid) override
virtual size_t getMemoryUsage() const override
Get the memory usage.
virtual void setFloatValue(const GridCoord &ijk, float value) override
Set value for voxel ijk.
virtual void clearGrid() override
Clear the grid.
virtual ActiveZoneIntersectionData removeVolumeInConvex(const agx::AffineMatrix4x4 &gridTransformation, const MeshIntersectionTestData &shape, const agx::Plane &innerShapeBoundary, const agx::Vec3iVector voxelsInPrimaryActiveZoneLastTimeStep, std::function< float(const agx::Vec3i &)> getCompression, std::function< bool(const agx::Vec2i &)> canRemoveIndex, agx::Real voxelSize, agx::Real minOccupancyRemoval, agx::Real minAllowedHeight, bool useParticleFreeDeformers) override
virtual agx::HashSet< agx::Vec3i > findVoxelsAboveTriangles(const agx::AffineMatrix4x4 &gridTransform, const TriangleVector &triangles, agx::Real voxelSize, agx::Real margin) override
std::pair< int, float > getVoxelZAndOccupancyFromLocalHeight(agx::Real height, agx::Real voxelSize)
virtual bool isActiveVoxel(const GridCoord &) const override
Test if voxel ijk is active.
void setOccupancyInSurfaceVoxel(const agx::Vec2i terrainIndex, float occupancy)
virtual agx::Vec3iVector findVoxelsInLineIntersection(const agx::Line &line) const override
agx::Vec3 getLocalPositionFromVoxelIndex(const agx::Vec3i &voxelIndex, agx::Real voxelSize) const
void setGridColumnOccupancy(const agx::Vec2i terrainIndex, int voxelZ, float occupancy)
virtual agx::HashSet< agx::Vec3i > findGeometryVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Geometry *geometry, agx::Real voxelSize, bool=true) const override
Find which voxels that overlap with a geometry.
virtual void findVoxelSurfaceFromIndex(const agx::Vec3i &index, agx::Vec3i &result) override
virtual size_t getNumActiveVoxels() const override
Return number of active voxels in the data structure.
int getSurfaceHeightIndex(const agx::Vec2i terrainIndex)
agx::Vec3i getVoxelIndexFromLocalPosition(agx::Vec3 position, agx::Real voxelSize) const
virtual std::tuple< float, float > getTotalAndLargest() const override
virtual bool findMeshVoxelIntersections(const agx::AffineMatrix4x4 &gridTransform, const agxCollide::Mesh *mesh, agx::Real voxelSize, agx::Vec3iVector &result) override
Extended pure virtual interface for Grid storage classes.
Class representing the mathematical concept of a plane, also called a half- space.
Vector containing 'raw' data.
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
std::tuple< const agxCollide::Mesh *, agx::AffineMatrix4x4, agxCollide::BoundingAABB > MeshIntersectionTestData