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

public class Edge extends JoltPhysicsObject
Join 2 soft-body vertices with a spring. (native type: SoftBodySharedSettings::Edge)
  • Constructor Details

    • Edge

      public Edge()
      Instantiate a default edge constraint.
  • Method Details

    • getCompliance

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

      public float getRestLength()
      Return the rest length of the spring. The edge is unaffected. (native attribute: mRestLength)
      Returns:
      the length (in meters)
    • getVertex

      public int getVertex(int indexInEdge)
      Return the mesh vertex at the specified end. (native attribute: mVertex)
      Parameters:
      indexInEdge - which end of the edge (0 or 1)
      Returns:
      the mesh index of the vertex (≥0)
    • setCompliance

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

      public void setRestLength(float length)
      Alter the rest length of the spring. (native attribute: mRestLength)
      Parameters:
      length - the desired length (in meters, default=1)
    • setVertex

      public void setVertex(int indexInEdge, int indexInMesh)
      Assign the specified mesh vertex to the edge. (native attribute: mVertex)
      Parameters:
      indexInEdge - which end of the edge (0 or 1)
      indexInMesh - the index of the vertex to assign (≥0)