#include <DynamicMesh.h>
Inheritance diagram for DynamicMesh:


Public Member Functions | |
| DynamicMesh () | |
| Constructor for a dynamic mesh. | |
| void | optimize (U32 compi, double(*metric)(const gmVector3 &v1, const gmVector3 &v2, const gmVector3 &v3), double threshold) |
| Re-optimize the given mesh component. | |
| U32 | event_creation (const gmVector3 &pos) |
| Reconfigure the mesh due to a creation event. | |
| void | event_destroy (U32 comp) |
| Reconfigure the mesh due to a destroy event. | |
| void | event_attach (U32 c1, U32 c2, const gmVector3 &pos, const gmVector3 &dir) |
| Reconfigure the mesh due to an attach event. | |
| U32 | event_detach (U32 c, const gmVector3 &pos, const gmVector3 &dir) |
| Reconfigure the mesh due to a detach event. | |
| void | event_spackle (U32 c, const gmVector3 &pos, const gmVector3 &dir) |
| Reconfigure the mesh due to a spackle event. | |
| void | event_pierce (U32 c, const gmVector3 &pos, const gmVector3 &dir) |
| Reconfigure the mesh due to a pierce event. | |
| U32 | event_bubble (const gmVector3 &pos) |
| Reconfigure the mesh due to a bubble event. | |
| void | event_burst (U32 comp) |
| Reconfigure the mesh due to a burst event. | |
Public Attributes | |
| double | m_component_offset |
| When a new component is created, this is the world coordinate distance that the vertices of the component are offset from the critical point. | |
Private Member Functions | |
| U32 | add_component (const gmVector3 &pos, bool is_inward) |
| Add a new component to the mesh. | |
| void | remove_component (U32 comp) |
| Remove a component from the mesh. | |
| void | merge (U32 c1, U32 c2) |
| Merge all of one mesh group into another. | |
| void | add_ring (U32 c, const gmVector3 &pos, const gmVector3 &dir, bool is_inward) |
| Create a new ring of polygons around the given separatrix line. | |
| U32 | split (U32 c, const gmVector3 &pos, const gmVector3 &dir) |
| Split a connected component. | |
| void | remove_ring (U32 c, const gmVector3 &pos, const gmVector3 &dir, bool is_inward) |
| Remove a ring of polygons, and fill it with fans on either side. | |
| void | flip_edge (MeshGroup &comp, IndexEdge &edge) |
| Perform an edge-flip. | |
| U32 | intersect_ray (U32 c, const gmVector3 &pos, const gmVector3 &dir) |
| Intersect a ray with a mesh component. | |
| U32 | create_mesh_group () |
| Create a new mesh group. | |
| const gmVector3 & | get_opposing_vertex (IndexEdge *e, U32 fid) |
| Get the vertex opposite the given face across the given edge. | |
|
|
Constructor for a dynamic mesh.
Definition at line 39 of file DynamicMesh.h. References m_component_offset, and Mesh::m_groupList. |
|
||||||||||||
|
Add a new component to the mesh. Initially, it is just a tetrahedron around the given position.
Definition at line 203 of file DynamicMesh.cpp. References MeshGroup::addFace(), Mesh::addNormal(), Mesh::addVertex(), create_mesh_group(), IndexFace, m_component_offset, Mesh::m_groupList, and U32. |
|
||||||||||||||||||||
|
Create a new ring of polygons around the given separatrix line. This removes the closest polygons in directions dir and -dir, and sews a ring around them. Only polygons in c are considered, and the ring is added to c.
Definition at line 352 of file DynamicMesh.cpp. References MeshGroup::addFace(), Mesh::addFace(), Mesh::addNormal(), dot(), Mesh::getFace(), IndexFace, intersect_ray(), Mesh::m_groupList, MeshGroup::removeFace(), and U32. |
|
|
Create a new mesh group.
Definition at line 185 of file DynamicMesh.cpp. References Mesh::m_groupList, MeshGroup::setArbitraryIndex(), and U32. Referenced by add_component(), and split(). |
|
||||||||||||||||||||
|
Reconfigure the mesh due to an attach event. Two connected components join together in a wasp's waist. The two closest polygons pierced by the major eigenvector are assumed to belong to the components to be joined.
Definition at line 115 of file DynamicMesh.h. References U32. |
|
|
Reconfigure the mesh due to a bubble event. An air bubble is created in a 'solid' portion of the mesh; similar to a create, but with normals reversed.
Definition at line 200 of file DynamicMesh.h. References U32. |
|
|
Reconfigure the mesh due to a burst event. An air bubble inside a component is destroyed. Similar to a destroy event.
Definition at line 213 of file DynamicMesh.h. References U32. |
|
|
Reconfigure the mesh due to a creation event. A new connected component is added to the mesh at a given position; we begin with a tetrahedron, and let the particle system adapt it.
Definition at line 81 of file DynamicMesh.h. References U32. |
|
|
Reconfigure the mesh due to a destroy event. The given group will no longer be valid once the call completes.
Definition at line 94 of file DynamicMesh.h. References U32. |
|
||||||||||||||||
|
Reconfigure the mesh due to a detach event. A single connected component becomes two. The ring of polygons intersected by the plane with normal corresponding to the major eigenvector and containing the critical point are removed, and the holes in each component sewn up.
Definition at line 142 of file DynamicMesh.h. References U32. |
|
||||||||||||||||
|
Reconfigure the mesh due to a pierce event. A hole is created through a component. Similar to an attach, the polygons pierced by the separatrix plane are removed, and a fan is sewn over opposite ends of the holes.
Definition at line 183 of file DynamicMesh.h. References U32. |
|
||||||||||||||||
|
Reconfigure the mesh due to a spackle event. A hole through a component becomes filled. Similar to a detach, the ring of polygons intersecting the plane with normal corresponding to the separatrix are removed, and each side is sewn up.
Definition at line 163 of file DynamicMesh.h. References U32. |
|
||||||||||||
|
Perform an edge-flip. An edge flip rearranges the triangles which are shared by an edge; considered as a quad, with the edge being the diagonal, the result of the edge flip is an arrangement with an edge through the other diagonal of the quad.
Definition at line 8 of file DynamicMesh.cpp. References MeshGroup::addFace(), Mesh::addFace(), Mesh::addNormal(), edge, Mesh::getVertex(), IndexFace, MeshGroup::removeFace(), and U32. Referenced by optimize(). |
|
||||||||||||
|
Get the vertex opposite the given face across the given edge.
Definition at line 78 of file DynamicMesh.cpp. References Mesh::getFace(), Mesh::getVertex(), IndexFace, and U32. Referenced by optimize(). |
|
||||||||||||||||
|
Intersect a ray with a mesh component. Return the first polygon intersecting the ray.
Definition at line 773 of file DynamicMesh.cpp. References MeshGroup::facePostIncrement(), IndexFace, Mesh::m_groupList, ray_intersect_triangle(), MeshGroup::rewindFaceList(), and U32. Referenced by add_ring(), and remove_ring(). |
|
||||||||||||
|
Merge all of one mesh group into another.
Definition at line 333 of file DynamicMesh.cpp. References MeshGroup::addFace(), MeshGroup::facePostIncrement(), IndexFace, Mesh::m_groupList, remove_component(), MeshGroup::rewindFaceList(), and U32. |
|
||||||||||||||||
|
Re-optimize the given mesh component. This goes through all the faces and performs edge swaps as necessary in order to optimize the quality of the mesh, as determined by the given metric. The metric should increase with worse quality, with 0 being perfect. Costs of disparate triangles should be combinable with addition, so the cost/benefit of a given edge swap can be evaluated and optimized.
Definition at line 103 of file DynamicMesh.cpp. References MeshGroup::facePostIncrement(), flip_edge(), get_opposing_vertex(), IndexEdge, IndexFace, Mesh::m_groupList, MeshGroup::rewindFaceList(), and U32. |
|
|
Remove a component from the mesh. All vertices and faces are removed. (it is assumed that any vertex/face only belongs to one component). The MeshGroup should not be used in any way after.
Definition at line 283 of file DynamicMesh.cpp. References MeshGroup::facePostIncrement(), IndexFace, Mesh::m_groupList, MeshGroup::removeFace(), MeshGroup::rewindFaceList(), MeshGroup::setArbitraryIndex(), and U32. Referenced by merge(). |
|
||||||||||||||||||||
|
Remove a ring of polygons, and fill it with fans on either side. The ring is specified as those polygons nearest to pos which are split by the plane defined by pos and dir.
Definition at line 543 of file DynamicMesh.cpp. References Mesh::addNormal(), Mesh::addVertex(), dot(), MeshGroup::facePostIncrement(), Mesh::getFace(), Mesh::getVertex(), IndexEdge, IndexFace, intersect_ray(), is_contained(), m_component_offset, Mesh::m_groupList, MeshGroup::rewindFaceList(), and U32. |
|
||||||||||||||||
|
Split a connected component. It is assumed the component is already 'degenerate' in the sense that it consists of two disjoint parts, where pos and dir define a plane point and normal separating the two parts.
Definition at line 498 of file DynamicMesh.cpp. References MeshGroup::addFace(), create_mesh_group(), dot(), MeshGroup::facePostIncrement(), IndexFace, Mesh::m_groupList, MeshGroup::removeFace(), MeshGroup::rewindFaceList(), and U32. |
|
|
When a new component is created, this is the world coordinate distance that the vertices of the component are offset from the critical point. Should be adjusted as necessary according to the scale of the mesh. Definition at line 33 of file DynamicMesh.h. Referenced by add_component(), DynamicMesh(), and remove_ring(). |
1.3.4