AGX Dynamics 2.41.1.2
Loading...
Searching...
No Matches
agxCollide::Mesh Class Referenceabstract

Mesh is a common base class for triangle meshes, such as Mesh or HeightField. More...

#include <Mesh.h>

+ Inheritance diagram for agxCollide::Mesh:

Classes

class  FaceEdgeCirculator
 Class in order to circulate over the edges connected to a Triangle's face. More...
 
class  Triangle
 Class for more intuitive access to the Mesh's mesh data. More...
 
struct  TriangleLineSegmentResult
 Struct used in calculateTriangleOverlapsAlongLineSegment. More...
 
class  VertexEdgeCirculator
 Class in order to circulate over the edges connected to a Triangle's vertex. More...
 

Public Types

typedef agx::Vector< TriangleLineSegmentResultTriangleLineSegmentResultVector
 
- Public Types inherited from agxCollide::Shape
enum  Type {
  GROUP , BOX , CAPSULE , CYLINDER ,
  LINE , PLANE , SPHERE , TRIMESH ,
  HEIGHT_FIELD , CONVEX , WIRE_SHAPE , CONE ,
  HOLLOW_CONE , HOLLOW_CYLINDER , NUM_TYPES
}
 Define the type of a Shape. More...
 

Public Member Functions

virtual agx::SPDMatrix3x3 calculateInertia (agx::Real mass) const override
 Returns the inertia of the shape, scaled with the mass. Inherited from class Shape.
 
virtual BoundingAABB calculateLocalBound () const override
 Calculate the bounding volume in the local coordinate system.
 
virtual void calculatePossibleTriangleOverlapsAlongLineSegment (const agx::Vec3 &segmentStartLocal, const agx::Vec3 &segmentEndLocal, agx::UInt32Vector &triangleIndices) const =0
 Calculates an array of triangle indices of the triangles whose bounding volumes get intersected by a line segment.
 
virtual void calculatePossibleTriangleOverlapsAlongLineSegment (const agx::Vec3 &segmentStartLocal, const agx::Vec3 &segmentEndLocal, agxData::LocalVector< agx::UInt32 > &triangleIndices) const =0
 Calculates an array of triangle indices of the triangles whose bounding volumes get intersected by a line segment.
 
void calculateTriangleOverlapsAlongLineSegment (const agx::Vec3 &segmentStartLocal, const agx::Vec3 &segmentEndLocal, TriangleLineSegmentResultVector &triangleResults) const
 Calculates all triangle overlaps of a line segment with the mesh.
 
void calculateTrianglesInVolume (const BoundingAABB &volume, const agx::AffineMatrix4x4 &meshToWorld, const agx::AffineMatrix4x4 &volumeToWorld, agx::UInt32Vector &triangleIndices) const
 Calculates an array of triangle indices of the triangles that are within a bounding volume.
 
void calculateTrianglesInVolume (const BoundingAABB &volume, const agx::AffineMatrix4x4 &meshToWorld, const agx::AffineMatrix4x4 &volumeToWorld, agxData::LocalVector< agx::UInt32 > &triangleIndices) const
 
FaceEdgeCirculator createFaceEdgeCirculator (size_t triangleIndex) const
 Creates an FaceEdgeCirculator pointing to this Triangle and a Voronoi region.
 
VertexEdgeCirculator createVertexEdgeCirculator (size_t triangleIndex, uint_fast8_t localVertexIndex) const
 Creates an VertexEdgeCirculator pointing to this Triangle and a Voronoi region.
 
agx::Real getBottomMargin () const
 
const AabbTree * getBvhTree () const
 
virtual agx::Vec3 getCenter () const override
 
size_t getGlobalVertexIndex (size_t triangleIndex, uint_fast8_t localVertexIndex) const
 Returns the global index of one of the three vertices in a triangle.
 
uint32_t getHalfEdgePartnerEdge (size_t globalEdgeIndex) const
 
const BoundingAABBgetLocalBound () const
 
const CollisionMeshDatagetMeshData () const
 
size_t getNumTriangles () const
 
size_t getNumVertices () const
 
agx::Real getTotalMaximumEdgeLength () const
 
const Triangle getTriangle (size_t triangleIndex) const
 
agx::Real getTriangleMaximumEdgeLength (size_t triangleIndex) const
 
agx::Vec3 getTriangleNormal (size_t triangleIndex) const
 
agx::Vec3 getTriangleVertex (size_t triangleIndex, uint_fast8_t localVertexIndex) const
 Returns one of the three vertices in a triangle.
 
agx::Vec3 getVertex (size_t globalVertexIndex) const
 
virtual agx::Real getVolume () const override
 
bool hasHalfEdge () const
 
bool hasInternalCenterPoint () const
 
bool isConvexEdge (size_t globalEdgeIndex) const
 Is an edge convex? Returns always true if half edge information is missing on this edge/the whole mesh.
 
bool isConvexVertex (size_t triangleIndex, size_t localVertexIndex) const
 Is an vertex convex? Returns always true if half edge information is missing on this vertex/the whole mesh.
 
bool isTerrain () const
 
bool isValid () const
 
bool isValidAndClosed () const
 
bool isValidEdgeIndex (size_t globalEdgeIndex) const
 
bool isValidTriangleIndex (size_t globalTriangleIndex) const
 
void setBottomMargin (agx::Real newMargin)
 Sets a bottom safety margin that is added below the lowest point of the height field in local z direction, to prevent tunneling in this direction.
 
virtual const BoundingAABBupdateBoundingVolume () override
 Calculate the bounding volume based on the current Shape parameters including transformation.
 
- Public Member Functions inherited from agxCollide::Shape
ShapeGroupasGroup ()
 Auto-cast shape to group.
 
const ShapeGroupasGroup () const
 Auto-cast shape to group.
 
virtual agx::Real calculateBoundingRadius (BoundingAABB &localAABB) const
 Calculate the bounding volume (AABB) into localAABB and calculate the bounding radius based on the new AABB size.
 
virtual agx::SPDMatrix3x3 calculateInertia (agx::Real mass) const =0
 Calculate the inertia for the shape given a mass.
 
virtual BoundingAABB calculateLocalBound () const =0
 Calculate the bounding volume in the local coordinate system.
 
virtual Shapeclone () const
 Create a clone.
 
const BoundingAABBgetBoundingVolume () const
 
virtual agx::Vec3 getCenter () const
 
agx::Physics::Geometry::ShapePtr getEntity () const
 
GeometrygetGeometry ()
 
const GeometrygetGeometry () const
 
agx::AffineMatrix4x4 getLocalTransform () const
 
agx::UInt32 getModifiedCount () const
 
agxCollide::RenderDatagetRenderData ()
 
const agxCollide::RenderDatagetRenderData () const
 If this is a ShapeGroup, then this method will return nullptr as the render data is stored in the actual children (Box, Mesh etc.
 
virtual agx::Vec3 getSupportPoint (const agx::Vec3 &supportDirection) const
 Returns the support point on face of the shape.
 
agx::AffineMatrix4x4 getTransform () const
 
agx::UInt8 getType () const
 
const char * getTypeName () const
 
virtual agx::Real getVolume () const =0
 Return the volume of the shape.
 
virtual bool hasSupportFunction () const
 
bool isGroup () const
 
virtual void propagateTransform (const agx::AffineMatrix4x4 &transform)
 
virtual void setRenderData (agxCollide::RenderData *renderData)
 Store render data with the Shape.
 
virtual const BoundingAABBupdateBoundingVolume ()=0
 Calculate the bounding volume based on the current Shape parameters including transformation.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static size_t getGlobalEdgeIndex (size_t triangleIndex, uint_fast8_t localEdgeIndex)
 Computes the global edge index from a given triangle index and the local edge index within this triangle.
 
static size_t getGlobalTriangleIndex (size_t globalEdgeIndex)
 
static size_t getLocalEdgeIndex (size_t globalEdgeIndex)
 
- Static Public Member Functions inherited from agxCollide::Shape
static BoundingAABB calculateBound (const agx::AffineMatrix4x4 &transform, const BoundingAABB &localBound)
 
static const char * getTypeName (agx::UInt8 type)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 Mesh (Shape::Type type, agx::Physics::Geometry::ShapePtr entity)
 Hidden, should only be called by child classes.
 
virtual ~Mesh ()
 Hide destructor.
 
void restore (class agxStream::InputArchive &in) override
 
void store (class agxStream::OutputArchive &out) const override
 
virtual void updateBvhTree ()=0
 
- Protected Member Functions inherited from agxCollide::Shape
 Shape (Type type, agx::Physics::Geometry::ShapePtr entity=agx::Physics::Geometry::ShapeModel::createInstance())
 Constructor.
 
virtual ~Shape ()
 Destructor.
 
agx::UInt32 incrementModifiedCount ()
 Increment the number of times the shape have been modified.
 
void syncronizeShapeIndex ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

AabbTreeRef m_aabbTree
 
CollisionMeshDataRef m_collisionMeshData
 
BoundingAABB m_localBound
 
- Protected Attributes inherited from agxCollide::Shape
agx::Physics::Geometry::ShapeRef m_entity
 
Geometrym_geometry
 
agx::ref_ptr< agx::Referencedm_internalData
 
ShapeGroupm_parent
 
agxCollide::RenderDataRef m_renderData
 
agx::Index m_shapeIndex
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Mesh is a common base class for triangle meshes, such as Mesh or HeightField.

It is a purely abstract class and should not be used by itself.

All triangles are stored as triangle lists in counter clockwise winding. The raw data is stored in the CollisionMeshData class as arrays. For each triangle, edge i points from vertex i to vertex (i + 1) modulo 3, 0 <= i < 3 and are thus stored in the vertex indices (CollisionMeshData::indices).

There are three ways of accessing the mesh data:

  • Either directly via getMeshData()
  • For the data not related to mesh traversal, there exist also dedicated getter functions.
  • For easier use of mesh traversal (given a half-edge structure), there is a Triangle class (including a small overhead).
  • For easier use of mesh traversal (given a half-edge structure), there is a VertexEdgeCirculator and a FaceEdgeCirculator class (including a small overhead).

Meshes such as Trimeshes or HeightFields can have a half edge structure which can be used for traversing the mesh. There, each edge has a half edge partner, which is the corresponding edge in the neighboring triangle. At holes (or at borders of a HeightField), this neighbor triangle will be invalid.

Due to the internal representation, errors can occur if the number of triangles exceeds the maximum of integers / 3 - 1, (for 32 bit: 1431655764). Therefore, input data with larger numbers of triangles will be cut off at this point.

Definition at line 69 of file Mesh.h.

Member Typedef Documentation

◆ TriangleLineSegmentResultVector

Constructor & Destructor Documentation

◆ Mesh()

agxCollide::Mesh::Mesh ( Shape::Type  type,
agx::Physics::Geometry::ShapePtr  entity 
)
protected

Hidden, should only be called by child classes.

◆ ~Mesh()

virtual agxCollide::Mesh::~Mesh ( )
protectedvirtual

Hide destructor.

Member Function Documentation

◆ calculateInertia()

agx::SPDMatrix3x3 agxCollide::Mesh::calculateInertia ( agx::Real  mass) const
overridevirtual

Returns the inertia of the shape, scaled with the mass. Inherited from class Shape.

Implements agxCollide::Shape.

Definition at line 826 of file Mesh.h.

References m_collisionMeshData.

◆ calculateLocalBound()

virtual BoundingAABB agxCollide::Mesh::calculateLocalBound ( ) const
overridevirtual

Calculate the bounding volume in the local coordinate system.

Returns
the calculated bounding volume.

Implements agxCollide::Shape.

◆ calculatePossibleTriangleOverlapsAlongLineSegment() [1/2]

virtual void agxCollide::Mesh::calculatePossibleTriangleOverlapsAlongLineSegment ( const agx::Vec3 segmentStartLocal,
const agx::Vec3 segmentEndLocal,
agx::UInt32Vector triangleIndices 
) const
pure virtual

Calculates an array of triangle indices of the triangles whose bounding volumes get intersected by a line segment.

Parameters
segmentStartLocalThe segment starting point in mesh coordinates.
segmentEndLocalThe segment ending point in mesh coordinates.
triangleIndicesA vector of triangle indices. It will be emptied before being written to.

Implemented in agxCollide::HeightField, and agxCollide::Trimesh.

◆ calculatePossibleTriangleOverlapsAlongLineSegment() [2/2]

virtual void agxCollide::Mesh::calculatePossibleTriangleOverlapsAlongLineSegment ( const agx::Vec3 segmentStartLocal,
const agx::Vec3 segmentEndLocal,
agxData::LocalVector< agx::UInt32 > &  triangleIndices 
) const
pure virtual

Calculates an array of triangle indices of the triangles whose bounding volumes get intersected by a line segment.

Parameters
segmentStartLocalThe segment starting point in mesh coordinates.
segmentEndLocalThe segment ending point in mesh coordinates.
triangleIndicesA vector of triangle indices. It will be emptied before being written to.

Implemented in agxCollide::HeightField, and agxCollide::Trimesh.

◆ calculateTriangleOverlapsAlongLineSegment()

void agxCollide::Mesh::calculateTriangleOverlapsAlongLineSegment ( const agx::Vec3 segmentStartLocal,
const agx::Vec3 segmentEndLocal,
TriangleLineSegmentResultVector triangleResults 
) const

Calculates all triangle overlaps of a line segment with the mesh.

Tries to fix some corner cases such as:

  • A line segment tangent to a mesh edge should get 2 contacts (one for each triangle).
  • A line segment intersecting through a mesh edge should get 1 contact (for one of the triangles).
  • Vertices will be treated as several edges (with 1-2 contacts per edge, see above).
    Parameters
    segmentStartLocalThe segment starting point in mesh coordinates.
    segmentEndLocalThe segment ending point in mesh coordinates.
    triangleResults- Vector of resulting overlapped triangles

◆ calculateTrianglesInVolume() [1/2]

void agxCollide::Mesh::calculateTrianglesInVolume ( const BoundingAABB volume,
const agx::AffineMatrix4x4 meshToWorld,
const agx::AffineMatrix4x4 volumeToWorld,
agx::UInt32Vector triangleIndices 
) const

Calculates an array of triangle indices of the triangles that are within a bounding volume.

Parameters
volumeThe bounding box.
meshToWorldA transformation from the mesh's local frame to world coordinates.
volumeToWorldA transformation from the volume's local frame to world coordinates.
triangleIndicesA vector of triangle indices. It will be emptied before writing to it.

Definition at line 996 of file Mesh.h.

References m_aabbTree.

◆ calculateTrianglesInVolume() [2/2]

void agxCollide::Mesh::calculateTrianglesInVolume ( const BoundingAABB volume,
const agx::AffineMatrix4x4 meshToWorld,
const agx::AffineMatrix4x4 volumeToWorld,
agxData::LocalVector< agx::UInt32 > &  triangleIndices 
) const

Definition at line 1005 of file Mesh.h.

References m_aabbTree.

◆ createFaceEdgeCirculator()

Mesh::FaceEdgeCirculator agxCollide::Mesh::createFaceEdgeCirculator ( size_t  triangleIndex) const
inline

Creates an FaceEdgeCirculator pointing to this Triangle and a Voronoi region.

Returns
The created FaceEdgeCirculator

Definition at line 1085 of file Mesh.h.

◆ createVertexEdgeCirculator()

Mesh::VertexEdgeCirculator agxCollide::Mesh::createVertexEdgeCirculator ( size_t  triangleIndex,
uint_fast8_t  localVertexIndex 
) const
inline

Creates an VertexEdgeCirculator pointing to this Triangle and a Voronoi region.

Parameters
triangleIndex- Index of the triangle
localVertexIndexThe local index of the vertex that the VertexEdgeCirculator should point to.
Returns
The created VertexEdgeCirculator

Definition at line 1013 of file Mesh.h.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ getBottomMargin()

agx::Real agxCollide::Mesh::getBottomMargin ( ) const
Returns
Bottom safety margin. This is the depth that is added below the lowest point in the terrain in local z direction, to prevent tunneling in this direction.

Definition at line 843 of file Mesh.h.

References m_collisionMeshData.

◆ getBvhTree()

const AabbTree * agxCollide::Mesh::getBvhTree ( ) const
Returns
The Trimesh's bounding volume hierarchy.

Definition at line 883 of file Mesh.h.

References m_aabbTree.

Referenced by agxCollide::Trimesh::calculatePossibleTriangleOverlapsAlongLineSegment().

◆ getCenter()

agx::Vec3 agxCollide::Mesh::getCenter ( ) const
overridevirtual
Returns
The center of the Mesh. Inherited from class Shape.

Reimplemented from agxCollide::Shape.

Definition at line 814 of file Mesh.h.

References m_collisionMeshData.

◆ getGlobalEdgeIndex()

size_t agxCollide::Mesh::getGlobalEdgeIndex ( size_t  triangleIndex,
uint_fast8_t  localEdgeIndex 
)
static

Computes the global edge index from a given triangle index and the local edge index within this triangle.

Mesh class.

Parameters
triangleIndexThe global triangle index.
localEdgeIndexThe local edge index within this triangle.
Returns
The global edge index.

Definition at line 725 of file Mesh.h.

Referenced by agxCollide::Mesh::Triangle::getHalfEdgePartnerGlobalEdgeIndex().

◆ getGlobalTriangleIndex()

size_t agxCollide::Mesh::getGlobalTriangleIndex ( size_t  globalEdgeIndex)
static
Parameters
globalEdgeIndexThe global edge index.
Returns
The global Triangle index which the edge (given as a global index) corresponds to.

Definition at line 743 of file Mesh.h.

◆ getGlobalVertexIndex()

size_t agxCollide::Mesh::getGlobalVertexIndex ( size_t  triangleIndex,
uint_fast8_t  localVertexIndex 
) const

Returns the global index of one of the three vertices in a triangle.

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

Definition at line 779 of file Mesh.h.

References m_collisionMeshData.

◆ getHalfEdgePartnerEdge()

uint32_t agxCollide::Mesh::getHalfEdgePartnerEdge ( size_t  globalEdgeIndex) const
Returns
The global edge index of an edge's half edge partner

Definition at line 797 of file Mesh.h.

References m_collisionMeshData.

◆ getLocalBound()

const BoundingAABB & agxCollide::Mesh::getLocalBound ( ) const

Definition at line 1097 of file Mesh.h.

References m_localBound.

◆ getLocalEdgeIndex()

size_t agxCollide::Mesh::getLocalEdgeIndex ( size_t  globalEdgeIndex)
static
Parameters
globalEdgeIndexThe global edge index.
Returns
The local edge index which the edge (given as a global index) corresponds to.

Definition at line 737 of file Mesh.h.

◆ getMeshData()

const CollisionMeshData * agxCollide::Mesh::getMeshData ( ) const
Returns
The CollisionMeshData containing all the mesh information.

Definition at line 871 of file Mesh.h.

References agx::ref_ptr< T >::get(), and m_collisionMeshData.

◆ getNumTriangles()

size_t agxCollide::Mesh::getNumTriangles ( ) const
Returns
The number of Triangles in the mesh data.

Definition at line 761 of file Mesh.h.

References m_collisionMeshData.

◆ getNumVertices()

size_t agxCollide::Mesh::getNumVertices ( ) const
Returns
The number of vertices in the mesh data.

Definition at line 749 of file Mesh.h.

References m_collisionMeshData.

◆ getTotalMaximumEdgeLength()

agx::Real agxCollide::Mesh::getTotalMaximumEdgeLength ( ) const
Returns
The maximum length of all triangle edges.

Definition at line 791 of file Mesh.h.

References m_collisionMeshData.

◆ getTriangle()

const Mesh::Triangle agxCollide::Mesh::getTriangle ( size_t  triangleIndex) const
inline
Parameters
triangleIndexThe index of the triangle.
Returns
Triangle

Definition at line 731 of file Mesh.h.

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

◆ getTriangleMaximumEdgeLength()

agx::Real agxCollide::Mesh::getTriangleMaximumEdgeLength ( size_t  triangleIndex) const
Parameters
triangleIndexThe index of the Triangle.
Returns
The length of the longest edge in the Triangle.

Definition at line 785 of file Mesh.h.

References m_collisionMeshData.

◆ getTriangleNormal()

agx::Vec3 agxCollide::Mesh::getTriangleNormal ( size_t  triangleIndex) const
Parameters
triangleIndexThe index of the Triangle.
Returns
The normal of the Triangle.

Definition at line 773 of file Mesh.h.

References m_collisionMeshData.

◆ getTriangleVertex()

agx::Vec3 agxCollide::Mesh::getTriangleVertex ( size_t  triangleIndex,
uint_fast8_t  localVertexIndex 
) const

Returns one of the three vertices in a triangle.

Parameters
triangleIndexIndex of the triangle the vertex belongs to.
localVertexIndexThe vertex's index within the triangle (0 to 2).
Returns
The vertex specified by the parameters.

Definition at line 767 of file Mesh.h.

References m_collisionMeshData.

Referenced by agxSDK::findMostParallelEdgeAmongNeighboringTriangles().

◆ getVertex()

agx::Vec3 agxCollide::Mesh::getVertex ( size_t  globalVertexIndex) const
Parameters
globalVertexIndexIndex of the vertex in the MeshData's vertices array.
Returns
Vertex specified by globalVertexIndex

Definition at line 755 of file Mesh.h.

References m_collisionMeshData.

◆ getVolume()

agx::Real agxCollide::Mesh::getVolume ( ) const
overridevirtual
Returns
The volume of the Mesh. Inherited from class Shape.

Implements agxCollide::Shape.

Definition at line 820 of file Mesh.h.

References m_collisionMeshData.

◆ hasHalfEdge()

bool agxCollide::Mesh::hasHalfEdge ( ) const
Returns
True if the Mesh has a half edge structure.

Definition at line 877 of file Mesh.h.

References m_collisionMeshData.

◆ hasInternalCenterPoint()

bool agxCollide::Mesh::hasInternalCenterPoint ( ) const
Returns
True if the center point of the mesh is inside the mesh, eg false for torus

Definition at line 837 of file Mesh.h.

References m_collisionMeshData.

◆ isConvexEdge()

bool agxCollide::Mesh::isConvexEdge ( size_t  globalEdgeIndex) const

Is an edge convex? Returns always true if half edge information is missing on this edge/the whole mesh.

Exactly straight edges will also be considered convex.

Parameters
globalEdgeIndex
Return values
Isthe edge convex?

◆ isConvexVertex()

bool agxCollide::Mesh::isConvexVertex ( size_t  triangleIndex,
size_t  localVertexIndex 
) const

Is an vertex convex? Returns always true if half edge information is missing on this vertex/the whole mesh.

Exactly straight edges will also be considered convex. Saddle points will return false. When encountering a hole, the edges until the whole will be considered.

Parameters
triangleIndexThe global index of the triangle
localVertexIndexThe local index of the vertex in the triangle
Return values
Isthe edge convex?

◆ isTerrain()

bool agxCollide::Mesh::isTerrain ( ) const
Returns
True if Mesh is terrain (it will not be a Manifold/closed then).

Definition at line 832 of file Mesh.h.

References m_collisionMeshData.

◆ isValid()

bool agxCollide::Mesh::isValid ( ) const
Returns
True if the Mesh is valid and can be used for collision detection and other purposes; false otherwise.

Definition at line 803 of file Mesh.h.

References m_collisionMeshData.

◆ isValidAndClosed()

bool agxCollide::Mesh::isValidAndClosed ( ) const
Returns
True if the Mesh is valid and can be used for collision detection and other purposes, and if it is a Manifold; false otherwise.

Definition at line 809 of file Mesh.h.

References m_collisionMeshData.

◆ isValidEdgeIndex()

bool agxCollide::Mesh::isValidEdgeIndex ( size_t  globalEdgeIndex) const
Parameters
globalEdgeIndexThe global index to examine.
Returns
Is the given edge index a valid edge index within this Mesh?

Definition at line 859 of file Mesh.h.

References m_collisionMeshData.

◆ isValidTriangleIndex()

bool agxCollide::Mesh::isValidTriangleIndex ( size_t  globalTriangleIndex) const
Parameters
globalTriangleIndexThe global index to examine.
Returns
Is the given triangle index a valid edge index within this Mesh?

Definition at line 865 of file Mesh.h.

References m_collisionMeshData.

◆ restore()

void agxCollide::Mesh::restore ( class agxStream::InputArchive in)
overrideprotected

◆ setBottomMargin()

void agxCollide::Mesh::setBottomMargin ( agx::Real  newMargin)

Sets a bottom safety margin that is added below the lowest point of the height field in local z direction, to prevent tunneling in this direction.

Will also update the bounding volume.

Parameters
newMarginThe desired bottom safety margin. Negative values will be ignored.

Definition at line 849 of file Mesh.h.

References agxCollide::Shape::incrementModifiedCount(), m_collisionMeshData, and updateBoundingVolume().

◆ store()

void agxCollide::Mesh::store ( class agxStream::OutputArchive out) const
overrideprotected

◆ updateBoundingVolume()

virtual const BoundingAABB & agxCollide::Mesh::updateBoundingVolume ( )
overridevirtual

Calculate the bounding volume based on the current Shape parameters including transformation.

Returns
new calculated bounding volume

Implements agxCollide::Shape.

Referenced by setBottomMargin().

◆ updateBvhTree()

virtual void agxCollide::Mesh::updateBvhTree ( )
protectedpure virtual

Implemented in agxCollide::Trimesh.

Member Data Documentation

◆ m_aabbTree

AabbTreeRef agxCollide::Mesh::m_aabbTree
protected

Definition at line 634 of file Mesh.h.

Referenced by calculateTrianglesInVolume(), and getBvhTree().

◆ m_collisionMeshData

◆ m_localBound

BoundingAABB agxCollide::Mesh::m_localBound
protected

Definition at line 635 of file Mesh.h.

Referenced by getLocalBound().


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