![]() |
Public API Reference |
#include <pmtools.h>
Static Public Methods | |
void | CalculateNormals (iPolygonMesh *mesh, csVector3 *normals) |
This function will calculate normals for all polygons in the mesh. More... | |
void | CalculatePlanes (iPolygonMesh *mesh, csPlane3 *planes) |
This function will calculate planes for all polygons in the mesh. More... | |
csPolygonMeshEdge * | CalculateEdges (iPolygonMesh *, int &num_edges) |
Create a table of edges for this mesh. More... | |
int | CheckActiveEdges (csPolygonMeshEdge *edges, int num_edges, csPlane3 *planes) |
This function will check all edges and mark them as active if the two polygons are not co-planar. More... | |
void | CalculateOutline (csPolygonMeshEdge *edges, int num_edges, csPlane3 *planes, int num_vertices, const csVector3 &pos, int *outline_edges, int &num_outline_edges, bool *outline_verts, float &valid_radius) |
Given a table of edges (as calculated with CalculateEdges()), a table of planes (as calculated with CalculatePlanes()), and a position in space. More... | |
bool | IsMeshClosed (iPolygonMesh *polyMesh) |
Test whether a polygon mesh is closed. More... | |
void | CloseMesh (iPolygonMesh *polyMesh, csArray< csMeshedPolygon > &newPolys, int *&vertidx, int &vertidx_len) |
Close a polygon mesh. More... | |
void | Triangulate (iPolygonMesh *polymesh, csTriangle *&tris, int &tri_count) |
Triangulate a mesh from the polygon mesh data in the iPolygonMesh. More... | |
void | Polygonize (iPolygonMesh *polymesh, csMeshedPolygon *&polygons, int &poly_count) |
Take a polygon mesh that has a valid set of triangles and generate a polygon table for that (delete with delete[]). More... |
Definition at line 57 of file pmtools.h.
|
Create a table of edges for this mesh. The resulting table may later be deleted with 'delete[]'. Note that every edge will only connect two polygons. If more polygons connect to an edge then the edge will be duplicated. The 'active' flag of the returned edges is not calculated by this routine. Use 'CheckActiveEdges()' for that. |
|
This function will calculate normals for all polygons in the mesh. The given array of 'normals' should be big enough to have normals for the number of polygons as defined in the mesh itself. |
|
Given a table of edges (as calculated with CalculateEdges()), a table of planes (as calculated with CalculatePlanes()), and a position in space.
This function will calculate an outline that is valid from that position. This outline will be given as an array of bool indicating which vertex indices that are used (so these have to be transformed from 3D to 2D) and also an array of double vertex indices (every set of two vertex indices forms one edge) that form the outline. This function will also return a radius. As long as the position doesn't move outside this radius the outline will be valid. The two input tables should have enough space for the returned number of edges and vertex indices. The safest way is to allocate double the amount of vertices as there are active edges in the input edge table and enough vertices as the polygon mesh supports. |
|
This function will calculate planes for all polygons in the mesh. The given array of 'planes' should be big enough to have planes for the number of polygons as defined in the mesh itself. |
|
This function will check all edges and mark them as active if the two polygons are not co-planar. This function will return the number of active edges. |
|
Close a polygon mesh. The current implementation is rather naive; it just returns all faces, but flipped. The returned table is a table of indices that are used in the returned polygons. Don't forget to delete[] that table! |
|
Test whether a polygon mesh is closed.
|
|
Take a polygon mesh that has a valid set of triangles and generate a polygon table for that (delete with delete[]). Note that the polygons will point inside the triangle table! |
|
Triangulate a mesh from the polygon mesh data in the iPolygonMesh. Returns a table of triangles (delete with delete[]). |