Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a convex polyhedron with triangular faces. More...
#include <omPhysicsConvexHull.h>
Classes | |
class | Triangle |
class | Vertex |
Public Member Functions | |
ConvexHull () | |
Create an empty convex hull with no triangles or vertices. More... | |
ConvexHull (const Vector3f *inputVertices, UInt32 numVertices, Float maxError=0.000001f) | |
Create a convex hull from the specified array of input vertices. More... | |
UInt32 | getTriangleCount () const |
Return the number of triangles that define the surface of this convex hull. More... | |
const Triangle & | getTriangle (UInt32 index) const |
Return a const reference to the convex hull triangle at the specified index. More... | |
StaticArray< UInt32, 3 > | getTriangleNeighbors (UInt32 index) const |
Return an array of the three triangle neighbor indices for the triangle at the specified index. More... | |
UInt32 | getVertexCount () const |
Return the number of vertices that are on the surface of this convex hull. More... | |
const Vertex & | getVertex (UInt32 index) const |
Return a reference to the vertex on this convex hull at the specified index. More... | |
void | addVertices (const Vector3f *vertices, UInt32 numVertices, Float maxError=0.000001f) |
Add an array of new vertices to the convex hull and update the hull's boundary representation. More... | |
void | clearVertices () |
Remove all of the vertices and triangles from this convex hull. More... | |
Size | getVertexTriangleCount (UInt32 vertexIndex) const |
Return the number of triangles which share the specified vertex. More... | |
const Triangle & | getVertexTriangle (UInt32 vertexIndex, UInt32 triangleIndex) const |
Return a const reference to the triange sharing the specified vertex at the given index. More... | |
UInt32 | getSupportVertexIndex (const SIMDFloat4 &direction, UInt32 startingVertex=0) const |
Determine which vertex on this convex hull is farthest in the specified direction. More... | |
SIMDFloat4 | getSupportVertex (const SIMDFloat4 &direction, UInt32 startingVertex=0) const |
Determine which vertex on this convex hull is farthest in the specified direction. More... | |
const AABB3f & | getBoundingBox () const |
Return the bounding box of this convex hull. More... | |
A class that represents a convex polyhedron with triangular faces.
om::physics::base::ConvexHull::ConvexHull | ( | ) |
Create an empty convex hull with no triangles or vertices.
om::physics::base::ConvexHull::ConvexHull | ( | const Vector3f * | inputVertices, |
UInt32 | numVertices, | ||
Float | maxError = 0.000001f |
||
) |
Create a convex hull from the specified array of input vertices.
|
inline |
Return the number of triangles that define the surface of this convex hull.
Return a const reference to the convex hull triangle at the specified index.
StaticArray<UInt32,3> om::physics::base::ConvexHull::getTriangleNeighbors | ( | UInt32 | index | ) | const |
Return an array of the three triangle neighbor indices for the triangle at the specified index.
|
inline |
Return the number of vertices that are on the surface of this convex hull.
Return a reference to the vertex on this convex hull at the specified index.
void om::physics::base::ConvexHull::addVertices | ( | const Vector3f * | vertices, |
UInt32 | numVertices, | ||
Float | maxError = 0.000001f |
||
) |
Add an array of new vertices to the convex hull and update the hull's boundary representation.
void om::physics::base::ConvexHull::clearVertices | ( | ) |
Remove all of the vertices and triangles from this convex hull.
Return the number of triangles which share the specified vertex.
|
inline |
Return a const reference to the triange sharing the specified vertex at the given index.
UInt32 om::physics::base::ConvexHull::getSupportVertexIndex | ( | const SIMDFloat4 & | direction, |
UInt32 | startingVertex = 0 |
||
) | const |
Determine which vertex on this convex hull is farthest in the specified direction.
This method uses the optional starting vertex as a best-guess for the supporting vertex. The hull then uses a 'hill-climbing' algorithm to find the actual supporting vertex in the specified direction. The direction does not need to be normalized. The index of the support vertex is returned.
If the convex hull has no vertices, math::max<Index>() is returned.
|
inline |
Determine which vertex on this convex hull is farthest in the specified direction.
This method uses the optional starting vertex as a best-guess for the supporting vertex. The hull then uses a 'hill-climbing' algorithm to find the actual supporting vertex in the specified direction. The direction does not need to be normalized. The position of the support vertex is returned.
If the convex hull has no vertices, the origin is returned.
|
inline |
Return the bounding box of this convex hull.