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

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

    • Edge

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

    • setCompliance

      public Edge setCompliance(float compliance)
      Alter the stiffness of the spring. (native attribute: mCompliance)
      Parameters:
      compliance - the inverse of the desired stiffness (default=0)
      Returns:
      the modified settings, for chaining
    • setRestLength

      public Edge setRestLength(float length)
      Alter the rest length of the spring. (native attribute: mRestLength)
      Parameters:
      length - the desired length (in meters, default=1)
      Returns:
      the modified settings, for chaining
    • setVertex

      public Edge 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)
      Returns:
      the modified settings, for chaining
    • getCompliance

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

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

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