KrisLibrary
1.0.0
|
A triangle mesh along with PQP bounding volume structures that enable fast collision and other proximity queries. More...
#include <CollisionMesh.h>
Public Member Functions | |
CollisionMesh (const CollisionMesh &model) | |
CollisionMesh (const Meshing::TriMesh &mesh) | |
CollisionMesh (const Meshing::TriMeshWithTopology &mesh) | |
const CollisionMesh & | operator= (const CollisionMesh &model) |
void | InitCollisions () |
void | UpdateTransform (const RigidTransform &f) |
void | GetTransform (RigidTransform &f) const |
Public Member Functions inherited from Meshing::TriMeshWithTopology | |
void | ClearTopology () |
void | CalcVertexNeighbors () |
void | CalcIncidentTris () |
void | CalcTriNeighbors () |
bool | IsConsistent () |
void | SplitEdge (int tri, int e, const Vector3 &newPt) |
void | TriBFS (TriMeshTraversalCallback &callback) |
void | VertexBFS (TriMeshTraversalCallback &callback) |
void | BeginTriWalk () |
void | BeginVertexWalk () |
void | _TriBFS (int start, TriMeshTraversalCallback &callback) |
void | _VertexBFS (int start, TriMeshTraversalCallback &callback) |
Public Member Functions inherited from Meshing::TriMesh | |
bool | Load (const char *fn) |
bool | Save (const char *fn) const |
Vector3 & | TriangleVertex (int tri, int v) |
Returns the v'th vertex of triangle tri. | |
const Vector3 & | TriangleVertex (int tri, int v) const |
Vector3 | TriangleNormal (int tri) const |
Calculates the normal of triangle tri. | |
void | GetTriangle (int tri, Triangle3D &t) const |
Returns a Triangle3D structure for triangle tri. | |
void | GetIncidentTris (int v, vector< int > &tris) const |
Calculates a list of triangle indices incident to vertex v. O(T) time. | |
void | AppendIncidentTris (int v, vector< int > &t) const |
Same as above, but appends the triangles to the end of t. | |
void | GetEdge (int tri, int e, int &v1, int &v2) const |
Returns the vertex indices (v1,v2) of the e'th edge of triangle tri. | |
int | GetAdjacentTri (int tri, int e) const |
bool | IsValid () const |
void | GetAABB (Vector3 &bmin, Vector3 &bmax) const |
int | ClosestPoint (const Vector3 &pt, Vector3 &cp) const |
int | RayCast (const Ray3D &r, Vector3 &pt) const |
bool | Intersects (const Plane3D &) const |
bool | PlaneSplits (const Plane3D &, Real &dmin, Real &dmax) const |
void | Transform (const Matrix4 &mat) |
void | FlipFaces () |
void | Merge (const vector< TriMesh > &meshes) |
void | MergeWith (const TriMesh &mesh) |
void | RemoveUnusedVerts () |
Public Attributes | |
PQP_Model * | pqpModel |
RigidTransform | currentTransform |
Public Attributes inherited from Meshing::TriMeshWithTopology | |
vector< vector< int > > | vertexNeighbors |
neighboring vertices of vertices | |
vector< vector< int > > | incidentTris |
triangles incident on vertices | |
vector< TriNeighbors > | triNeighbors |
neighboring triangles of triangles | |
vector< int > | visited |
temporary | |
Public Attributes inherited from Meshing::TriMesh | |
vector< Vector3 > | verts |
vector< Tri > | tris |
Additional Inherited Members | |
Public Types inherited from Meshing::TriMeshWithTopology | |
typedef IntTriple | TriNeighbors |
index 0,1,2=neighbor along edge 0,1,2 (or -1 if none) | |
Public Types inherited from Meshing::TriMesh | |
typedef IntTriple | Tri |
A triangle mesh along with PQP bounding volume structures that enable fast collision and other proximity queries.
The TriMesh (a parent class of TriMeshWithTopology) must be initialized first, then InitCollisions() must be called. The current rigid-body transformation must be specified before making collision queries.