|
| Triangle () noexcept=default |
| Default constructor. Does not put the triangle in a usable state.
|
|
| Triangle (const Triangle &a_otherTriangle) noexcept=default |
| Copy constructor.
|
|
| Triangle (const std::array< Vec3, 3 > &a_vertexPositions) noexcept |
| Full constructor.
|
|
| ~Triangle () noexcept=default |
| Destructor (does nothing).
|
|
Triangle & | operator= (const Triangle &a_otherTriangle) noexcept=default |
| Copy assignment.
|
|
Triangle & | operator= (Triangle &&a_otherTriangle) noexcept=default |
| Move assignment.
|
|
void | setNormal (const Vec3 &a_normal) noexcept |
| Set the triangle normal vector.
|
|
void | setVertexPositions (const std::array< Vec3, 3 > &a_vertexPositions) noexcept |
| Set the triangle vertex positions.
|
|
void | setVertexNormals (const std::array< Vec3, 3 > &a_vertexNormals) noexcept |
| Set the triangle vertex normals.
|
|
void | setEdgeNormals (const std::array< Vec3, 3 > &a_edgeNormals) noexcept |
| Set the triangle edge normals.
|
|
void | setMetaData (const Meta &a_metaData) noexcept |
| Set the triangle meta-data.
|
|
void | computeNormal () noexcept |
| Compute the triangle normal vector.
|
|
Vec3 & | getNormal () noexcept |
| Get the triangle normal vector.
|
|
const Vec3 & | getNormal () const noexcept |
| Get the triangle normal vector.
|
|
std::array< Vec3, 3 > & | getVertexPositions () noexcept |
| Get the vertex positions.
|
|
const std::array< Vec3, 3 > & | getVertexPositions () const noexcept |
| Get the vertex positions.
|
|
std::array< Vec3, 3 > & | getVertexNormals () noexcept |
| Get the vertex normals.
|
|
const std::array< Vec3, 3 > & | getVertexNormals () const noexcept |
| Get the vertex normals.
|
|
std::array< Vec3, 3 > & | getEdgeNormals () noexcept |
| Get the edge normals.
|
|
const std::array< Vec3, 3 > & | getEdgeNormals () const noexcept |
| Get the edge normals.
|
|
Meta & | getMetaData () noexcept |
| Get the triangle meta-data.
|
|
const Meta & | getMetaData () const noexcept |
| Get the triangle meta-data.
|
|
T | signedDistance (const Vec3 &a_point) const noexcept |
| Compute the signed distance from the input point x to the triangle.
|
|
Triangle class with signed distance functionality.
This class represents a planar triangle and has a signed distance functionality. It is self-contained such that it can be directly copied to GPUs. The class contains a triangle face normal vector; three vertex positions, and normal vectors for the three vertices and three edges.
This class assumes that the vertices are organized with the right-hand rule. I.e., edges are enumerated as follows:
Edge 1 points from vertex 1 to vertex 2 Edge 2 points from vertex 2 to vertex 3 Edge 3 points from vertex 3 to vertex 0
This class can compute its own normal vector from the vertex positions, and the triangle orientation is then implicitly given by the vertex order.
To compute the distance from a point to the triangle, one must determine if the point projects to the "inside" or "outside" of the triangle. This class contains a 2D embedding of the triangle that can perform this project. If the query point projects to the inside of the triangle, the distance is simply the projected distance onto the triangle plane. If it projects to the outside of the triangle, we check the distance against the triangle edges and vertices. the ed