|
waLBerla 7.2
|
Class storing Information about a triangular facette (Triangle) of the EPA-Polytope.
see Collision detection in interactive 3D environments; Gino van den bergen page 155
#include <EPA.h>
Public Member Functions | |
Constructor | |
| EPA_Triangle (size_t a, size_t b, size_t c, const std::vector< Vec3 > &points) | |
| Construct a new EPA_Triangle. | |
Get functions | |
| size_t | operator[] (size_t i) const |
| Returns the index of the internal vertex i(=0,1,2) within the EPA scope. | |
| const Vec3 & | getClosest () const |
| Returns the point closest to the origin of the affine hull of the triangle, which is also the normal. | |
| const Vec3 & | getNormal () const |
| Returns the normal of the triangle. Normal is not normalized! | |
| Vec3 | getClosestPoint (const std::vector< Vec3 > &points) const |
| Calculates the corresponding closest point from the given points, using barycentric coordinates. | |
| real_t | getSqrDist () const |
| Returns the squared distance to the closest to the origin of the affine hull of the triangle. | |
| bool | isObsolete () const |
| Returns true if the triangle is no longer part of the EPA polygon. | |
| bool | isClosestInternal () const |
| Returns true if the point closest to the origin of the affine hull of the triangle, lies inside the triangle. | |
Private Attributes | |
Member variables | |
| size_t | indices_ [3] |
| indices of the vertices of the triangle | |
| bool | obsolete_ |
| flag to denote whether die triangle is visible from the new support point | |
| Vec3 | closest_ |
| the point closest to the origin of the affine hull of the triangle | |
| Vec3 | normal_ |
| normal pointing away from the origin | |
| real_t | bar_ [3] |
| the barycentric coordinate of closest_ | |
| real_t | sqrDist_ |
| =key; square distance of closest_ to the origin | |
| EPA_Triangle * | adjTriangle_ [3] |
| pointer to the triangle adjacent to edge i(=0,1,2) | |
| size_t | adjEdges_ [3] |
| for each adjoining triangle adjTriangle_[i], the index of the adjoining edge | |
Utility functions | |
| bool | link (size_t edge0, EPA_Triangle *tria, size_t edge1) |
| Sets the link of this triangles edge0 neighbor to tria and vice versa. | |
| void | silhouette (const Vec3 &w, EPA_EdgeBuffer &edgeBuffer) |
| Fills edgeBuffer with the CCW contour of triangles not seen from point w which is in normal direction of the triangle. | |
| void | silhouette (size_t index, const Vec3 &w, EPA_EdgeBuffer &edgeBuffer) |
| Recursive silhouette finding method. | |
|
inlineexplicit |
Construct a new EPA_Triangle.
| a | First point index |
| b | Second point index |
| c | Third point index |
| points | Vector with all points |
|
inline |
Returns the point closest to the origin of the affine hull of the triangle, which is also the normal.
|
inline |
Calculates the corresponding closest point from the given points, using barycentric coordinates.
|
inline |
Returns the normal of the triangle. Normal is not normalized!
|
inline |
Returns the squared distance to the closest to the origin of the affine hull of the triangle.
|
inline |
Returns true if the point closest to the origin of the affine hull of the triangle, lies inside the triangle.
|
inline |
Returns true if the triangle is no longer part of the EPA polygon.
|
inline |
Sets the link of this triangles edge0 neighbor to tria and vice versa.
|
inline |
Returns the index of the internal vertex i(=0,1,2) within the EPA scope.
|
inline |
Fills edgeBuffer with the CCW contour of triangles not seen from point w which is in normal direction of the triangle.
|
private |
Recursive silhouette finding method.
|
private |
for each adjoining triangle adjTriangle_[i], the index of the adjoining edge
|
private |
pointer to the triangle adjacent to edge i(=0,1,2)
|
private |
the barycentric coordinate of closest_
|
private |
the point closest to the origin of the affine hull of the triangle
|
private |
indices of the vertices of the triangle
|
private |
normal pointing away from the origin
|
private |
flag to denote whether die triangle is visible from the new support point
|
private |
=key; square distance of closest_ to the origin