17#ifndef AGXCOLLIDE_TRIMESH_H
18#define AGXCOLLIDE_TRIMESH_H
54 CLOCKWISE_ORIENTATION = 0x1,
77 REMOVE_DUPLICATE_VERTICES = 0x40,
82 RECALCULATE_NORMALS_GIVEN_FIRST_TRIANGLE = 0x80
135 const char* sourceName, uint32_t optionsMask = Trimesh::REMOVE_DUPLICATE_VERTICES,
agx::Real bottomMargin = 0);
146 virtual void calculatePossibleTriangleOverlapsAlongLineSegment(
158 virtual void calculatePossibleTriangleOverlapsAlongLineSegment(
248 const char* sourceName,
249 uint32_t optionsMask);
255 void finalize(
const char* sourceName,
bool showWarnings, uint32_t optionsMask);
261 void flipNormal(
const size_t triangleIndex);
266 bool getTriangleHalfEdgePartnerTriangleIndexAndLocalEdgeIndex(
const size_t triangleIndex,
const size_t localEdgeIndex,
size_t& neighborIndex,
size_t& neighborLocalEdgeIndex);
287 const char* sourceName, uint32_t optionsMask = 0);
318 this->
getBvhTree()->findCollisionWithLineSegment(segmentStartLocal, segmentEndLocal, triangleIndices);
328 this->
getBvhTree()->findCollisionWithLineSegment(segmentStartLocal, segmentEndLocal, triangleIndices);
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
const AabbTree * getBvhTree() const
Type
Define the type of a Shape.
Triangle mesh for geometric intersection tests.
virtual ~Trimesh()
Hiding destructor.
agx::ref_ptr< const Trimesh > m_shallowCopySource
const Trimesh * getShallowCopySource()
virtual void updateBvhTree() override
Update the bounding volume hierarchy. Internal method.
TrimeshOptionsFlags
Parameters for trimesh creation from data set.
void calculateMassProperties(bool showWarnings)
Calculates mass properties.
Trimesh * deepCopy() const
Creates a new Trimesh which copies data from this one.
void finalizeMeshTopology(bool showWarnings, uint32_t optionsMask)
Finalizes the mesh topology, including mesh legality checks as well as normal and maximum error bound...
const agx::String & getSourceName() const
Gets source name used when creating (can be interesting for debugging meshes).
void updateMeshGeometry(bool showWarnings, bool recalculateMassProperties=true)
Updates the mesh geometry data like normals or edge convexity.
uint32_t getOptionsMask() const
Gets option mask used when creating (can be interesting for debugging meshes).
bool isShallowCopy() const
Trimesh * shallowCopy() const
Creates a new Trimesh which shares data with this one.
virtual Shape * clone() const override
Create a clone.
virtual void calculatePossibleTriangleOverlapsAlongLineSegment(const agx::Vec3 &segmentStartLocal, const agx::Vec3 &segmentEndLocal, agx::UInt32Vector &triangleIndices) const override
Calculates an array of triangle indices of the triangles whose bounding volumes get intersected by a ...
void setValuesAsShallowCopy(const Trimesh *other)
Trimesh(Type type, agx::Physics::Geometry::ShapePtr entity)
Hiding default constructor for child classes.
const agx::String & getWarnings() const
Gets warnings occurring when creating (can be interesting for debugging meshes).
Trimesh(Type type, agx::Physics::Geometry::ShapePtr entity, const agx::Vec3Vector *vertices, const agx::UInt32Vector *indices, const char *sourceName, uint32_t optionsMask=0)
Hidden, should only be called by child classes.
Trimesh(const agx::Vec3Vector *vertices, const agx::UInt32Vector *indices, const char *sourceName, uint32_t optionsMask=Trimesh::REMOVE_DUPLICATE_VERTICES, agx::Real bottomMargin=0)
Constructs a new Trimesh object from a vector of vertices and indices each.
Pointer to a entity instance of type Physics.Geometry.Shape.
Smart pointer for handling referenced counted objects.
This namespace consists of a set of classes for handling geometric intersection tests including boole...