PhysX SDK 3.2 API Reference: PxTriangleMesh Class Reference

PhysX SDK 3.2 API

PxTriangleMesh Class Reference
[Geomutils]

A triangle mesh, also called a 'polygon soup'. More...

#include <PxTriangleMesh.h>

Inheritance diagram for PxTriangleMesh:
Collaboration diagram for PxTriangleMesh:

List of all members.


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 PxU32 getNbTriangles () const =0
 Returns the number of triangles.
virtual PX_PHYSX_COMMON_API
const void * 
getTriangles () const =0
 Returns the triangle indices.
virtual PX_PHYSX_COMMON_API bool has16BitTriangleIndices () const =0
 Returns whether the triangle indices are 16 or 32bits.
virtual PX_PHYSX_COMMON_API
const PxU32
getTrianglesRemap () const =0
 Returns the triangle remapping table.
virtual PX_PHYSX_COMMON_API void release ()=0
 Destroys the triangle mesh.
virtual PX_PHYSX_COMMON_API
PxMaterialTableIndex 
getTriangleMaterialIndex (PxTriangleID triangleIndex) const =0
 Returns material table index of given triangle.
virtual PX_PHYSX_COMMON_API
PxBounds3 
getLocalBounds () const =0
 Returns the local-space (vertex space) AABB from the triangle mesh.
virtual PX_PHYSX_COMMON_API PxU32 getReferenceCount () const =0
 Returns the reference count for shared meshes.
virtual PX_INLINE const char * getConcreteTypeName () const
 returns string name of dynamic type.

Protected Member Functions

 PxTriangleMesh ()
 PxTriangleMesh (PxRefResolver &v)
virtual ~PxTriangleMesh ()
virtual bool isKindOf (const char *name) const

Detailed Description

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.

Creation

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.

Visualizations:

See also:
PxTriangleMeshDesc PxTriangleMeshGeometry PxShape PxPhysics.createTriangleMesh()

Constructor & Destructor Documentation

PxTriangleMesh::PxTriangleMesh (  )  [inline, protected]

PxTriangleMesh::PxTriangleMesh ( PxRefResolver v  )  [inline, protected]

virtual PxTriangleMesh::~PxTriangleMesh (  )  [inline, protected, virtual]


Member Function Documentation

virtual PX_INLINE const char* PxTriangleMesh::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 PxBounds3 PxTriangleMesh::getLocalBounds (  )  const [pure virtual]

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

Returns:
local-space bounds

virtual PX_PHYSX_COMMON_API PxU32 PxTriangleMesh::getNbTriangles (  )  const [pure virtual]

Returns the number of triangles.

Returns:
number of triangles
See also:
getTriangles() has16BitTriangleIndices() getTrianglesRemap()

virtual PX_PHYSX_COMMON_API PxU32 PxTriangleMesh::getNbVertices (  )  const [pure virtual]

Returns the number of vertices.

Returns:
number of vertices
See also:
getVertices()

virtual PX_PHYSX_COMMON_API PxU32 PxTriangleMesh::getReferenceCount (  )  const [pure virtual]

Returns the reference count for shared meshes.

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

Returns:
the current reference count.

virtual PX_PHYSX_COMMON_API PxMaterialTableIndex PxTriangleMesh::getTriangleMaterialIndex ( PxTriangleID  triangleIndex  )  const [pure virtual]

Returns material table index of given triangle.

This function takes a post cooking triangle index.

Parameters:
[in] triangleIndex (internal) index of desired triangle
Returns:
Material table index, or 0xffff if no per-triangle materials are used

virtual PX_PHYSX_COMMON_API const void* PxTriangleMesh::getTriangles (  )  const [pure virtual]

Returns the triangle indices.

The indices can be 16 or 32bit depending on the number of triangles in the mesh. Call has16BitTriangleIndices() to know if the indices are 16 or 32 bits.

The number of indices is the number of triangles * 3.

Returns:
array of triangles
See also:
getNbTriangles() has16BitTriangleIndices() getTrianglesRemap()

virtual PX_PHYSX_COMMON_API const PxU32* PxTriangleMesh::getTrianglesRemap (  )  const [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

Returns:
the remapping table
See also:
getNbTriangles() getTriangles() has16BitTriangleIndices()

virtual PX_PHYSX_COMMON_API const PxVec3* PxTriangleMesh::getVertices (  )  const [pure virtual]

Returns the vertices.

Returns:
array of vertices
See also:
getNbVertices()

virtual PX_PHYSX_COMMON_API bool PxTriangleMesh::has16BitTriangleIndices (  )  const [pure virtual]

Returns whether the triangle indices are 16 or 32bits.

Returns:
true for 16bit indices, false for 32bit indices
See also:
getNbTriangles() getTriangles() getTrianglesRemap()

virtual bool PxTriangleMesh::isKindOf ( const char *  name  )  const [inline, protected, virtual]

Reimplemented from PxSerializable.

References PxSerializable::isKindOf().

virtual PX_PHYSX_COMMON_API void PxTriangleMesh::release (  )  [pure virtual]

Destroys the triangle mesh.

Note:
This will decrease the reference count by one.
Releases the application's reference to the triangle mesh. The mesh is destroyed when the application's reference is released and all shapes referencing the mesh are destroyed.

See also:
PxPhysics.createTriangleMesh()


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