Class MeshShapeSettings

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstShapeSettings, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class MeshShapeSettings extends ShapeSettings
Settings used to construct a MeshShape.
  • Constructor Details

    • MeshShapeSettings

      public MeshShapeSettings(Float3[] vertices, IndexedTriangleList indices)
      Instantiate settings for the specified vertices and triangles.
      Parameters:
      vertices - the array of vertices (not null, unaffected)
      indices - the list of triangles (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(Float3[] vertexArray, IndexedTriangle... itArray)
      Instantiate settings for the specified vertices and triangles.
      Parameters:
      vertexArray - the array of vertices (not null, unaffected)
      itArray - the array of triangles (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(FloatBuffer positionBuffer)
      Instantiate settings for the specified vertices without indices.
      Parameters:
      positionBuffer - the vertex positions (not null, capacity a multiple of 9, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(List<Float3> vertices, IndexedTriangleList indices)
      Instantiate settings for the specified lists of vertices and triangles.
      Parameters:
      vertices - the list of vertices (not null, unaffected)
      indices - the list of triangles (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(List<Triangle> triangleList)
      Instantiate settings for the specified list of triangles.
      Parameters:
      triangleList - the list of triangles (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(List<Triangle> triangleList, PhysicsMaterialList materials)
      Instantiate settings for the specified parameters.
      Parameters:
      triangleList - the list of triangles (not null, unaffected)
      materials - the desired surface properties (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(VertexList vertices, IndexedTriangleList indices)
      Instantiate settings for the specified vertices and indices.
      Parameters:
      vertices - list of vertex locations (not null, unaffected)
      indices - list of triangles that use those vertices (not null)
    • MeshShapeSettings

      public MeshShapeSettings(Triangle... triangleArray)
      Instantiate settings for the specified array of triangles.
      Parameters:
      triangleArray - the array of triangles (not null, unaffected)
    • MeshShapeSettings

      public MeshShapeSettings(Triangle[] triangleArray, PhysicsMaterialList materials)
      Instantiate settings for the specified parameters.
      Parameters:
      triangleArray - the array of triangles (not null, unaffected)
      materials - the desired surface properties (not null, unaffected)
  • Method Details

    • addIndexedTriangle

      public void addIndexedTriangle(int vi0, int vi1, int vi2)
      Append the specified triangle to the internal array.
      Parameters:
      vi0 - the desired first mesh-vertex index
      vi1 - the desired 2nd mesh-vertex index
      vi2 - the desired 3rd mesh-vertex index
    • addTriangleVertex

      public void addTriangleVertex(Float3 vertex)
      Append the specified vertex to the internal array.
      Parameters:
      vertex - the location of the vertex to add (not null, unaffected)
    • countTriangles

      public int countTriangles()
      Count the triangles in the mesh. The settings are unaffected.
      Returns:
      the count (≥0)
    • countTriangleVertices

      public int countTriangleVertices()
      Count the vertices in the mesh. The settings are unaffected.
      Returns:
      the count (≥0)
    • getActiveEdgeCosThresholdAngle

      public float getActiveEdgeCosThresholdAngle()
      Return the cosine of the active-edge threshold angle. The settings are unaffected. (native attribute: mActiveEdgeCosThresholdAngle)
      Returns:
      the cosine
    • getMaxTrianglesPerLeaf

      public int getMaxTrianglesPerLeaf()
      Return the maximum number of triangles per leaf. The settings are unaffected. (native attribute: mMaxTrianglesPerLeaf)
      Returns:
      the maximum number
    • getPerTriangleUserData

      public boolean getPerTriangleUserData()
      Test whether each triangle will include user data. The settings are unaffected. (native attribute: mPerTriangleUserData)
      Returns:
      true if per-triangle data is included, otherwise false
    • reserveIndexedTriangles

      public void reserveIndexedTriangles(int numTriangles)
      Reserve storage for the specified number of triangles.
      Parameters:
      numTriangles - the desired capacity
    • reserveTriangleVertices

      public void reserveTriangleVertices(int numVertices)
      Reserve storage for the specified number of vertices.
      Parameters:
      numVertices - the desired capacity
    • setActiveEdgeCosThresholdAngle

      public void setActiveEdgeCosThresholdAngle(float cosine)
      Alter the active-edge threshold angle. (native attribute: mActiveEdgeCosThresholdAngle)
      Parameters:
      cosine - the cosine of the desired angle (default=0.996195)
    • setMaxTrianglesPerLeaf

      public void setMaxTrianglesPerLeaf(int numTriangles)
      Alter the maximum number of triangles per leaf. (native attribute: mMaxTrianglesPerLeaf)
      Parameters:
      numTriangles - the desired number (default=8)
    • setPerTriangleUserData

      public void setPerTriangleUserData(boolean include)
      Alter whether each triangle will include user data. (native attribute: mPerTriangleUserData)
      Parameters:
      include - true to include per-triangle data, false to omit it (default=false)