66 :i(v.x()), j(v.y()), k(v.z()){}
83 virtual agx::Vec3 getElementSize()
const = 0;
85 virtual size_t getMemoryUsage()
const = 0;
87 virtual size_t getNumActiveVoxels()
const = 0;
93 virtual void setValuesBelowHeightField(
96 int lowestAllowedVoxelIndex,
97 Grid* compactionGrid ) = 0;
105 float emptyValue) = 0;
110 bool onlyOccupiedVoxels =
true )
const = 0;
123 const TriangleVector& triangles,
127 const TriangleVector& triangles,
131 virtual bool findTriangleListVoxelIntersectionsParallel(
const agx::AffineMatrix4x4& gridTransform,
132 const agx::Vector<std::array<agx::Vec3, 3>>& triangles,
142 const ActiveZoneShapes& activeZoneShapes,
143 const MeshIntersectionTestData& innerShapeInfo,
148 std::function<
float(
const agx::Vec3i&)> getCompression,
149 std::function<
bool(
const agx::Vec2i&)> canRemoveIndex,
153 bool useParticleFreeDeformers) = 0;
157 virtual void setFloatValue(
const GridCoord& ijk,
float value) = 0;
159 virtual float getFloatValue(
const GridCoord& ijk)
const = 0;
161 virtual bool isActiveVoxel(
const GridCoord& ijk)
const = 0;
163 virtual float getTotal()
const = 0;
165 virtual agx::Real getTotalReal()
const = 0;
167 virtual std::tuple<float, float> getTotalAndLargest()
const = 0;
169 virtual void deepCopyGrid(
const Grid& grid) = 0;
171 virtual GridRef clone()
const = 0;
173 virtual void combine2(
const Grid* other1,
const Grid* other2) = 0;
175 virtual void combine(
const Grid* other1) = 0;
177 virtual bool findVoxelSurfaceFromIndex(
const agx::Vec3i& index,
agx::Vec3i& result,
bool globalSearch =
false) =0;
179 virtual void clearGrid() = 0;
181 virtual bool empty() = 0;
185 virtual void store( std::ostream&
out )
const = 0;
186 virtual void restore( std::istream&
in ) = 0;
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
A BoundT represents a range defined by a minimum and a maximum value.
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
std::tuple< const agxCollide::Mesh *, agx::AffineMatrix4x4, agxCollide::BoundingAABB > MeshIntersectionTestData
agx::Bound3i indicesInActiveZone
const GridCoord operator+(const GridCoord &rhs) const
agx::Real32Vector removedOccupancy
#define AGX_DECLARE_POINTER_TYPES(type)
Class representing the mathematical concept of a plane, also called a half- space.
Pure virtual interface class for the data storage grid classes we have.
agx::Vec3iVector removedIndices
#define AGXTERRAIN_PLUGIN_EXPORT
Base class providing referencing counted objects.
The geometry representation used by the collision detection engine.
Vector containing 'raw' data.
GridCoord(agx::Int i, agx::Int j, agx::Int k)
agx::Vector< MeshIntersectionTestData > ActiveZoneShapes
Container for holding a grid coordinate.
agx::VectorPOD< Grid::GridCoord > GridCoordVector
GridRef(*)(float defaultValue, agx::Real voxelSize) Factory
GridCoord(const agx::Vec3i &v)
agx::ref_ptr< Grid > GridRef
agx::Vector< std::array< agx::Vec3, 3 > > TriangleVector
Axis aligned bounding box implementation.
AGXOSG_EXPORT osg::Geometry * createGrid(unsigned int resU, unsigned int resV, const osg::Vec3 &origin, const osg::Vec3 &endPointX, const osg::Vec3 &endPointY, bool wireFrameMode=false)
Create a uniform grid.
A HeightField is a collision shape that can be created from a grid structure, like an image...