Note that this class is derived from PxSimpleTriangleMesh which contains the members that describe the basic mesh. The mesh data is *copied* when an PxTriangleMesh object is created from this descriptor. After the call the user may discard the triangle data.
- See Also:
-
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
ConstructorsModifierConstructorDescriptionConstructor sets to default.protectedPxTriangleMeshDesc(long address) -
Method Summary
Modifier and TypeMethodDescriptionstatic PxTriangleMeshDescarrayGet(long baseAddress, int index) static PxTriangleMeshDesccreateAt(long address) static <T> PxTriangleMeshDesccreateAt(T allocator, NativeObject.Allocator<T> allocate) voiddestroy()Optional pointer to first material index, or NULL.voidOptional pointer to first material index, or NULL.static PxTriangleMeshDescwrapPointer(long address) Methods inherited from class physx.geometry.PxSimpleTriangleMesh
getFlags, getPoints, getTriangles, isValid, setFlags, setPoints, setToDefault, setTrianglesMethods 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
-
PxTriangleMeshDesc
protected PxTriangleMeshDesc(long address) -
PxTriangleMeshDesc
public PxTriangleMeshDesc()Constructor sets to default.
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.- Returns:
- Stack allocated object of PxTriangleMeshDesc
-
createAt
- Type Parameters:
T- Allocator class, e.g. LWJGL's MemoryStack.- Parameters:
allocator- Object to use for allocation, e.g. an instance of LWJGL's MemoryStack.allocate- Method to call on allocator to obtain the target address, e.g. MemoryStack::nmalloc.- Returns:
- Stack allocated object of PxTriangleMeshDesc
-
destroy
public void destroy()- Overrides:
destroyin classPxSimpleTriangleMesh
-
getMaterialIndices
Optional pointer to first material index, or NULL. There are PxSimpleTriangleMesh::numTriangles indices in total. Caller may add materialIndexStride bytes to the pointer to access the next triangle.When a triangle mesh collides with another object, a material is required at the collision point. If materialIndices is NULL, then the material of the PxShape instance is used. Otherwise, if the point of contact is on a triangle with index i, then the material index is determined as: PxMaterialTableIndex index = *(PxMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);
If the contact point falls on a vertex or an edge, a triangle adjacent to the vertex or edge is selected, and its index used to look up a material. The selection is arbitrary but consistent over time.
Default: NULL
-
setMaterialIndices
Optional pointer to first material index, or NULL. There are PxSimpleTriangleMesh::numTriangles indices in total. Caller may add materialIndexStride bytes to the pointer to access the next triangle.When a triangle mesh collides with another object, a material is required at the collision point. If materialIndices is NULL, then the material of the PxShape instance is used. Otherwise, if the point of contact is on a triangle with index i, then the material index is determined as: PxMaterialTableIndex index = *(PxMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);
If the contact point falls on a vertex or an edge, a triangle adjacent to the vertex or edge is selected, and its index used to look up a material. The selection is arbitrary but consistent over time.
Default: NULL
-