Class RodStretchShear

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RodStretchShear
All Implemented Interfaces:
ConstJoltPhysicsObject, ConstRodStretchShear, AutoCloseable, Comparable<JoltPhysicsObject>

public class RodStretchShear extends JoltPhysicsObject implements ConstRodStretchShear
Join 2 soft-body vertices with a discrete Cosserat rod. (native type: SoftBodySharedSettings::RodStretchShear)
  • Constructor Details

    • RodStretchShear

      public RodStretchShear()
      Instantiate a default rod.
    • RodStretchShear

      public RodStretchShear(int vertex0, int vertex1)
      Instantiate a rod joining the specified vertices with infinite stiffness.
      Parameters:
      vertex0 - the mesh index of the first vertex (≥0)
      vertex1 - the mesh index of the 2nd vertex (≥0)
    • RodStretchShear

      public RodStretchShear(int vertex0, int vertex1, float compliance)
      Instantiate a rod joining the specified vertices with the specified stiffness.
      Parameters:
      vertex0 - the mesh index of the first vertex (≥0)
      vertex1 - the mesh index of the 2nd vertex (≥0)
      compliance - the inverse of the desired stiffness (default=0)
  • Method Details

    • setBishop

      public RodStretchShear setBishop(QuatArg bishop)
      Alter the Bishop frame of the rod. (native attribute: mBishop)
      Parameters:
      bishop - the desired orientation (not null, unaffected)
      Returns:
      the modified settings, for chaining
    • setCompliance

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

      public RodStretchShear setInvMass(float invMass)
      Alter the inverse mass of the rod. (native attribute: mInvMass)
      Parameters:
      invMass - the desired inverse mass (in 1/kilograms, default=1, 0 for a static rod)
      Returns:
      the modified settings, for chaining
    • setLength

      public RodStretchShear setLength(float length)
      Alter the length of the rod. (native attribute: mLength)
      Parameters:
      length - the desired length (in meters, default=1)
      Returns:
      the modified settings, for chaining
    • setVertex

      public RodStretchShear setVertex(int indexInRod, int indexInMesh)
      Assign the specified mesh vertex to the rod. (native attribute: mVertex)
      Parameters:
      indexInRod - which end of the rod (0 or 1)
      indexInMesh - the index of the vertex to assign (≥0)
      Returns:
      the modified settings, for chaining
    • getBishop

      public Quat getBishop()
      Return the Bishop frame of the rod. The rod is unaffected. (native attribute: mBishop)
      Specified by:
      getBishop in interface ConstRodStretchShear
      Returns:
      orientation of the rod
    • getCompliance

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

      public float getInvMass()
      Return the inverse mass of the rod. The rod is unaffected. (native attribute: mInvMass)
      Specified by:
      getInvMass in interface ConstRodStretchShear
      Returns:
      the inverse of the mass (in 1/kilograms)
    • getLength

      public float getLength()
      Return the length of the rod. The rod is unaffected. (native attribute: mLength)
      Specified by:
      getLength in interface ConstRodStretchShear
      Returns:
      the length (in meters)
    • getVertex

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