28 #ifndef __Ogre_Volume_IsoSurfaceMC_H__
29 #define __Ogre_Volume_IsoSurfaceMC_H__
61 if (fabs(val0.
w - ISO_LEVEL) <= FLT_EPSILON)
68 if (fabs(val1.
w - ISO_LEVEL) <= FLT_EPSILON)
75 if (fabs(val1.
w - val0.
w) <= FLT_EPSILON)
82 Real mu = (ISO_LEVEL - val0.
w) / (val1.
w - val0.
w);
83 Vector4 normal4 = val0 + mu * (val1 - val0);
88 return v0 + mu * (v1 - v0);
105 virtual void addMarchingSquaresTriangles(
const Vector3 *corners,
const Vector4 *volumeValues,
const size_t *indices,
const Real maxDistance,
MeshBuilder *mb)
const;
float Real
Software floating point type.
Abstract class defining the density function.
Marching Cubes implementation like at http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/.
Standard 3-dimensional vector.
Real normalise()
Normalises the vector.
Vector3 interpolate(const Vector3 &v0, const Vector3 &v1, const Vector4 &val0, const Vector4 &val1, Vector3 &normal) const
Linear interpolation between two vectors based on some values associated to them. ...
#define _OgreVolumeExport
4-dimensional homogeneous vector.
Class to build up a mesh with vertices and indices.