java.lang.Object
physx.NativeObject
physx.common.PxBase
physx.common.PxRefCounted
physx.geometry.PxConvexMesh
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-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxConvexMesharrayGet(long baseAddress, int index) Returns the index buffer.Returns the local-space (vertex space) AABB from the convex mesh.intReturns the number of polygons.intReturns the number of vertices.booleangetPolygonData(int index, PxHullPolygon data) Returns the polygon data.Returns the vertices.booleanThis method decides whether a convex mesh is gpu compatible.static PxConvexMeshwrapPointer(long address) Methods inherited from class physx.common.PxRefCounted
acquireReference, getReferenceCountMethods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, release, setBaseFlag, setBaseFlagsMethods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
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
-
arrayGet
-
getNbVertices
public int getNbVertices()Returns the number of vertices.- Returns:
- Number of vertices.
- See Also:
-
getVertices
Returns the vertices.- Returns:
- Array of vertices.
- See Also:
-
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
Returns the polygon data.- Parameters:
index- Polygon index in [0 ; getNbPolygons()[.data- Polygon data.- Returns:
- True if success.
- See Also:
-
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
-