Class VertexAttributes

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

public class VertexAttributes extends JoltPhysicsObject implements ConstVertexAttributes
Per-vertex attributes used to configure the constraints in a soft body. The compliance of each constraint is determined by averaging attached vertices. (native type: SoftBodySharedSettings::VertexAttributes)
  • Constructor Details

    • VertexAttributes

      public VertexAttributes()
      Instantiate default attributes.
    • VertexAttributes

      public VertexAttributes(float compliance, float shearCompliance, float bendCompliance)
      Instantiate attributes as specified.
      Parameters:
      compliance - the desired compliance for regular edges (default=0)
      shearCompliance - the desired compliance for shear edges (default=0)
      bendCompliance - the desired compliance for bend edges (default=MAX_VALUE)
    • VertexAttributes

      public VertexAttributes(float compliance, float shearCompliance, float bendCompliance, ELraType lraType)
      Instantiate attributes as specified.
      Parameters:
      compliance - the desired compliance for regular edges (default=0)
      shearCompliance - the desired compliance for shear edges (default=0)
      bendCompliance - the desired compliance for bend edges (default=MAX_VALUE)
      lraType - the desired long-range attachment (LRA) constraint (not null, default=None)
    • VertexAttributes

      public VertexAttributes(float compliance, float shearCompliance, float bendCompliance, ELraType lraType, float lraMultiplier)
      Instantiate attributes as specified.
      Parameters:
      compliance - the desired compliance for regular edges (default=0)
      shearCompliance - the desired compliance for shear edges (default=0)
      bendCompliance - the desired compliance for bend edges (default=MAX_VALUE)
      lraType - the desired long-range attachment (LRA) constraint (not null, default=None)
      lraMultiplier - the desired multiplier for the maximum distance of the LRA constraint (relative to the rest-pose distance, default=1)
  • Method Details

    • setBendCompliance

      public float setBendCompliance(float compliance)
      Alter the compliance for bend edges. (native attribute: mBendCompliance)
      Parameters:
      compliance - the desired compliance value (MAX_VALUE to disable any bend edges attached to the vertex, default=MAX_VALUE)
      Returns:
      the argument, for chaining
    • setCompliance

      public float setCompliance(float compliance)
      Alter the compliance for regular edges. (native attribute: mCompliance)
      Parameters:
      compliance - the desired compliance value (MAX_VALUE to disable any regular edges attached to the vertex, default=0)
      Returns:
      the argument, for chaining
    • setLraMaxDistanceMultiplier

      public float setLraMaxDistanceMultiplier(float multiplier)
      Alter the multiplier for the maximum distance of the long-range attachment (LRA) constraint. (native attribute: mLRAMaxDistanceMultiplier)
      Parameters:
      multiplier - the desired multiplier for the maximum distance of the LRA constraint (relative to the rest-pose distance, default=1)
      Returns:
      the argument, for chaining
    • setLraType

      public void setLraType(ELraType type)
      Alter the type of the long-range attachment (LRA) constraint. (native attribute: mLRAType)
      Parameters:
      type - the desired type (not null, default=None)
    • setShearCompliance

      public float setShearCompliance(float compliance)
      Alter the compliance for shear edges. (native attribute: mShearCompliance)
      Parameters:
      compliance - the desired compliance value (MAX_VALUE to disable any shear edges attached to the vertex, default=0)
      Returns:
      the argument, for chaining
    • getBendCompliance

      public float getBendCompliance()
      Return the compliance of bend edges. The attributes are unaffected. (native attribute: mBendCompliance)
      Specified by:
      getBendCompliance in interface ConstVertexAttributes
      Returns:
      the compliance value
    • getCompliance

      public float getCompliance()
      Return the compliance of the regular edges. The attributes are unaffected. (native attribute: mCompliance)
      Specified by:
      getCompliance in interface ConstVertexAttributes
      Returns:
      the compliance value
    • getLraMaxDistanceMultiplier

      public float getLraMaxDistanceMultiplier()
      Return the multiplier for the maximum distance of the long-range attachment (LRA) constraint. The attributes are unaffected. (native attribute: mLRAMaxDistanceMultiplier)
      Specified by:
      getLraMaxDistanceMultiplier in interface ConstVertexAttributes
      Returns:
      the multiplier (relative to the rest-pose distance)
    • getLraType

      public ELraType getLraType()
      Return the type of the long-range attachment (LRA) constraint. The attributes are unaffected. (native attribute: mLRAType)
      Specified by:
      getLraType in interface ConstVertexAttributes
      Returns:
      the enum value (not null)
    • getShearCompliance

      public float getShearCompliance()
      Return the compliance of the shear edges. The attributes are unaffected. (native attribute: mShearCompliance)
      Specified by:
      getShearCompliance in interface ConstVertexAttributes
      Returns:
      the compliance value