walberla::pe::fcd::EPA::EPA_Triangle Class Reference

Detailed Description

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. More...
 
Get functions
size_t operator[] (size_t i) const
 Returns the index of the internal vertex i(=0,1,2) within the EPA scope. More...
 
const Vec3getClosest () const
 Returns the point closest to the origin of the affine hull of the triangle, which is also the normal. More...
 
const Vec3getNormal () const
 Returns the normal of the triangle. More...
 
Vec3 getClosestPoint (const std::vector< Vec3 > &points) const
 Calculates the corresponding closest point from the given points, using barycentric coordinates. More...
 
real_t getSqrDist () const
 Returns the squared distance to the closest to the origin of the affine hull of the triangle. More...
 
bool isObsolete () const
 Returns true if the triangle is no longer part of the EPA polygon. More...
 
bool isClosestInternal () const
 Returns true if the point closest to the origin of the affine hull of the triangle, lies inside the triangle. More...
 

Private Attributes

Member variables
size_t indices_ [3]
 indices of the vertices of the triangle More...
 
bool obsolete_
 flag to denote whether die triangle is visible from the new support point More...
 
Vec3 closest_
 the point closest to the origin of the affine hull of the triangle More...
 
Vec3 normal_
 normal pointing away from the origin More...
 
real_t bar_ [3]
 the barycentric coordinate of closest_ More...
 
real_t sqrDist_
 =key; square distance of closest_ to the origin More...
 
EPA_TriangleadjTriangle_ [3]
 pointer to the triangle adjacent to edge i(=0,1,2) More...
 
size_t adjEdges_ [3]
 for each adjoining triangle adjTriangle_[i], the index of the adjoining edge More...
 

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. More...
 
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. More...
 
void silhouette (size_t index, const Vec3 &w, EPA_EdgeBuffer &edgeBuffer)
 Recursive silhouette finding method. More...
 

Constructor & Destructor Documentation

◆ EPA_Triangle()

walberla::pe::fcd::EPA::EPA_Triangle::EPA_Triangle ( size_t  a,
size_t  b,
size_t  c,
const std::vector< Vec3 > &  points 
)
inlineexplicit

Construct a new EPA_Triangle.

Parameters
aFirst point index
bSecond point index
cThird point index
pointsVector with all points

Member Function Documentation

◆ getClosest()

const Vec3 & walberla::pe::fcd::EPA::EPA_Triangle::getClosest ( ) const
inline

Returns the point closest to the origin of the affine hull of the triangle, which is also the normal.

◆ getClosestPoint()

Vec3 walberla::pe::fcd::EPA::EPA_Triangle::getClosestPoint ( const std::vector< Vec3 > &  points) const
inline

Calculates the corresponding closest point from the given points, using barycentric coordinates.

◆ getNormal()

const Vec3 & walberla::pe::fcd::EPA::EPA_Triangle::getNormal ( ) const
inline

Returns the normal of the triangle.

Normal is not normalized!

◆ getSqrDist()

real_t walberla::pe::fcd::EPA::EPA_Triangle::getSqrDist ( ) const
inline

Returns the squared distance to the closest to the origin of the affine hull of the triangle.

◆ isClosestInternal()

bool walberla::pe::fcd::EPA::EPA_Triangle::isClosestInternal ( ) const
inline

Returns true if the point closest to the origin of the affine hull of the triangle, lies inside the triangle.

◆ isObsolete()

bool walberla::pe::fcd::EPA::EPA_Triangle::isObsolete ( ) const
inline

Returns true if the triangle is no longer part of the EPA polygon.

◆ link()

bool walberla::pe::fcd::EPA::EPA_Triangle::link ( size_t  edge0,
EPA_Triangle tria,
size_t  edge1 
)
inline

Sets the link of this triangles edge0 neighbor to tria and vice versa.

◆ operator[]()

size_t walberla::pe::fcd::EPA::EPA_Triangle::operator[] ( size_t  i) const
inline

Returns the index of the internal vertex i(=0,1,2) within the EPA scope.

◆ silhouette() [1/2]

void walberla::pe::fcd::EPA::EPA_Triangle::silhouette ( const Vec3 w,
EPA_EdgeBuffer edgeBuffer 
)
inline

Fills edgeBuffer with the CCW contour of triangles not seen from point w which is in normal direction of the triangle.

◆ silhouette() [2/2]

void walberla::pe::fcd::EPA::EPA_Triangle::silhouette ( size_t  index,
const Vec3 w,
EPA_EdgeBuffer edgeBuffer 
)
private

Recursive silhouette finding method.

Member Data Documentation

◆ adjEdges_

size_t walberla::pe::fcd::EPA::EPA_Triangle::adjEdges_[3]
private

for each adjoining triangle adjTriangle_[i], the index of the adjoining edge

◆ adjTriangle_

EPA_Triangle* walberla::pe::fcd::EPA::EPA_Triangle::adjTriangle_[3]
private

pointer to the triangle adjacent to edge i(=0,1,2)

◆ bar_

real_t walberla::pe::fcd::EPA::EPA_Triangle::bar_[3]
private

the barycentric coordinate of closest_

◆ closest_

Vec3 walberla::pe::fcd::EPA::EPA_Triangle::closest_
private

the point closest to the origin of the affine hull of the triangle

◆ indices_

size_t walberla::pe::fcd::EPA::EPA_Triangle::indices_[3]
private

indices of the vertices of the triangle

◆ normal_

Vec3 walberla::pe::fcd::EPA::EPA_Triangle::normal_
private

normal pointing away from the origin

◆ obsolete_

bool walberla::pe::fcd::EPA::EPA_Triangle::obsolete_
private

flag to denote whether die triangle is visible from the new support point

◆ sqrDist_

real_t walberla::pe::fcd::EPA::EPA_Triangle::sqrDist_
private

=key; square distance of closest_ to the origin


The documentation for this class was generated from the following files: