AGX Dynamics  2.37.3.2
agxCollide::ConvexFactory Class Reference

Class for creating convex meshes from a set of vertices and indices. More...

#include <ConvexFactory.h>

+ Inheritance diagram for agxCollide::ConvexFactory:

Classes

struct  Parameters
 
struct  VHACDParameters
 

Public Types

typedef agx::ref_ptr< const Parameters > ParametersConstRef
 
typedef agx::ref_ptr< Parameters > ParametersRef
 
typedef agx::ref_ptr< const VHACDParameters > VHACDParametersConstRef
 
typedef agx::ref_ptr< VHACDParameters > VHACDParametersRef
 

Public Member Functions

 ConvexFactory ()
 Constructor. More...
 
size_t build (const agx::Vec3Vector &vertices, const agx::UInt32Vector &indices, const Parameters *parameters=nullptr, const agx::Matrix3x3 &transformation=agx::Matrix3x3(), const agx::Vec3 &translation=agx::Vec3())
 Constructs a number of Convex shapes from a triangle list. More...
 
size_t build (const agxIO::MeshReader *reader, const Parameters *parameters=nullptr, const agx::Matrix3x3 &transformation=agx::Matrix3x3(), const agx::Vec3 &translation=agx::Vec3())
 Constructs a number of Convex shapes from the triangles read with the MeshReader. More...
 
const ConvexRefVector & getConvexShapes () const
 
size_t getNumShapes () const
 return num shapes More...
 
agxCollide::ConvexRef getShape (size_t i)
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

virtual ~ConvexFactory ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class for creating convex meshes from a set of vertices and indices.

First the method build() is called. If this was successful (return > 0) the created ConvexShapes will be available in a vector (getConvexShapes())

Parameters must be set before calling the build method

Definition at line 40 of file ConvexFactory.h.

Member Typedef Documentation

◆ ParametersConstRef

◆ ParametersRef

◆ VHACDParametersConstRef

◆ VHACDParametersRef

Constructor & Destructor Documentation

◆ ConvexFactory()

agxCollide::ConvexFactory::ConvexFactory ( )

Constructor.

◆ ~ConvexFactory()

virtual agxCollide::ConvexFactory::~ConvexFactory ( )
protectedvirtual

Member Function Documentation

◆ build() [1/2]

size_t agxCollide::ConvexFactory::build ( const agx::Vec3Vector &  vertices,
const agx::UInt32Vector &  indices,
const Parameters *  parameters = nullptr,
const agx::Matrix3x3 &  transformation = agx::Matrix3x3(),
const agx::Vec3 &  translation = agx::Vec3() 
)

Constructs a number of Convex shapes from a triangle list.

◆ build() [2/2]

size_t agxCollide::ConvexFactory::build ( const agxIO::MeshReader *  reader,
const Parameters *  parameters = nullptr,
const agx::Matrix3x3 &  transformation = agx::Matrix3x3(),
const agx::Vec3 &  translation = agx::Vec3() 
)

Constructs a number of Convex shapes from the triangles read with the MeshReader.

The reader MUST be successfully initialized with data before this call.

Returns
number of created Convex meshes, 0 if error occurs.

◆ getConvexShapes()

const ConvexRefVector& agxCollide::ConvexFactory::getConvexShapes ( ) const
Returns
a vector of constructed Convex shapes

◆ getNumShapes()

size_t agxCollide::ConvexFactory::getNumShapes ( ) const

return num shapes

◆ getShape()

agxCollide::ConvexRef agxCollide::ConvexFactory::getShape ( size_t  i)
Returns
the ith shape

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