PxTriangleMeshGeometry

Defined in include/geometry/PxTriangleMeshGeometry.h

class PxTriangleMeshGeometry : public PxGeometry

Triangle mesh geometry class.

This class unifies a mesh object with a scaling transform, and lets the combined object be used anywhere a PxGeometry is needed.

The scaling is a transform along arbitrary axes contained in the scale object. The vertices of the mesh in geometry (or shape) space is the PxMeshScale::toMat33() transform, multiplied by the vertex space vertices in the PxTriangleMeshGeometry object.

Public Functions

inline PxTriangleMeshGeometry(PxTriangleMesh *mesh = NULL, const PxMeshScale &scaling = PxMeshScale(), PxMeshGeometryFlags flags = PxMeshGeometryFlags())

Constructor.

By default creates an empty object with a NULL mesh and identity scale.

Parameters
  • mesh[in] Mesh pointer. May be NULL, though this will not make the object valid for shape construction.

  • scaling[in] Scale factor.

  • flags[in] Mesh flags.

inline PxTriangleMeshGeometry(const PxTriangleMeshGeometry &that)

Copy constructor.

Parameters

that[in] Other object

inline void operator=(const PxTriangleMeshGeometry &that)

Assignment operator.

inline bool isValid() const

Returns true if the geometry is valid.

See also

PxRigidActor::createShape, PxPhysics::createShape

Note

A valid triangle mesh has a positive scale value in each direction (scale.scale.x > 0, scale.scale.y > 0, scale.scale.z > 0). It is illegal to call PxRigidActor::createShape and PxPhysics::createShape with a triangle mesh that has zero extents in any direction.

Returns

True if the current settings are valid for shape creation.

inline PxGeometryType::Enum getType() const

Returns the type of the geometry.

Returns

The type of the object.

Public Members

PxMeshScale scale

The scaling transformation.

PxMeshGeometryFlags meshFlags

Mesh flags.

PxPadding<3> paddingFromFlags

padding for mesh flags

PxTriangleMesh *triangleMesh

A reference to the mesh object.

float mTypePadding

Protected Attributes

PxGeometryType::Enum mType