RavEngine
Loading...
Searching...
No Matches
physx::PxConvexMesh Class Referenceabstract

A convex mesh. More...

#include <PxConvexMesh.h>

Inheritance diagram for physx::PxConvexMesh:
[legend]
Collaboration diagram for physx::PxConvexMesh:
[legend]

Public Member Functions

virtual PxU32 getNbVertices () const =0
 Returns the number of vertices.
 
virtual const PxVec3 * getVertices () const =0
 Returns the vertices.
 
virtual const PxU8 * getIndexBuffer () const =0
 Returns the index buffer.
 
virtual PxU32 getNbPolygons () const =0
 Returns the number of polygons.
 
virtual bool getPolygonData (PxU32 index, PxHullPolygon &data) const =0
 Returns the polygon data.
 
virtual void release ()=0
 Decrements the reference count of a convex mesh and releases it if the new reference count is zero.

 
virtual void getMassInformation (PxReal &mass, PxMat33 &localInertia, PxVec3 &localCenterOfMass) const =0
 Returns the mass properties of the mesh assuming unit density.
 
virtual PxBounds3 getLocalBounds () const =0
 Returns the local-space (vertex space) AABB from the convex mesh.
 
virtual const PxReal * getSDF () const =0
 Returns the local-space Signed Distance Field for this mesh if it has one.
 
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type.
 
virtual bool isGpuCompatible () const =0
 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.
 
- Public Member Functions inherited from physx::PxRefCounted
virtual PxU32 getReferenceCount () const =0
 Returns the reference count of the object.
 
virtual void acquireReference ()=0
 Acquires a counted reference to this object.
 
- 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.
 

Protected Member Functions

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
virtual void onRefCountZero ()
 
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
 

Additional Inherited Members

- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Detailed Description

A convex mesh.

Internally represented as a list of convex polygons. The number of polygons is limited to 256.

To avoid duplicating data when you have several instances of a particular mesh positioned differently, you do not use this class to represent a convex object directly. Instead, you create an instance of this mesh via the PxConvexMeshGeometry and PxShape classes.

Creation

To create an instance of this class call PxPhysics::createConvexMesh(), and PxConvexMesh::release() to delete it. This is only possible once you have released all of its #PxShape instances.

Visualizations:

See also
PxConvexMeshDesc PxPhysics.createConvexMesh()

Member Function Documentation

◆ getConcreteTypeName()

virtual const char * physx::PxConvexMesh::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Implements physx::PxBase.

◆ getIndexBuffer()

virtual const PxU8 * physx::PxConvexMesh::getIndexBuffer ( ) const
pure virtual

Returns the index buffer.

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

Implemented in physx::Gu::ConvexMesh.

◆ getLocalBounds()

virtual PxBounds3 physx::PxConvexMesh::getLocalBounds ( ) const
pure virtual

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

Returns
local-space bounds

Implemented in physx::Gu::ConvexMesh.

◆ getMassInformation()

virtual void physx::PxConvexMesh::getMassInformation ( PxReal &  mass,
PxMat33 &  localInertia,
PxVec3 &  localCenterOfMass 
) const
pure 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.

Implemented in physx::Gu::ConvexMesh.

◆ getNbPolygons()

virtual PxU32 physx::PxConvexMesh::getNbPolygons ( ) const
pure virtual

Returns the number of polygons.

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

Implemented in physx::Gu::ConvexMesh.

◆ getNbVertices()

virtual PxU32 physx::PxConvexMesh::getNbVertices ( ) const
pure virtual

Returns the number of vertices.

Returns
Number of vertices.
See also
getVertices()

Implemented in physx::Gu::ConvexMesh.

◆ getPolygonData()

virtual bool physx::PxConvexMesh::getPolygonData ( PxU32  index,
PxHullPolygon &  data 
) const
pure virtual

Returns the polygon data.

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

Implemented in physx::Gu::ConvexMesh.

◆ getSDF()

virtual const PxReal * physx::PxConvexMesh::getSDF ( ) const
pure virtual

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

Returns
local-space SDF.

Implemented in physx::Gu::ConvexMesh.

◆ getVertices()

virtual const PxVec3 * physx::PxConvexMesh::getVertices ( ) const
pure virtual

Returns the vertices.

Returns
Array of vertices.
See also
getNbVertices()

Implemented in physx::Gu::ConvexMesh.

◆ isGpuCompatible()

virtual bool physx::PxConvexMesh::isGpuCompatible ( ) const
pure 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

Implemented in physx::Gu::ConvexMesh.

◆ isKindOf()

virtual bool physx::PxConvexMesh::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from physx::PxRefCounted.

◆ release()

virtual void physx::PxConvexMesh::release ( )
pure 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::PxRefCounted.

Implemented in physx::Gu::ConvexMesh.


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