|
RavEngine
|
A triangle mesh, also called a 'polygon soup'. More...
#include <PxTriangleMesh.h>
Public Member Functions | |
| virtual PxU32 | getNbVertices () const =0 |
| Returns the number of vertices. | |
| virtual const PxVec3 * | getVertices () const =0 |
| Returns the vertices. | |
| virtual PxVec3 * | getVerticesForModification ()=0 |
| Returns all mesh vertices for modification. | |
| virtual PxBounds3 | refitBVH ()=0 |
| Refits BVH for mesh vertices. | |
| virtual PxU32 | getNbTriangles () const =0 |
| Returns the number of triangles. | |
| virtual const void * | getTriangles () const =0 |
| Returns the triangle indices. | |
| virtual PxTriangleMeshFlags | getTriangleMeshFlags () const =0 |
| Reads the PxTriangleMesh flags. | |
| virtual const PxU32 * | getTrianglesRemap () const =0 |
| Returns the triangle remapping table. | |
| virtual void | release ()=0 |
| Decrements the reference count of a triangle mesh and releases it if the new reference count is zero. | |
| virtual PxMaterialTableIndex | getTriangleMaterialIndex (PxTriangleID triangleIndex) const =0 |
| Returns material table index of given triangle. | |
| virtual PxBounds3 | getLocalBounds () const =0 |
| Returns the local-space (vertex space) AABB from the triangle mesh. | |
| virtual const PxReal * | getSDF () const =0 |
| Returns the local-space Signed Distance Field for this mesh if it has one. | |
| virtual void | getSDFDimensions (PxU32 &numX, PxU32 &numY, PxU32 &numZ) const =0 |
| Returns the resolution of the local-space dense SDF. | |
| virtual void | setPreferSDFProjection (bool preferProjection)=0 |
| Sets whether this mesh should be preferred for SDF projection. | |
| virtual bool | getPreferSDFProjection () const =0 |
| Returns whether this mesh prefers SDF projection. | |
| virtual void | getMassInformation (PxReal &mass, PxMat33 &localInertia, PxVec3 &localCenterOfMass) const =0 |
| Returns the mass properties of the mesh assuming unit density. | |
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 | |
| virtual const char * | getConcreteTypeName () const =0 |
| Returns string name of dynamic type. | |
| 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 | PxTriangleMesh (PxType concreteType, PxBaseFlags baseFlags) |
| PX_INLINE | PxTriangleMesh (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 |
A triangle mesh, also called a 'polygon soup'.
It is represented as an indexed triangle list. There are no restrictions on the triangle data.
To avoid duplicating data when you have several instances of a particular mesh positioned differently, you do not use this class to represent a mesh object directly. Instead, you create an instance of this mesh via the PxTriangleMeshGeometry and PxShape classes.
To create an instance of this class call PxPhysics::createTriangleMesh(), and release() to delete it. This is only possible once you have released all of its PxShape instances.
|
pure virtual |
Returns the local-space (vertex space) AABB from the triangle mesh.
Implemented in physx::Gu::TriangleMesh.
|
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.
| [out] | mass | The mass of the mesh assuming unit density. |
| [out] | localInertia | The inertia tensor in mesh local space assuming unit density. |
| [out] | localCenterOfMass | Position of center of mass (or centroid) in mesh local space. |
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the number of triangles.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the number of vertices.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns whether this mesh prefers SDF projection.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the local-space Signed Distance Field for this mesh if it has one.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the resolution of the local-space dense SDF.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns material table index of given triangle.
This function takes a post cooking triangle index.
| [in] | triangleIndex | (internal) index of desired triangle |
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Reads the PxTriangleMesh flags.
See the list of flags #PxTriangleMeshFlag
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the triangle indices.
The indices can be 16 or 32bit depending on the number of triangles in the mesh. Call getTriangleMeshFlags() to know if the indices are 16 or 32 bits.
The number of indices is the number of triangles * 3.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the triangle remapping table.
The triangles are internally sorted according to various criteria. Hence the internal triangle order does not always match the original (user-defined) order. The remapping table helps finding the old indices knowing the new ones:
remapTable[ internalTriangleIndex ] = originalTriangleIndex
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns the vertices.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Returns all mesh vertices for modification.
This function will return the vertices of the mesh so that their positions can be changed in place. After modifying the vertices you must call refitBVH for the refitting to actually take place. This function maintains the old mesh topology (triangle indices).
Implemented in physx::Gu::TriangleMesh, physx::Gu::BV4TriangleMesh, and physx::Gu::RTreeTriangleMesh.
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from physx::PxRefCounted.
Reimplemented in physx::PxBVH33TriangleMesh, and physx::PxBVH34TriangleMesh.
|
pure virtual |
Refits BVH for mesh vertices.
This function will refit the mesh BVH to correctly enclose the new positions updated by getVerticesForModification. Mesh BVH will not be reoptimized by this function so significantly different new positions will cause significantly reduced performance.
Implemented in physx::Gu::TriangleMesh, physx::Gu::BV4TriangleMesh, and physx::Gu::RTreeTriangleMesh.
|
pure virtual |
Decrements the reference count of a triangle mesh and releases it if the new reference count is zero.
Implements physx::PxRefCounted.
Implemented in physx::Gu::TriangleMesh.
|
pure virtual |
Sets whether this mesh should be preferred for SDF projection.
By default, meshes are flagged as preferring projection and the decisions on which mesh to project is based on the triangle and vertex count. The model with the fewer triangles is projected onto the SDF of the more detailed mesh. If one of the meshes is set to prefer SDF projection (default) and the other is set to not prefer SDF projection, model flagged as preferring SDF projection will be projected onto the model flagged as not preferring, regardless of the detail of the respective meshes. Where both models are flagged as preferring no projection, the less detailed model will be projected as before.
| [in] | preferProjection | Indicates if projection is preferred |
Implemented in physx::Gu::TriangleMesh.