Class SoftBodySharedSettingsRef

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

public final class SoftBodySharedSettingsRef extends Ref implements ConstSoftBodySharedSettings
A counted reference to SoftBodySharedSettings. (native type: Ref<SoftBodySharedSettings>)
  • Constructor Details

    • SoftBodySharedSettingsRef

      public SoftBodySharedSettingsRef()
      Instantiate an empty reference.
  • Method Details

    • addEdgeConstraint

      public void addEdgeConstraint(Edge edge)
      Add the specified edge constraint.
      Parameters:
      edge - the edge to add (not null, unaffected)
    • addFace

      public void addFace(ConstFace face)
      Add the specified face.
      Parameters:
      face - the face to add (not null, unaffected)
    • addInvBindMatrix

      public void addInvBindMatrix(InvBind invBind)
      Append the specified inverse-bind matrix.
      Parameters:
      invBind - the matrix to add (not null)
    • addSkinnedConstraint

      public void addSkinnedConstraint(Skinned skinned)
      Add the specified skinning constraint.
      Parameters:
      skinned - the constraint to add (not null)
    • addVertex

      public void addVertex(Vertex vertex)
      Add the specified vertex.
      Parameters:
      vertex - the vertex to add (not null, unaffected)
    • addVolumeConstraint

      public void addVolumeConstraint(Volume volume)
      Add the specified volume constraint.
      Parameters:
      volume - the constraint to add (not null, unaffected)
    • calculateEdgeLengths

      public void calculateEdgeLengths()
      Calculate the initial lengths of all edges in the body.
    • calculateSkinnedConstraintNormals

      public void calculateSkinnedConstraintNormals()
      Calculate the information needed for skinned constraint normals.
    • calculateVolumeConstraintVolumes

      public void calculateVolumeConstraintVolumes()
      Calculate the initial volumes of all tetrahedra in the body.
    • createConstraints

      public void createConstraints(ConstVertexAttributes vertexAttributes, int numAttributes, EBendType bendType)
      Automatically generate constraints based on the faces.
      Parameters:
      vertexAttributes - the desired attributes (one for each vertex)
      numAttributes - the number of attributes provided (≥0)
      bendType - the desired type of bend constraint (not null, default=Distance)
    • createConstraints

      public void createConstraints(ConstVertexAttributes[] vertexAttributes, EBendType bendType)
      Automatically generate constraints based on the faces.
      Parameters:
      vertexAttributes - the desired attributes (one for each vertex)
      bendType - the desired type of bend constraint (not null, default=Distance)
    • createConstraints

      public void createConstraints(ConstVertexAttributes[] vertexAttributes, EBendType bendType, float angleTolerance)
      Automatically generate constraints based on the faces.
      Parameters:
      vertexAttributes - the desired attributes (one for each vertex)
      bendType - the desired type of bend constraint (not null, default=Distance)
      angleTolerance - the desired tolerance for creating shear edges (in radians, default=2*Pi/45)
    • optimize

      public void optimize()
      Optimize the settings without writing any results.
    • setMaterials

      public void setMaterials(PhysicsMaterial material)
      Replace the materials. (native attribute: mMaterials)
      Parameters:
      material - the desired material, or null
    • setVertexRadius

      public void setVertexRadius(float radius)
      Alter the size of every particle.
      Parameters:
      radius - the desired radius (≥0, default=0)
    • countEdgeConstraints

      public int countEdgeConstraints()
      Count the edge constraints. The settings are unaffected.
      Specified by:
      countEdgeConstraints in interface ConstSoftBodySharedSettings
      Returns:
      the count (≥0)
    • countFaces

      public int countFaces()
      Count the faces. The settings are unaffected.
      Specified by:
      countFaces in interface ConstSoftBodySharedSettings
      Returns:
      the count (≥0)
    • countPinnedVertices

      public int countPinnedVertices()
      Count the pinned vertices. The settings are unaffected.
      Specified by:
      countPinnedVertices in interface ConstSoftBodySharedSettings
      Returns:
      the count (≥0)
    • countVertices

      public int countVertices()
      Count the vertices. The settings are unaffected.
      Specified by:
      countVertices in interface ConstSoftBodySharedSettings
      Returns:
      the count (≥0)
    • countVolumeConstraints

      public int countVolumeConstraints()
      Count the volume constraints. The settings are unaffected.
      Specified by:
      countVolumeConstraints in interface ConstSoftBodySharedSettings
      Returns:
      the count (≥0)
    • getVertexRadius

      public float getVertexRadius()
      Return the radius of each particle. The settings are unaffected. (native attribute: mVertexRadius)
      Specified by:
      getVertexRadius in interface ConstSoftBodySharedSettings
      Returns:
      the radius (in meters)
    • putEdgeIndices

      public void putEdgeIndices(IntBuffer storeIndices)
      Write the vertex indices of all edges to the specified buffer and advance the buffer's position. The settings are unaffected.
      Specified by:
      putEdgeIndices in interface ConstSoftBodySharedSettings
      Parameters:
      storeIndices - the destination buffer (not null, modified)
    • putFaceIndices

      public void putFaceIndices(IntBuffer storeIndices)
      Write the vertex indices of all faces to the specified buffer and advance the buffer's position. The settings are unaffected.
      Specified by:
      putFaceIndices in interface ConstSoftBodySharedSettings
      Parameters:
      storeIndices - the destination buffer (not null, modified)
    • getPtr

      public SoftBodySharedSettings getPtr()
      Temporarily access the referenced SoftBodySharedSettings.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native SoftBodySharedSettings. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      public SoftBodySharedSettingsRef toRef()
      Create another counted reference to the native SoftBodySharedSettings.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned