RavEngine
Loading...
Searching...
No Matches
physx::Gu::ConvexMesh Class Reference
Inheritance diagram for physx::Gu::ConvexMesh:
[legend]
Collaboration diagram for physx::Gu::ConvexMesh:
[legend]

Public Member Functions

 ConvexMesh (PxBaseFlags baseFlags)
 
void preExportDataReset ()
 
virtual void exportExtraData (PxSerializationContext &stream)
 
void importExtraData (PxDeserializationContext &context)
 
void resolveReferences (PxDeserializationContext &)
 
virtual void requiresObjects (PxProcessPxBaseCallback &)
 
 ConvexMesh (MeshFactory *factory)
 
 ConvexMesh (MeshFactory *factory, ConvexHullInitData &data)
 
bool load (PxInputStream &stream)
 
virtual void onRefCountZero ()
 
virtual PxU32 getReferenceCount () const
 Returns the reference count of the object.
 
virtual void acquireReference ()
 Acquires a counted reference to this object.
 
virtual void release ()
 Decrements the reference count of a convex mesh and releases it if the new reference count is zero.

 
virtual PxU32 getNbVertices () const
 Returns the number of vertices.
 
virtual const PxVec3 * getVertices () const
 Returns the vertices.
 
virtual const PxU8 * getIndexBuffer () const
 Returns the index buffer.
 
virtual PxU32 getNbPolygons () const
 Returns the number of polygons.
 
virtual bool getPolygonData (PxU32 i, PxHullPolygon &data) const
 Returns the polygon data.
 
virtual bool isGpuCompatible () const
 This method decides whether a convex mesh is gpu compatible. If the total number of vertices are more than 64 or any number of vertices in a polygon is more than 32, or convex hull data was not cooked with GPU data enabled during cooking or was loaded from a serialized collection, the convex hull is incompatible with GPU collision detection. Otherwise it is compatible.
 
virtual void getMassInformation (PxReal &mass, PxMat33 &localInertia, PxVec3 &localCenterOfMass) const
 Returns the mass properties of the mesh assuming unit density.
 
virtual PxBounds3 getLocalBounds () const
 Returns the local-space (vertex space) AABB from the convex mesh.
 
virtual const PxReal * getSDF () const
 Returns the local-space Signed Distance Field for this mesh if it has one.
 
PX_FORCE_INLINE PxU32 getNbVerts () const
 
PX_FORCE_INLINE const PxVec3 * getVerts () const
 
PX_FORCE_INLINE PxU32 getNbPolygonsFast () const
 
PX_FORCE_INLINE const HullPolygonData & getPolygon (PxU32 i) const
 
PX_FORCE_INLINE const HullPolygonData * getPolygons () const
 
PX_FORCE_INLINE PxU32 getNbEdges () const
 
PX_FORCE_INLINE const ConvexHullData & getHull () const
 
PX_FORCE_INLINE ConvexHullData & getHull ()
 
PX_FORCE_INLINE const CenterExtents & getLocalBoundsFast () const
 
PX_FORCE_INLINE PxReal getMass () const
 
PX_FORCE_INLINE void setMass (PxReal mass)
 
PX_FORCE_INLINE const PxMat33 & getInertia () const
 
PX_FORCE_INLINE void setInertia (const PxMat33 &inertia)
 
PX_FORCE_INLINE BigConvexData * getBigConvexData () const
 
PX_FORCE_INLINE void setBigConvexData (BigConvexData *bcd)
 
PX_FORCE_INLINE PxU32 getBufferSize () const
 
PX_FORCE_INLINE void setMeshFactory (MeshFactory *f)
 
PX_FORCE_INLINE void setNb (PxU32 nb)
 
- Public Member Functions inherited from physx::PxConvexMesh
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type.
 
- Public Member Functions inherited from physx::PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object.
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag

 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags

 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags.
 
virtual bool isReleasable () const
 Whether the object is subordinate.
 
- Public Member Functions inherited from physx::PxUserAllocated
PX_INLINE void * operator new (size_t, void *address)
 
PX_INLINE void operator delete (void *, void *)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void * operator new[] (size_t size, size_t, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete (void *ptr, Alloc alloc, const char *fileName, int line)
 
template<typename Alloc >
PX_INLINE void operator delete[] (void *ptr, Alloc alloc, const char *fileName, int line)
 
PX_INLINE void operator delete (void *ptr)
 
PX_INLINE void operator delete[] (void *ptr)
 

Static Public Member Functions

static PX_PHYSX_COMMON_API ConvexMesh * createObject (PxU8 *&address, PxDeserializationContext &context)
 
static PX_PHYSX_COMMON_API void getBinaryMetaData (PxOutputStream &stream)
 

Protected Attributes

ConvexHullData mHullData
 
PxBitAndDword mNb
 
SDF * mSdfData
 
BigConvexData * mBigConvexData
 optional, only for large meshes! PT: redundant with ptr in chull data? Could also be end of other buffer
 
PxReal mMass
 
PxMat33 mInertia
 
- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Additional Inherited Members

- Protected Member Functions inherited from physx::PxConvexMesh
PX_INLINE PxConvexMesh (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxConvexMesh (PxBaseFlags baseFlags)
 
virtual bool isKindOf (const char *name) const
 Returns whether a given type name matches with the type of this instance.
 
- Protected Member Functions inherited from physx::PxRefCounted
PX_INLINE PxRefCounted (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxRefCounted (PxBaseFlags baseFlags)
 
- Protected Member Functions inherited from physx::PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags.
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags.
 
virtual ~PxBase ()
 Destructor.
 
template<class T >
bool typeMatch () const
 

Member Function Documentation

◆ acquireReference()

void ConvexMesh::acquireReference ( )
virtual

Acquires a counted reference to this object.

This method increases the reference count of the object by 1. Decrement the reference count by calling release()

Implements physx::PxRefCounted.

◆ getIndexBuffer()

virtual const PxU8 * physx::Gu::ConvexMesh::getIndexBuffer ( ) const
inlinevirtual

Returns the index buffer.

Returns
Index buffer.
See also
getNbPolygons() getPolygonData()

Implements physx::PxConvexMesh.

◆ getLocalBounds()

PxBounds3 ConvexMesh::getLocalBounds ( ) const
virtual

Returns the local-space (vertex space) AABB from the convex mesh.

Returns
local-space bounds

Implements physx::PxConvexMesh.

◆ getMassInformation()

void ConvexMesh::getMassInformation ( PxReal &  mass,
PxMat33 &  localInertia,
PxVec3 &  localCenterOfMass 
) const
virtual

Returns the mass properties of the mesh assuming unit density.

The following relationship holds between mass and volume:

mass = volume * density

The mass of a unit density mesh is equal to its volume, so this function returns the volume of the mesh.

Similarly, to obtain the localInertia of an identically shaped object with a uniform density of d, simply multiply the localInertia of the unit density mesh by d.

Parameters
[out]massThe mass of the mesh assuming unit density.
[out]localInertiaThe inertia tensor in mesh local space assuming unit density.
[out]localCenterOfMassPosition of center of mass (or centroid) in mesh local space.

Implements physx::PxConvexMesh.

◆ getNbPolygons()

virtual PxU32 physx::Gu::ConvexMesh::getNbPolygons ( ) const
inlinevirtual

Returns the number of polygons.

Returns
Number of polygons.
See also
getIndexBuffer() getPolygonData()

Implements physx::PxConvexMesh.

◆ getNbVertices()

virtual PxU32 physx::Gu::ConvexMesh::getNbVertices ( ) const
inlinevirtual

Returns the number of vertices.

Returns
Number of vertices.
See also
getVertices()

Implements physx::PxConvexMesh.

◆ getPolygonData()

bool ConvexMesh::getPolygonData ( PxU32  index,
PxHullPolygon &  data 
) const
virtual

Returns the polygon data.

Parameters
[in]indexPolygon index in [0 ; getNbPolygons()[.
[out]dataPolygon data.
Returns
True if success.
See also
getIndexBuffer() getNbPolygons()

Implements physx::PxConvexMesh.

◆ getReferenceCount()

PxU32 ConvexMesh::getReferenceCount ( ) const
virtual

Returns the reference count of the object.

At creation, the reference count of the object is 1. Every other object referencing this object increments the count by 1. When the reference count reaches 0, and only then, the object gets destroyed automatically.

Returns
the current reference count.

Implements physx::PxRefCounted.

◆ getSDF()

const PxReal * ConvexMesh::getSDF ( ) const
virtual

Returns the local-space Signed Distance Field for this mesh if it has one.

Returns
local-space SDF.

Implements physx::PxConvexMesh.

◆ getVertices()

virtual const PxVec3 * physx::Gu::ConvexMesh::getVertices ( ) const
inlinevirtual

Returns the vertices.

Returns
Array of vertices.
See also
getNbVertices()

Implements physx::PxConvexMesh.

◆ isGpuCompatible()

bool ConvexMesh::isGpuCompatible ( ) const
virtual

This method decides whether a convex mesh is gpu compatible. If the total number of vertices are more than 64 or any number of vertices in a polygon is more than 32, or convex hull data was not cooked with GPU data enabled during cooking or was loaded from a serialized collection, the convex hull is incompatible with GPU collision detection. Otherwise it is compatible.

Returns
True if the convex hull is gpu compatible

Implements physx::PxConvexMesh.

◆ onRefCountZero()

void ConvexMesh::onRefCountZero ( )
virtual

Reimplemented from physx::PxRefCounted.

◆ release()

void ConvexMesh::release ( )
virtual

Decrements the reference count of a convex mesh and releases it if the new reference count is zero.

See also
PxPhysics.createConvexMesh() PxConvexMeshGeometry PxShape

Implements physx::PxConvexMesh.


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