Class PxTetrahedronMeshDesc

java.lang.Object
physx.NativeObject
physx.geometry.PxTetrahedronMeshDesc

public class PxTetrahedronMeshDesc extends NativeObject
Descriptor class for #PxTetrahedronMesh (contains only pure geometric data).
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxTetrahedronMeshDesc

      protected PxTetrahedronMeshDesc(long address)
    • PxTetrahedronMeshDesc

      public PxTetrahedronMeshDesc()
      Constructor to build an empty tetmesh description
    • PxTetrahedronMeshDesc

      public PxTetrahedronMeshDesc(PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices)
      Constructor to build a tetmeshdescription that links to the vertices and indices provided
    • PxTetrahedronMeshDesc

      public PxTetrahedronMeshDesc(PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat)
      Constructor to build a tetmeshdescription that links to the vertices and indices provided
    • PxTetrahedronMeshDesc

      public PxTetrahedronMeshDesc(PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat, short numberOfTetsPerHexElement)
      Constructor to build a tetmeshdescription that links to the vertices and indices provided
  • Method Details

    • wrapPointer

      public static PxTetrahedronMeshDesc wrapPointer(long address)
    • arrayGet

      public static PxTetrahedronMeshDesc arrayGet(long baseAddress, int index)
    • createAt

      public static PxTetrahedronMeshDesc createAt(long address)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static <T> PxTetrahedronMeshDesc createAt(T allocator, NativeObject.Allocator<T> allocate)
      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 PxTetrahedronMeshDesc
    • createAt

      public static PxTetrahedronMeshDesc createAt(long address, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static <T> PxTetrahedronMeshDesc createAt(T allocator, NativeObject.Allocator<T> allocate, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices)
      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.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static PxTetrahedronMeshDesc createAt(long address, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      meshFormat - WebIDL type: PxTetrahedronMeshFormatEnum [enum]
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static <T> PxTetrahedronMeshDesc createAt(T allocator, NativeObject.Allocator<T> allocate, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat)
      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.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      meshFormat - WebIDL type: PxTetrahedronMeshFormatEnum [enum]
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static PxTetrahedronMeshDesc createAt(long address, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat, short numberOfTetsPerHexElement)
      Parameters:
      address - Pre-allocated memory, where the object is created.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      meshFormat - WebIDL type: PxTetrahedronMeshFormatEnum [enum]
      numberOfTetsPerHexElement - WebIDL type: unsigned short
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • createAt

      public static <T> PxTetrahedronMeshDesc createAt(T allocator, NativeObject.Allocator<T> allocate, PxArray_PxVec3 meshVertices, PxArray_PxU32 meshTetIndices, PxTetrahedronMeshFormatEnum meshFormat, short numberOfTetsPerHexElement)
      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.
      meshVertices - WebIDL type: PxArray_PxVec3 [Ref]
      meshTetIndices - WebIDL type: PxArray_PxU32 [Ref]
      meshFormat - WebIDL type: PxTetrahedronMeshFormatEnum [enum]
      numberOfTetsPerHexElement - WebIDL type: unsigned short
      Returns:
      Stack allocated object of PxTetrahedronMeshDesc
    • destroy

      public void destroy()
    • getMaterialIndices

      public PxTypedStridedData_PxU16 getMaterialIndices()
      Optional pointer to first material index, or NULL. There are PxTetrahedronMesh::numTriangles indices in total. Caller may add materialIndexStride bytes to the pointer to access the next triangle.

      When a tetrahedron 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 tetrahedron with index i, then the material index is determined as: PxFEMMaterialTableIndex index = *(PxFEMMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);

      If the contact point falls on a vertex or an edge, a tetrahedron 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

      public void setMaterialIndices(PxTypedStridedData_PxU16 value)
      Optional pointer to first material index, or NULL. There are PxTetrahedronMesh::numTriangles indices in total. Caller may add materialIndexStride bytes to the pointer to access the next triangle.

      When a tetrahedron 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 tetrahedron with index i, then the material index is determined as: PxFEMMaterialTableIndex index = *(PxFEMMaterialTableIndex *)(((PxU8*)materialIndices) + materialIndexStride * i);

      If the contact point falls on a vertex or an edge, a tetrahedron 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

    • getPoints

      public PxBoundedData getPoints()
      Pointer to first vertex point.
    • setPoints

      public void setPoints(PxBoundedData value)
      Pointer to first vertex point.
    • getTetrahedrons

      public PxBoundedData getTetrahedrons()
      Pointer to first tetrahedron.

      Caller may add tetrhedronStrideBytes bytes to the pointer to access the next tetrahedron.

      These are quadruplets of 0 based indices: vert0 vert1 vert2 vert3 vert0 vert1 vert2 vert3 vert0 vert1 vert2 vert3 ...

      where vertex is either a 32 or 16 bit unsigned integer. There are numTetrahedrons*4 indices.

      This is declared as a void pointer because it is actually either an PxU16 or a PxU32 pointer.

    • setTetrahedrons

      public void setTetrahedrons(PxBoundedData value)
      Pointer to first tetrahedron.

      Caller may add tetrhedronStrideBytes bytes to the pointer to access the next tetrahedron.

      These are quadruplets of 0 based indices: vert0 vert1 vert2 vert3 vert0 vert1 vert2 vert3 vert0 vert1 vert2 vert3 ...

      where vertex is either a 32 or 16 bit unsigned integer. There are numTetrahedrons*4 indices.

      This is declared as a void pointer because it is actually either an PxU16 or a PxU32 pointer.

    • getFlags

      public PxMeshFlags getFlags()
      Flags bits, combined from values of the enum ::PxMeshFlag
    • setFlags

      public void setFlags(PxMeshFlags value)
      Flags bits, combined from values of the enum ::PxMeshFlag
    • getTetsPerElement

      public short getTetsPerElement()
      Used for simulation meshes only. Defines if this tet mesh should be simulated as a tet mesh, or if a set of tetrahedra should be used to represent another shape, e.g. a hexahedral mesh constructed from 5 or 6 elements.
    • setTetsPerElement

      public void setTetsPerElement(short value)
      Used for simulation meshes only. Defines if this tet mesh should be simulated as a tet mesh, or if a set of tetrahedra should be used to represent another shape, e.g. a hexahedral mesh constructed from 5 or 6 elements.
    • isValid

      public boolean isValid()
      Returns:
      WebIDL type: boolean