![]() |
VR-Forces Developer's Guide
|
Triangulates all the polygons with more than three vertices of a gdb terrain database. The algorithmic used in this class is based on the theory presented in Computational Geometry in C (Joseph O'Rourke) - Chapter 1 Geometric Tools for Computer Graphics (Schneider) - Section 13.9 Computer Graphics (Foley & Van Dam) - p. 222 Notation: vi = vertex located at position i inside the vertex manager.
Static Public Member Functions | |
| static bool | triangulateTerrain (DtTerrainDatabase *db) |
| static DtTriangulationResult | triangulatePolygon (DtTerrainDatabase *db, DtPolygonIndirect *node, DtGroup *const parent) |
Static Protected Attributes | |
| static const double | theErrorMargin |
|
static |
Converts all the polygon indirect nodes of db into triangle indirect nodes by applying a triangulation algorithm to each polygon node. The polygon node is removed from the database and transformed into 2+ triangle indirect nodes.
| db | - Terrain database to be triangulated |
|
static |
Triangulates the polygon defined by node. It creates an exact copy of the polygon but with triangles. This method creates and adds TRIANGLE_INDIRECT nodes into the terrain database. Each triangle is created with the surface Id sid.
| db | - (in) Terrain database where the nodes will be added |
| node | - (in) Polygon to be triangulated parent - (in) Parent of the node |
|
staticprotected |
Returns the value of the z component of the cross product between the segments defined by the indexes ab and ac.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices inside mgr, defining the segment |
|
staticprotected |
Determines whether the points at indexes a, b, and c are all collinear.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices inside the vertex manager |
|
staticprotected |
Checks whether the segment v0v1 is contained in the cone with vertex v0 and edges with directions (vm - vi) and (vp - vi)
| mgr | - (in) Vertex manager containing the actual vertices |
| v0,v1 | - (in) Indexes of the segment |
| vm | - (in) Index of the vertex located immediately before v0 |
| vp | - (in) Index of the vertex located immediately after v0 |
|
staticprotected |
Determines whether the point vb is between va and vc.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices to be tested for collinearity |
|
staticprotected |
Checks whether the segment va-vb properly intersects the segment vc-vd: They share a point interior to both segments.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c,d | - (in) Indexes of the vertices defining the segments to be tested |
|
staticprotected |
Checks whether the segment va-vb intersects with segment vc-vd: They intersect properly or one endpoint of one segment lies between the two endpoints of the other segment.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c,d | - (in) Indexes of the vertices defining the segments to be tested |
|
staticprotected |
Determines whether the segment defined by vi0 and vi1 is contained by the polygon vertIDs and does not fully intersect any of its edges.
| mgr | - (in) Vertex manager containing the actual vertices |
| numberOfVertices | - (in) Size of vertIds |
| i0,i1 | - (in) Indexes of the vertices defining the segment to be tested |
|
staticprotected |
Determines whether poly has a non-zero normal.
| poly | - (in) Polygon to be tested |
|
staticprotected |
Determines whether all the vertices inside poly are coplanar.
| poly | - (in) Polygon to be tested |
|
staticprotected |
Prints the contents of the list lst.
| lst | - (in) List of vertices to be printed |
|
staticprotected |
Triangulates the polygon defined by vertIds. It creates an exact copy of the polygon but with triangles. This method creates and adds TRIANGLE_INDIRECT nodes into the terrain database. Each triangle is created with the surface Id sid.
| db | - (in) Terrain database where the nodes will be added |
| sid | - (in) Surface id of the new nodes |
| mgr | - (in) Vertex manager containing the actual vertices |
| vertIds | - (in) Vector containing the indexes that define the |
| parent | - (in) Parent associated with the polygon being triangulated polygon to be triangulated |
|
staticprotected |
Projects the polygon poly onto the xy plane by aligning its normal with the z axis.
| poly | - (in) Polygon to align |
| aMatrix | - (out) Transformation matrix used to project the polygon |
|
staticprotected |
Applies the transformation aMatrix to the polygon node poly.
| poly | - (in) Polygon to transform |
| aMatrix | - (in) Transformation matrix to apply on the polygon |
|
staticprotected |