AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agxCollide::Mesh::Triangle Class Reference

Class for more intuitive access to the Mesh's mesh data. More...

#include <Mesh.h>

Public Member Functions

agx::Vec3 getEdgeEndVertex (uint_fast8_t localEdgeIndex) const
 
agx::Vec3 getEdgeStartVertex (uint_fast8_t localEdgeIndex) const
 
size_t getGlobalVertexIndex (uint_fast8_t localVertexIndex) const
 Returns the global index of the vertex.
 
const Triangle getHalfEdgePartner (uint_fast8_t localEdgeIndex) const
 
size_t getHalfEdgePartnerGlobalEdgeIndex (uint_fast8_t localEdgeIndex) const
 
size_t getHalfEdgePartnerLocalEdgeIndex (uint_fast8_t localEdgeIndex) const
 
agx::Real getMaximumEdgeLength () const
 
const MeshgetMesh () const
 
agx::Vec3 getNormal () const
 This function returns the triangle normal (as stored in the collision mesh data).
 
size_t getTriangleIndex () const
 Implementations.
 
agx::Vec3 getVertex (uint_fast8_t localVertexIndex) const
 
bool hasHalfEdgePartner (uint_fast8_t localEdgeIndex) const
 
bool isValid () const
 

Protected Member Functions

 Triangle ()
 This constructor is hidden and should only be called from the Mesh class and its children.
 
 Triangle (const Mesh *mesh, size_t triangleIndex)
 This constructor is hidden and should only be called from the Mesh class.
 

Protected Attributes

MeshConstRef m_mesh
 
size_t m_triangleIndex
 

Detailed Description

Class for more intuitive access to the Mesh's mesh data.

Involves a small overhead compared to using the more low-level access to the raw data by using getMeshData().

Definition at line 78 of file Mesh.h.

Constructor & Destructor Documentation

◆ Triangle() [1/2]

agxCollide::Mesh::Triangle::Triangle ( const Mesh mesh,
size_t  triangleIndex 
)
protected

This constructor is hidden and should only be called from the Mesh class.

Parameters
meshThe Mesh class which the Triangle belongs to.
triangleIndexThe Triangle's index in the Mesh.

◆ Triangle() [2/2]

agxCollide::Mesh::Triangle::Triangle ( )
protected

This constructor is hidden and should only be called from the Mesh class and its children.

Member Function Documentation

◆ getEdgeEndVertex()

agx::Vec3 agxCollide::Mesh::Triangle::getEdgeEndVertex ( uint_fast8_t  localEdgeIndex) const
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
The ending vertex of the specified edge.

Definition at line 678 of file Mesh.h.

◆ getEdgeStartVertex()

agx::Vec3 agxCollide::Mesh::Triangle::getEdgeStartVertex ( uint_fast8_t  localEdgeIndex) const
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
The starting vertex of the specified edge.

Definition at line 672 of file Mesh.h.

◆ getGlobalVertexIndex()

size_t agxCollide::Mesh::Triangle::getGlobalVertexIndex ( uint_fast8_t  localVertexIndex) const

Returns the global index of the vertex.

Parameters
localVertexIndexThe vertex's index within the triangle (0 to 2).
Returns
The global vertex index of the specified triangle vertex.

Definition at line 648 of file Mesh.h.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ getHalfEdgePartner()

const Mesh::Triangle agxCollide::Mesh::Triangle::getHalfEdgePartner ( uint_fast8_t  localEdgeIndex) const
inline
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
Returns the half edge partner of this triangle across an edge. If no half edge information for this edge exists, the Triangle will be invalid. This should be tested for before the result is used.

Definition at line 696 of file Mesh.h.

References agxAssert.

Referenced by agxSDK::calculateMeshOffset(), and agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ getHalfEdgePartnerGlobalEdgeIndex()

size_t agxCollide::Mesh::Triangle::getHalfEdgePartnerGlobalEdgeIndex ( uint_fast8_t  localEdgeIndex) const
inline
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
The global edge index of the specified Triangle edge's half edge partner. The global edge index is defined as 3 * global triangle index + local edge index.

If no half edge information can be found, returns a value which is This should be tested for before the result is used.

Definition at line 690 of file Mesh.h.

References agxCollide::Mesh::getGlobalEdgeIndex().

◆ getHalfEdgePartnerLocalEdgeIndex()

size_t agxCollide::Mesh::Triangle::getHalfEdgePartnerLocalEdgeIndex ( uint_fast8_t  localEdgeIndex) const
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
The local edge index of the edge within the specified Triangle edge's half edge partner corresponding to the specified edge. If no half edge information for the local edge exists, will be invalid. If no half edge information can be found, returns a value > 2. This should be tested for before the result is used.

Definition at line 703 of file Mesh.h.

References agxAssert.

◆ getMaximumEdgeLength()

agx::Real agxCollide::Mesh::Triangle::getMaximumEdgeLength ( ) const
Returns
The length of the longest edge in the triangle.

Definition at line 684 of file Mesh.h.

◆ getMesh()

const Mesh * agxCollide::Mesh::Triangle::getMesh ( ) const
Returns
A pointer to the Mesh this triangle is based on.

Definition at line 718 of file Mesh.h.

◆ getNormal()

agx::Vec3 agxCollide::Mesh::Triangle::getNormal ( ) const

This function returns the triangle normal (as stored in the collision mesh data).

Returns
triangle normal.

Definition at line 660 of file Mesh.h.

Referenced by agxSDK::calculateMeshOffset().

◆ getTriangleIndex()

size_t agxCollide::Mesh::Triangle::getTriangleIndex ( ) const

Implementations.

Returns
Triangle's triangle index. Can be numTriangles (= getHalfEdgeNeighborInvalidTriangle()) if invalid.

Triangle class

Definition at line 642 of file Mesh.h.

References m_triangleIndex.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ getVertex()

agx::Vec3 agxCollide::Mesh::Triangle::getVertex ( uint_fast8_t  localVertexIndex) const
Parameters
localVertexIndexThe vertex's index within the triangle (0 to 2).
Returns
Specified vertex

Definition at line 666 of file Mesh.h.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ hasHalfEdgePartner()

bool agxCollide::Mesh::Triangle::hasHalfEdgePartner ( uint_fast8_t  localEdgeIndex) const
Parameters
localEdgeIndexThe edge's index within the triangle (0 to 2).
Returns
Returns if the triangle is valid and has a valid half edge partner.

Definition at line 711 of file Mesh.h.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ isValid()

bool agxCollide::Mesh::Triangle::isValid ( ) const
Returns
True if the Triangle is valid (its m_triangleIndex is positive and smaller than the Mesh's number of Triangles). Triangles can become invalid when created from invalid Meshes or from half edge functions when no half edge structure is available (e.g. at terrain borders).

Definition at line 654 of file Mesh.h.

Referenced by agxSDK::calculateMeshOffset().

Member Data Documentation

◆ m_mesh

MeshConstRef agxCollide::Mesh::Triangle::m_mesh
protected

Definition at line 190 of file Mesh.h.

◆ m_triangleIndex

size_t agxCollide::Mesh::Triangle::m_triangleIndex
protected

Definition at line 191 of file Mesh.h.

Referenced by getTriangleIndex().


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