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

public class Volume extends JoltPhysicsObject
Join 4 soft-body vertices into a tetrahedron with a preferred volume. (native type: SoftBodySharedSettings::Volume)
  • Constructor Details

    • Volume

      public Volume()
      Instantiate a default volume constraint.
  • Method Details

    • getCompliance

      public float getCompliance()
      Return the inverse of the volume's stiffness. The volume is unaffected. (native attribute: mCompliance)
      Returns:
      the compliance value
    • getSixRestVolume

      public float getSixRestVolume()
      Return the rest size of the volume. The volume is unaffected. (native attribute: mSixRestVolume)
      Returns:
      6 times the rest volume of the tetrahedron (in cubic meters)
    • getVertex

      public int getVertex(int indexInVolume)
      Return the mesh vertex at the specified corner. The volume is unaffected. (native attribute: mVertex)
      Parameters:
      indexInVolume - which corner of the volume (0 or 1 or 2 or 3)
      Returns:
      the mesh index of the vertex (≥0)
    • setCompliance

      public void setCompliance(float compliance)
      Alter the stiffness of the volume. (native attribute: mCompliance)
      Parameters:
      compliance - the inverse of the desired stiffness (default=0)
    • setSixRestVolume

      public void setSixRestVolume(float sixVolume)
      Alter the rest size of the volume. (native attribute: mSixRestVolume)
      Parameters:
      sixVolume - 6 times the desired rest volume (in cubic meters)
    • setVertex

      public void setVertex(int indexInVolume, int indexInMesh)
      Assign the specified mesh vertex to the volume. (native attribute: mVertex)
      Parameters:
      indexInVolume - which corner of the tetrahedron (0 or 1 or 2 or 3)
      indexInMesh - the index of the vertex to assign (≥0)