Inheritance diagram for DzPolyMesh:
DzPolyMesh::DzPolyMesh | ( | ) |
Default Constructor.
void DzPolyMesh::activateFaceGroup | ( | String | name | ) |
Activates a face group, creating it if it does not exist yet. All faces added after this call will be added to the given group. To stop adding faces to the group, you must call deactivateFaceGroup(). More than one face group can be active at a time.
void DzPolyMesh::activateMaterial | ( | Number | idx | ) |
Activates the given material. Any faces added after this call will use this material. Only ONE material can be active at a time, so this call will replace the currently active material.
Adds a vertex (edge) to the current polygon. This method implicitly defines a new edge in the current polygon from the last vertex to the given vertex. The first vertex in the face is considered to form an edge with the last vertex in the face. DZ_MAX_FACE_EDGES defines the maximum number of edges (vertices) that are allowed for a single polygon. Once the current polygon has reached this number of edges, it is added to the shape, and a new polygon is started, effectively splitting polygons with more than the maximum number of edges.
vertIdx | An index into the mesh's vertex list for the vertex to add to the polygon. | |
uvwIdx | An index into the mesh's uv map for the texture coordinate of the vertex. |
void DzPolyMesh::applySmoothing | ( | Number | angle | ) |
Recalculates the normals in the mesh based on the given smoothing angle
void DzPolyMesh::applyUVSet | ( | DzVertexMap | uvSet | ) |
Creates a new mesh by copying only the faces in the given group.
group | The faces to copy from this mesh into the new mesh. | |
materialMap | If not NULL, this will recieve the list of material indices from this mesh that were used in the output mesh. |
void DzPolyMesh::deactivateAllFaceGroups | ( | ) |
Deactivates all face groups
void DzPolyMesh::deactivateFaceGroup | ( | String | name | ) |
Deactivates a face group
DzFaceGroup DzPolyMesh::findFaceGroup | ( | String | name | ) |
int DzPolyMesh::finishFace | ( | ) |
Finishes a face definition and adds the face to the face list. Faces must have at least three edges to be valid. This function will do nothing and return -1 if less than three edges have been added to the current face. This function only succeeds when the mesh is in an editing operation. Make sure that you call beginEdit() before adding any faces, and finishEdit() after the faces have been added.
DzFaceGroup DzPolyMesh::getActiveFaceGroup | ( | Number | which | ) |
DzFaceGroup DzPolyMesh::getFaceGroup | ( | Number | i | ) |
DzFaceGroup DzPolyMesh::getMaterialGroup | ( | Number | which | ) |
DzPoly DzPolyMesh::getNormal | ( | Number | i | ) |
Number DzPolyMesh::getNumActiveFaceGroups | ( | ) |
Number DzPolyMesh::getNumFaceGroups | ( | ) |
Number DzPolyMesh::getNumMaterialGroups | ( | ) |
Number DzPolyMesh::getNumNormals | ( | ) |
Number DzPolyMesh::getNumPolys | ( | ) |
Number DzPolyMesh::getNumQuads | ( | ) |
Number DzPolyMesh::getNumTris | ( | ) |
DzPoly DzPolyMesh::getPoly | ( | Number | i | ) |
DzTriangle DzPolyMesh::getTri | ( | Number | i | ) |
bool DzPolyMesh::getUseVBORendering | ( | ) |
Gets the flag of using VBO rendering for mesh.
Invalidates chosen buffer objects. This makes them to be fully updated on next draw.
vertexes | Defines whether to invalidate vertex buffer object. | |
normals | Defines whether to invalidate normal buffer object. | |
uvs | Defines whether to invalidate texture buffer object. |
Invalidates VBOs. This makes VBOs to be fully updated on next draw.
clearVBOs | Defines whether to clear (delete) VBOs after invalidation. Usually we do not need to delete VBOs as their will be used in future. If VBOs are cleared, they will be recreated next time they are needed. Setting cleatVBOs to true has sense when VBOs are disabled and will not be needed soon. |
void DzPolyMesh::removeAllFaces | ( | ) |
Removes all faces from this shape without removing any vertices or materials.
void DzPolyMesh::removeFaces | ( | DzFaceGroup | faces, | |
Boolean | removeVerts = true | |||
) |
Removes the faces in the given group from this mesh object. This will traverse all the face and material groups and removes the faces referred to. If removeVerts is true, the function will also remove any verts that were exclusively referrenced by faces in the given group. Also supports a progress indicator, since this can be a lengthy process.
void DzPolyMesh::removePoly | ( | Number | polyIdx | ) |
Removes the given polygon from this mesh object. This will traverse all the face and material groups to remove the polygon.
void DzPolyMesh::removeQuad | ( | Number | quadIdx | ) |
Removes the given quad from this mesh object. This will traverse all the face and material groups to remove the quad.
void DzPolyMesh::removeTri | ( | Number | triIdx | ) |
Removes the given triangle from this mesh object. This will traverse all the face and material groups to remove the triangle.
void DzPolyMesh::setUseVBORendering | ( | Boolean | use | ) |
Sets the flag of using VBO rendering for mesh.
use | The flag of using VBO rendering for mesh. It should be true if VBOs can be used for rendering the data of the mesh. This means that VBOs are supported and the mesh is large enough to create VBOs for it. It should be false if VBOs can not be used for rendering the data of the mesh. This means that VBOs are not supported at all or the mesh is too small to draw it using VBOs. |
void DzPolyMesh::startFace | ( | ) |
Starts a new polygon definition. Vertices can be added to this face by subsequent calls to addFaceEdge(). This function only succeeds when the mesh is in an editing operation. Make sure that you call beginEdit() before adding any faces, and finishEdit() after the faces have been added.
void DzPolyMesh::updateVBOs | ( | ) |
Does all necessary update for VBO rendering. Updates vertex buffer objects and index buffers (if needed). This method must only be called when there is an active OpenGL context!