17 #ifndef AGX_MARCHINGCUBES_H
18 #define AGX_MARCHINGCUBES_H
22 #include <agx/config/AGX_USE_OPENGL.h>
57 Real m_surfaceThreshold;
58 int m_sampleDimensions;
75 McVertex *vertices[8];
98 inline McVertex *operator() (
unsigned int x,
unsigned int y,
unsigned int z);
105 void updateSamplePoints(
Real surfaceThreshold);
110 SamplingCell *m_neighbors[26];
114 unsigned int m_emptyCounter;
115 Vec3 m_innerBoundsMin;
116 Vec3 m_innerBoundsMax;
117 unsigned int m_sampleDimensions;
#define AGXPHYSICS_EXPORT
Inheritance with partial specialization due to bug with ref_ptr containers.
const Vec3Vector & getParticles()
MarchingCubes(Real resolution, Real searchRadius, Real surfaceThreshold=-1)
void draw(Real surfaceThreshold)
const Vec3i & getId() const
void calculateSurface(Real surfaceThreshold, Vec3Vector &vertexBuffer)
void drawSurfaceVertices()
SamplingCell ** getNeighbors()
Vec3 interpolateEdgeVertex(int edge, Real invThreshold)
void addSurfaceVertices(Vec3Vector &resultBuffer, Real invThreshold)
void calculateType(Real surfaceThreshold)
const Vec3Vector & calculateSurface()
void addParticle(const Vec3 &particlePosition)
SamplingCell(const Vec3i &id, Real size, int sampleDimensions, SamplingCellHash &cellHash)
void addParticles(Vec3Vector &particlePositions)
void removeNeighborConnections()
void addNeighborConnections(SamplingCellHash &cellHash)
McVertex(const Vec3 &pos)
Base class providing referencing counted objects.
Smart pointer for handling referenced counted objects.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
ref_ptr< MarchingCubes > MarchingCubesRef
Vec2i calculateCellId(Real x, Real y, Real invCellSize)