PxConvexMesh Class Reference
[Geomutils]
A convex mesh.
More...
#include <PxConvexMesh.h>


Public Member Functions | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbVertices () const =0 |
Returns the number of vertices. | |
virtual PX_PHYSX_COMMON_API const PxVec3 * | getVertices () const =0 |
Returns the vertices. | |
virtual PX_PHYSX_COMMON_API const PxU8 * | getIndexBuffer () const =0 |
Returns the index buffer. | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbPolygons () const =0 |
Returns the number of polygons. | |
virtual PX_PHYSX_COMMON_API bool | getPolygonData (PxU32 index, PxHullPolygon &data) const =0 |
Returns the polygon data. | |
virtual PX_PHYSX_COMMON_API void | release ()=0 |
Releases the convex mesh. | |
virtual PX_PHYSX_COMMON_API PxU32 | getReferenceCount () const =0 |
Returns the reference count for shared meshes. | |
virtual PX_PHYSX_COMMON_API void | getMassInformation (PxReal &mass, PxMat33 &localInertia, PxVec3 &localCenterOfMass) const =0 |
Returns the mass properties of the mesh assuming unit density. | |
virtual PX_PHYSX_COMMON_API PxBounds3 | getLocalBounds () const =0 |
Returns the local-space (vertex space) AABB from the convex mesh. | |
virtual PX_INLINE const char * | getConcreteTypeName () const |
returns string name of dynamic type. | |
Protected Member Functions | |
virtual | ~PxConvexMesh () |
PxConvexMesh () | |
PxConvexMesh (PxRefResolver &v) | |
virtual bool | isKindOf (const char *name) const |
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:
- PxVisualizationParameter::eCOLLISION_AABBS
- PxVisualizationParameter::eCOLLISION_SHAPES
- PxVisualizationParameter::eCOLLISION_AXES
- PxVisualizationParameter::eCOLLISION_FNORMALS
- PxVisualizationParameter::eCOLLISION_EDGES
Constructor & Destructor Documentation
virtual PxConvexMesh::~PxConvexMesh | ( | ) | [inline, protected, virtual] |
PxConvexMesh::PxConvexMesh | ( | ) | [inline, protected] |
PxConvexMesh::PxConvexMesh | ( | PxRefResolver & | v | ) | [inline, protected] |
Member Function Documentation
virtual PX_INLINE const char* PxConvexMesh::getConcreteTypeName | ( | ) | const [inline, virtual] |
returns string name of dynamic type.
- Returns:
- class name of most derived type of this object.
Reimplemented from PxSerializable.
virtual PX_PHYSX_COMMON_API const PxU8* PxConvexMesh::getIndexBuffer | ( | ) | const [pure virtual] |
virtual PX_PHYSX_COMMON_API PxBounds3 PxConvexMesh::getLocalBounds | ( | ) | const [pure virtual] |
Returns the local-space (vertex space) AABB from the convex mesh.
- Returns:
- local-space bounds
virtual PX_PHYSX_COMMON_API void 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] 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.
virtual PX_PHYSX_COMMON_API PxU32 PxConvexMesh::getNbPolygons | ( | ) | const [pure virtual] |
Returns the number of polygons.
- Returns:
- Number of polygons.
- See also:
- getIndexBuffer() getPolygonData()
virtual PX_PHYSX_COMMON_API PxU32 PxConvexMesh::getNbVertices | ( | ) | const [pure virtual] |
virtual PX_PHYSX_COMMON_API bool PxConvexMesh::getPolygonData | ( | PxU32 | index, | |
PxHullPolygon & | data | |||
) | const [pure virtual] |
Returns the polygon data.
- Parameters:
-
[in] index Polygon index in [0 ; getNbPolygons()[. [out] data Polygon data.
- Returns:
- True if success.
- See also:
- getIndexBuffer() getNbPolygons()
virtual PX_PHYSX_COMMON_API PxU32 PxConvexMesh::getReferenceCount | ( | ) | const [pure virtual] |
Returns the reference count for shared meshes.
At creation, the reference count of the convex mesh is 1. Every shape referencing this convex mesh increments the count by 1. When the reference count reaches 0, and only then, the convex mesh gets destroyed automatically.
- Returns:
- the current reference count.
virtual PX_PHYSX_COMMON_API const PxVec3* PxConvexMesh::getVertices | ( | ) | const [pure virtual] |
virtual bool PxConvexMesh::isKindOf | ( | const char * | name | ) | const [inline, protected, virtual] |
virtual PX_PHYSX_COMMON_API void PxConvexMesh::release | ( | ) | [pure virtual] |
Releases the convex mesh.
- Note:
- This will decrease the reference count by one.
The documentation for this class was generated from the following file:
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com