Support Forum G3D Web Page |
Allows creation of optimized watertight meshes from unoptimized polygon soups.
More...
Public Types | |
enum | { AUTO_WELD = -100 } |
Set setWeldRadius to AUTO_WELD to weld vertices closer than 1/2 the smallest edge length in a model. More... | |
Public Member Functions | |
MeshBuilder (bool twoSided=false, bool scaleAndCenter=true) | |
void | addQuad (const Vector3 &a, const Vector3 &b, const Vector3 &c, const Vector3 &d) |
Adds two new triangles to the model. More... | |
void | addTriangle (const Vector3 &a, const Vector3 &b, const Vector3 &c) |
Adds a new triangle to the model. More... | |
void | addTriangle (const Triangle &t) |
void | commit (String &name, Array< int > &indexArray, Array< Vector3 > &vertexArray) |
Writes the model to the arrays, which can then be used with G3D::IFSModel::save and G3D::MeshAlg. More... | |
void | setName (const String &n) |
void | setWeldRadius (double r) |
Vertices within this distance are considered identical. More... | |
Allows creation of optimized watertight meshes from unoptimized polygon soups.
See also G3D::MeshAlg for algorithms that operate on the output.
anonymous enum |
Set setWeldRadius to AUTO_WELD to weld vertices closer than 1/2 the smallest edge length in a model.
Enumerator | |
---|---|
AUTO_WELD |
|
inline |
void G3D::MeshBuilder::addQuad | ( | const Vector3 & | a, |
const Vector3 & | b, | ||
const Vector3 & | c, | ||
const Vector3 & | d | ||
) |
Adds two new triangles to the model.
(Counter clockwise)
Adds a new triangle to the model.
(Counter clockwise)
void G3D::MeshBuilder::addTriangle | ( | const Triangle & | t | ) |
void G3D::MeshBuilder::commit | ( | String & | name, |
Array< int > & | indexArray, | ||
Array< Vector3 > & | vertexArray | ||
) |
Writes the model to the arrays, which can then be used with G3D::IFSModel::save and G3D::MeshAlg.
void G3D::MeshBuilder::setName | ( | const String & | n | ) |
|
inline |
Vertices within this distance are considered identical.
Use AUTO_WELD (the default) to have the distance be a function of the model size.