#include <iMeshBuilder.h>
|
| iMeshBuilder () |
|
| ~iMeshBuilder () |
|
void | setMatrix (const iaMatrixf &matrix) |
|
void | multMatrix (const iaMatrixf &matrix) |
|
void | getMatrix (iaMatrixf &matrix) |
|
void | calcBoundingBox (iAABoxd &bbox) const |
|
uint32 | addVertex (const iaVector3f &vertex) |
|
uint32 | addVertex (const iaVector4f &vertex) |
|
void | setNormal (uint32 index, const iaVector3f &normal) |
|
void | accumulateNormal (uint32 index, const iaVector3f &normal) |
|
void | setColor (uint32 index, const iaColor4f &color) |
|
void | setTexCoord (const iaVector2f &texCoord, uint32 unit) |
|
void | setTexCoord (uint32 index, const iaVector2f &texCoord, uint32 unit) |
|
uint32 | addTriangle (const uint32 indexA, const uint32 indexB, const uint32 indexC, const uint32 indexOffset=0) |
|
void | setJoinVertexes (bool joinVertexes=true) |
|
void | normalizeNormals () |
|
bool | getJoinVertexes () |
|
uint32 | getVertexCount () const |
|
uint32 | getTrianglesCount () const |
|
uint32 | getTextureUnitCount () const |
|
const std::vector< iaVector3f > & | getVertexes () const |
|
const std::vector< iaVector3f > & | getNormals () const |
|
const std::vector< iIndexedTriangle > & | getTriangles () const |
|
bool | hasNormals () const |
|
bool | hasColors () const |
|
void | calcNormals (bool sharpEdges=false) |
|
iMeshPtr | createMesh () |
|
iMeshPtr | createMesh (const std::vector< uint32 > &triangles) |
|
void | clear () |
|
void | copyTriangles (std::vector< uint32 > srcTriangleIndexes, iMeshBuilder &dst) |
|
void | calcSphericalTexcoordsByNormals (int texunit, float32 scale=1.0f) |
|
void | calcSphericalTexcoordsByPosition (const iaVector3f ¢er, int texunit, float32 scale=1.0f) |
|
void | calcPlanarTextureCoordinates (const iaVector3f ¢er, iaAxis direction, int texunit, float32 scale=1.0f) |
|
void | cleanup () |
|
builds up a mesh and spits out iMesh
◆ iMeshBuilder()
igor::iMeshBuilder::iMeshBuilder |
( |
| ) |
|
◆ ~iMeshBuilder()
igor::iMeshBuilder::~iMeshBuilder |
( |
| ) |
|
◆ accumulateNormal()
void igor::iMeshBuilder::accumulateNormal |
( |
uint32 |
index, |
|
|
const iaVector3f & |
normal |
|
) |
| |
accumulates normal values for specified index
- Parameters
-
index | the index of vertex to manipulate |
normal | the normal vector to accumulate |
◆ addTriangle()
adds indexes of a triangle to the data
- Parameters
-
indexA | first point of triangle |
indexB | second point of triangle |
indexC | third point of triangle |
indexOffset | index offset |
- Returns
- index of triangle created
◆ addVertex() [1/2]
adds vertex to data
- Parameters
-
- Returns
- index of vertex added
◆ addVertex() [2/2]
adds vertex to data
ignores the 4th component
- Parameters
-
- Returns
- index of vertex added
◆ calcBoundingBox()
void igor::iMeshBuilder::calcBoundingBox |
( |
iAABoxd & |
bbox | ) |
const |
calculating the bounding box
◆ calcNormals()
void igor::iMeshBuilder::calcNormals |
( |
bool |
sharpEdges = false | ) |
|
calculates normals for mesh
- Parameters
-
sharpEdges | if true sharp edges will cause plit of neighbor triangles for more realistic representation |
◆ calcPlanarTextureCoordinates()
void igor::iMeshBuilder::calcPlanarTextureCoordinates |
( |
const iaVector3f & |
center, |
|
|
iaAxis |
direction, |
|
|
int |
texunit, |
|
|
float32 |
scale = 1.0f |
|
) |
| |
calculates planar texture coordinates from specified axis aligned direction
- Parameters
-
center | it kind of works like an offset |
direction | the axis in which we project the texture coordinates |
texunit | the destination texture unit |
scale | the texture coordinate scale |
◆ calcSphericalTexcoordsByNormals()
void igor::iMeshBuilder::calcSphericalTexcoordsByNormals |
( |
int |
texunit, |
|
|
float32 |
scale = 1.0f |
|
) |
| |
calculates spherical texture coordinates based on vertex normal orientation
- Parameters
-
texunit | texture unit to put the result in |
scale | scaling the texture coordinates |
◆ calcSphericalTexcoordsByPosition()
void igor::iMeshBuilder::calcSphericalTexcoordsByPosition |
( |
const iaVector3f & |
center, |
|
|
int |
texunit, |
|
|
float32 |
scale = 1.0f |
|
) |
| |
calculates spherical texture coordinate based on vertex position relative to center
- Parameters
-
center | the center the calculation bases on |
texunit | the texture unit to put the result in |
scale | scaling the texture coordinates |
◆ cleanup()
void igor::iMeshBuilder::cleanup |
( |
| ) |
|
tries to repair what is inconsistent
◆ clear()
void igor::iMeshBuilder::clear |
( |
| ) |
|
clears data and set transformation matrix to identity
◆ copyTriangles()
void igor::iMeshBuilder::copyTriangles |
( |
std::vector< uint32 > |
srcTriangleIndexes, |
|
|
iMeshBuilder & |
dst |
|
) |
| |
copies the triangles in the index list to an other iMeshBuilder
- Parameters
-
srcTriangleIndexes | list of triangle indexes to copy |
◆ createMesh() [1/2]
iMeshPtr igor::iMeshBuilder::createMesh |
( |
| ) |
|
creates and returns a mesh based on current data
- Returns
- shared pointer to iMesh
◆ createMesh() [2/2]
iMeshPtr igor::iMeshBuilder::createMesh |
( |
const std::vector< uint32 > & |
triangles | ) |
|
creates ans returns a mesh based on current data filtered by given triangles list
- Parameters
-
triangles | list of triangle IDs that end up in the mesh |
- Returns
- shared pointer to mesh
◆ getJoinVertexes()
bool igor::iMeshBuilder::getJoinVertexes |
( |
| ) |
|
- Returns
- join vertexes flag
◆ getMatrix()
void igor::iMeshBuilder::getMatrix |
( |
iaMatrixf & |
matrix | ) |
|
returns transformation matrix affecting next vertex to be set
- Parameters
-
[out] | matrix | returned matrix |
◆ getNormals()
const std::vector< iaVector3f > & igor::iMeshBuilder::getNormals |
( |
| ) |
const |
- Returns
- list of vertex normals
◆ getTextureUnitCount()
uint32 igor::iMeshBuilder::getTextureUnitCount |
( |
| ) |
const |
- Returns
- texture unit count
◆ getTriangles()
const std::vector< iIndexedTriangle > & igor::iMeshBuilder::getTriangles |
( |
| ) |
const |
- Returns
- list of indexed triangles
◆ getTrianglesCount()
uint32 igor::iMeshBuilder::getTrianglesCount |
( |
| ) |
const |
◆ getVertexCount()
uint32 igor::iMeshBuilder::getVertexCount |
( |
| ) |
const |
◆ getVertexes()
const std::vector< iaVector3f > & igor::iMeshBuilder::getVertexes |
( |
| ) |
const |
- Returns
- list of vertex positions
◆ hasColors()
bool igor::iMeshBuilder::hasColors |
( |
| ) |
const |
- Returns
- true if data contains colors
◆ hasNormals()
bool igor::iMeshBuilder::hasNormals |
( |
| ) |
const |
- Returns
- true: if mesh has _normals; false: mesh has no _normals
◆ multMatrix()
void igor::iMeshBuilder::multMatrix |
( |
const iaMatrixf & |
matrix | ) |
|
multiplies current matrix with given matrix
- Parameters
-
matrix | matrix to multiply with |
◆ normalizeNormals()
void igor::iMeshBuilder::normalizeNormals |
( |
| ) |
|
◆ setColor()
void igor::iMeshBuilder::setColor |
( |
uint32 |
index, |
|
|
const iaColor4f & |
color |
|
) |
| |
sets color of last added vertex
- Parameters
-
◆ setJoinVertexes()
void igor::iMeshBuilder::setJoinVertexes |
( |
bool |
joinVertexes = true | ) |
|
set's if added vertexes will be joined when heaving same position
can only be set before the first vertex was added
- Parameters
-
◆ setMatrix()
void igor::iMeshBuilder::setMatrix |
( |
const iaMatrixf & |
matrix | ) |
|
sets transformation matrix affecting next vertex to be set
- Parameters
-
matrix | transformation matrix |
◆ setNormal()
sets normal of last added vertex
- Parameters
-
◆ setTexCoord() [1/2]
void igor::iMeshBuilder::setTexCoord |
( |
const iaVector2f & |
texCoord, |
|
|
uint32 |
unit |
|
) |
| |
sets texture coordinate of last added vertex
- Parameters
-
texCoord | the texture coordinate to add |
unit | the texture unit to add the texture coodinate to |
◆ setTexCoord() [2/2]
sets texture coordinate of vertex specified by index
- Parameters
-
index | the vertex's index |
texCoord | the texture coordinate to add |
unit | the texture unit to add the texture coodinate to |
The documentation for this class was generated from the following files: