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.
    • Face

      public Face(ConstFace original)
      Instantiate a copy of the specified face.
      Parameters:
      original - the face to copy (not null, unaffected)
  • 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, default=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
    • toString

      public String toString()
      Return a string representation of the face, which is unaffected. For example:
       Face{(4 1 3) 0}
       
      Overrides:
      toString in class JoltPhysicsObject
      Returns:
      the string representation (not null, not empty)