All Implemented Interfaces:
ConstFace, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class Face extends JoltPhysicsObject implements ConstFace
A triangular element on the surface of a soft body. (native type: SoftBodySharedSettings::Face)
  • Constructor Details

    • Face

      public Face()
      Instantiate a default face.
  • Method Details

    • setMaterialIndex

      public void setMaterialIndex(int material)
      Assign the specified material to the face. (native attribute: mMaterialIndex)
      Parameters:
      material - the index of the desired material (≥0, default=0)
    • setVertex

      public void setVertex(int indexInFace, int indexInMesh)
      Assign the specified mesh vertex to the face. (native attribute: mVertex)
      Parameters:
      indexInFace - which corner of the triangle (0 or 1 or 2)
      indexInMesh - the index of the vertex to assign (≥0)
    • getMaterialIndex

      public int getMaterialIndex()
      Return the material index. The face is unaffected. (native attribute: mMaterialIndex)
      Specified by:
      getMaterialIndex in interface ConstFace
      Returns:
      the index of the material in the body's shared settings (≥0)
    • getVertex

      public int getVertex(int indexInFace)
      Return the mesh vertex at the specified corner. The face is unaffected. (native attribute: mVertex)
      Specified by:
      getVertex in interface ConstFace
      Parameters:
      indexInFace - which corner of the face (0 or 1 or 2)
      Returns:
      the mesh index of the vertex (≥0)
    • isDegenerate

      public boolean isDegenerate()
      Test whether the face is degenerate. The face is unaffected.
      Specified by:
      isDegenerate in interface ConstFace
      Returns:
      true if degenerate, otherwise false