Class PxConvexMesh


public class PxConvexMesh extends PxRefCounted
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:

\li #PxVisualizationParameter::eCOLLISION_AABBS \li #PxVisualizationParameter::eCOLLISION_SHAPES \li #PxVisualizationParameter::eCOLLISION_AXES \li #PxVisualizationParameter::eCOLLISION_FNORMALS \li #PxVisualizationParameter::eCOLLISION_EDGES
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxConvexMesh

      protected PxConvexMesh()
    • PxConvexMesh

      protected PxConvexMesh(long address)
  • Method Details

    • wrapPointer

      public static PxConvexMesh wrapPointer(long address)
    • arrayGet

      public static PxConvexMesh arrayGet(long baseAddress, int index)
    • getNbVertices

      public int getNbVertices()
      Returns the number of vertices.
      Returns:
      Number of vertices.
      See Also:
    • getVertices

      public PxVec3 getVertices()
      Returns the vertices.
      Returns:
      Array of vertices.
      See Also:
    • getIndexBuffer

      public PxU8ConstPtr getIndexBuffer()
      Returns the index buffer.
      Returns:
      Index buffer.
      See Also:
    • getNbPolygons

      public int getNbPolygons()
      Returns the number of polygons.
      Returns:
      Number of polygons.
      See Also:
    • getPolygonData

      public boolean getPolygonData(int index, PxHullPolygon data)
      Returns the polygon data.
      Parameters:
      index - Polygon index in [0 ; getNbPolygons()[.
      data - Polygon data.
      Returns:
      True if success.
      See Also:
    • getLocalBounds

      public PxBounds3 getLocalBounds()
      Returns the local-space (vertex space) AABB from the convex mesh.
      Returns:
      local-space bounds
    • isGpuCompatible

      public boolean isGpuCompatible()
      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