java.lang.Object
physx.NativeObject
physx.geometry.PxGeometry
physx.geometry.PxTriangleMeshGeometry
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.
-
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
ConstructorsModifierConstructorDescriptionprotectedprotectedPxTriangleMeshGeometry(long address) Constructor.PxTriangleMeshGeometry(PxTriangleMesh mesh, PxMeshScale scaling) Constructor.PxTriangleMeshGeometry(PxTriangleMesh mesh, PxMeshScale scaling, PxMeshGeometryFlags flags) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic PxTriangleMeshGeometryarrayGet(long baseAddress, int index) static PxTriangleMeshGeometrycreateAt(long address, PxTriangleMesh mesh) static PxTriangleMeshGeometrycreateAt(long address, PxTriangleMesh mesh, PxMeshScale scaling) static PxTriangleMeshGeometrycreateAt(long address, PxTriangleMesh mesh, PxMeshScale scaling, PxMeshGeometryFlags flags) static <T> PxTriangleMeshGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh) static <T> PxTriangleMeshGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh, PxMeshScale scaling) static <T> PxTriangleMeshGeometrycreateAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh, PxMeshScale scaling, PxMeshGeometryFlags flags) voiddestroy()Mesh flags.getScale()The scaling transformation.A reference to the mesh object.booleanisValid()Returns true if the geometry is valid.voidsetMeshFlags(PxMeshGeometryFlags value) Mesh flags.voidsetScale(PxMeshScale value) The scaling transformation.voidsetTriangleMesh(PxTriangleMesh value) A reference to the mesh object.static PxTriangleMeshGeometrywrapPointer(long address) Methods inherited from class physx.geometry.PxGeometry
getTypeMethods 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
-
PxTriangleMeshGeometry
protected PxTriangleMeshGeometry() -
PxTriangleMeshGeometry
protected PxTriangleMeshGeometry(long address) -
PxTriangleMeshGeometry
Constructor. By default creates an empty object with a NULL mesh and identity scale.- Parameters:
mesh- Mesh pointer. May be NULL, though this will not make the object valid for shape construction.
-
PxTriangleMeshGeometry
Constructor. By default creates an empty object with a NULL mesh and identity scale.- Parameters:
mesh- Mesh pointer. May be NULL, though this will not make the object valid for shape construction.scaling- Scale factor.
-
PxTriangleMeshGeometry
Constructor. By default creates an empty object with a NULL mesh and identity scale.- Parameters:
mesh- Mesh pointer. May be NULL, though this will not make the object valid for shape construction.scaling- Scale factor.flags- Mesh flags.
-
-
Method Details
-
wrapPointer
-
arrayGet
-
createAt
- Parameters:
address- Pre-allocated memory, where the object is created.mesh- WebIDL type:PxTriangleMesh- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
createAt
public static <T> PxTriangleMeshGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh) - 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.mesh- WebIDL type:PxTriangleMesh- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
createAt
public static PxTriangleMeshGeometry createAt(long address, PxTriangleMesh mesh, PxMeshScale scaling) - Parameters:
address- Pre-allocated memory, where the object is created.mesh- WebIDL type:PxTriangleMeshscaling- WebIDL type:PxMeshScale[Const, Ref]- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
createAt
public static <T> PxTriangleMeshGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh, PxMeshScale scaling) - 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.mesh- WebIDL type:PxTriangleMeshscaling- WebIDL type:PxMeshScale[Const, Ref]- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
createAt
public static PxTriangleMeshGeometry createAt(long address, PxTriangleMesh mesh, PxMeshScale scaling, PxMeshGeometryFlags flags) - Parameters:
address- Pre-allocated memory, where the object is created.mesh- WebIDL type:PxTriangleMeshscaling- WebIDL type:PxMeshScale[Const, Ref]flags- WebIDL type:PxMeshGeometryFlags[Ref]- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
createAt
public static <T> PxTriangleMeshGeometry createAt(T allocator, NativeObject.Allocator<T> allocate, PxTriangleMesh mesh, PxMeshScale scaling, PxMeshGeometryFlags flags) - 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.mesh- WebIDL type:PxTriangleMeshscaling- WebIDL type:PxMeshScale[Const, Ref]flags- WebIDL type:PxMeshGeometryFlags[Ref]- Returns:
- Stack allocated object of PxTriangleMeshGeometry
-
destroy
public void destroy()- Overrides:
destroyin classPxGeometry
-
getScale
The scaling transformation. -
setScale
The scaling transformation. -
getMeshFlags
Mesh flags. -
setMeshFlags
Mesh flags. -
getTriangleMesh
A reference to the mesh object. -
setTriangleMesh
A reference to the mesh object. -
isValid
public boolean isValid()Returns true if the geometry is valid.- Returns:
- True if the current settings are valid for shape creation.
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 PxPhysics::createShape with a triangle mesh that has zero extents in any direction.
-