Class SoftBodyMotionProperties

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

public class SoftBodyMotionProperties extends MotionProperties implements ConstSoftBodyMotionProperties
The motion properties of a soft body.
  • Constructor Details

    • SoftBodyMotionProperties

      public SoftBodyMotionProperties()
      Instantiate with the default properties.
  • Method Details

    • customUpdate

      public void customUpdate(float deltaTime, Body softBody, PhysicsSystem system)
      Update the specified soft body without updating the rest of the physics system.
      Parameters:
      deltaTime - the total time to advance (in seconds)
      softBody - the body to update (not null)
      system - the system that contains the body (not null)
    • setEnableSkinConstraints

      public void setEnableSkinConstraints(boolean enable)
      Enable or disable any skinning constraints.
      Parameters:
      enable - true to enable any skinning constraints, false to disable them (default=true)
    • setNumIterations

      public void setNumIterations(int numIterations)
      Alter the number of solver iterations.
      Parameters:
      numIterations - the desired number of iterations (default=0)
    • setSkinnedMaxDistanceMultiplier

      public void setSkinnedMaxDistanceMultiplier(float multiplier)
      Alter the maximum distance multiplier for skinned vertices.
      Parameters:
      multiplier - the desired multiplier (default=1)
    • skinVertices

      public void skinVertices(RMat44Arg comTransform, Mat44Arg[] jointMatrices, int numJoints, boolean hardSkinAll, TempAllocator allocator)
      Skin vertices to the specified joints.
      Parameters:
      comTransform - the body's center-of-mass transform (not null, unaffected)
      jointMatrices - the joint matrices (relative to the center-of-mass transform, not null, length≥numJoints, unaffected)
      numJoints - the number of joints (≥0)
      hardSkinAll - true to reposition all vertices to their skinned locations
      allocator - for temporary allocations (not null)
    • getEnableSkinConstraints

      public boolean getEnableSkinConstraints()
      Test whether skinning constraints are enabled. The properties are unaffected.
      Specified by:
      getEnableSkinConstraints in interface ConstSoftBodyMotionProperties
      Returns:
      true if enabled, false if disabled
    • getFace

      public Face getFace(int index)
      Access the specified face.
      Specified by:
      getFace in interface ConstSoftBodyMotionProperties
      Parameters:
      index - the index of the face (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getFaces

      public Face[] getFaces()
      Enumerate all faces in the soft body.
      Specified by:
      getFaces in interface ConstSoftBodyMotionProperties
      Returns:
      a new array of new JVM objects with pre-existing native objects assigned
    • getNumIterations

      public int getNumIterations()
      Return the number of solver iterations. The properties are unaffected.
      Specified by:
      getNumIterations in interface ConstSoftBodyMotionProperties
      Returns:
      the number of iterations (≥0)
    • getSettings

      public ConstSoftBodySharedSettings getSettings()
      Access the shared settings.
      Specified by:
      getSettings in interface ConstSoftBodyMotionProperties
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getSkinnedMaxDistanceMultiplier

      public float getSkinnedMaxDistanceMultiplier()
      Return the maximum distance multiplier for skinned vertices. The properties are unaffected.
      Specified by:
      getSkinnedMaxDistanceMultiplier in interface ConstSoftBodyMotionProperties
      Returns:
      the multiplier
    • getVertex

      public SoftBodyVertex getVertex(int index)
      Access the specified vertex.
      Specified by:
      getVertex in interface ConstSoftBodyMotionProperties
      Parameters:
      index - the index of the vertex (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getVertices

      public SoftBodyVertex[] getVertices()
      Enumerate all vertices in the soft body.
      Specified by:
      getVertices in interface ConstSoftBodyMotionProperties
      Returns:
      a new array of new JVM objects with pre-existing native objects assigned
    • putPinLocations

      public void putPinLocations(RVec3Arg comLocation, FloatBuffer storeFloats)
      Write the locations of all pinned vertices to the specified buffer and advance the buffer's position. The properties are unaffected.
      Specified by:
      putPinLocations in interface ConstSoftBodyMotionProperties
      Parameters:
      comLocation - the location of the body's center of mass (not null)
      storeFloats - the destination buffer (not null, modified)
    • putVertexLocations

      public void putVertexLocations(RVec3Arg comLocation, FloatBuffer storeFloats)
      Write the locations of all vertices to the specified buffer and advance the buffer's position. The properties are unaffected.
      Specified by:
      putVertexLocations in interface ConstSoftBodyMotionProperties
      Parameters:
      comLocation - the location of the body's center of mass (not null)
      storeFloats - the destination buffer (not null, modified)