Package com.github.stephengold.joltjni
Class SoftBodyMotionProperties
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.MotionProperties
com.github.stephengold.joltjni.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomUpdate(float deltaTime, Body softBody, PhysicsSystem system) Update the specified soft body without updating the rest of the physics system.booleanTest whether skinning constraints are enabled.getFace(int index) Access the specified face.getFaces()Enumerate all faces in the soft body.intReturn the number of solver iterations.Access the shared settings.floatReturn the maximum distance multiplier for skinned vertices.getVertex(int index) Access the specified vertex.Enumerate all vertices in the soft body.voidputPinLocations(RVec3Arg comLocation, FloatBuffer storeFloats) Write the locations of all pinned vertices to the specified buffer and advance the buffer's position.voidputVertexLocations(RVec3Arg comLocation, FloatBuffer storeFloats) Write the locations of all vertices to the specified buffer and advance the buffer's position.voidsetEnableSkinConstraints(boolean enable) Enable or disable any skinning constraints.voidsetNumIterations(int numIterations) Alter the number of solver iterations.voidsetSkinnedMaxDistanceMultiplier(float multiplier) Alter the maximum distance multiplier for skinned vertices.voidskinVertices(RMat44Arg comTransform, Mat44Arg[] jointMatrices, int numJoints, boolean hardSkinAll, TempAllocator allocator) Skin vertices to the specified joints.Methods inherited from class com.github.stephengold.joltjni.MotionProperties
getAccumulatedForce, getAccumulatedTorque, getAllowedDofs, getAllowSleeping, getAngularDamping, getAngularDofsMask, getAngularVelocity, getGravityFactor, getInertiaRotation, getInverseInertiaDiagonal, getInverseMass, getInverseMassUnchecked, getLinearDamping, getLinearVelocity, getLocalSpaceInverseInertia, getMaxAngularVelocity, getMaxLinearVelocity, getMotionQuality, getNumPositionStepsOverride, getNumVelocityStepsOverride, moveKinematic, resetForce, resetTorque, setAngularDamping, setAngularVelocity, setGravityFactor, setInverseInertia, setInverseMass, setLinearDamping, setLinearVelocity, setMassProperties, setMaxAngularVelocity, setMaxLinearVelocity, setNumPositionStepsOverride, setNumVelocityStepsOverrideMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstMotionProperties
getAccumulatedForce, getAccumulatedTorque, getAllowedDofs, getAllowSleeping, getAngularDamping, getAngularDofsMask, getAngularVelocity, getGravityFactor, getInertiaRotation, getInverseInertiaDiagonal, getInverseMass, getInverseMassUnchecked, getLinearDamping, getLinearVelocity, getLocalSpaceInverseInertia, getMaxAngularVelocity, getMaxLinearVelocity, getMotionQuality, getNumPositionStepsOverride, getNumVelocityStepsOverride
-
Constructor Details
-
SoftBodyMotionProperties
public SoftBodyMotionProperties()Instantiate with the default properties.
-
-
Method Details
-
customUpdate
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-trueto enable any skinning constraints,falseto 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-trueto reposition all vertices to their skinned locationsallocator- for temporary allocations (not null)
-
getEnableSkinConstraints
public boolean getEnableSkinConstraints()Test whether skinning constraints are enabled. The properties are unaffected.- Specified by:
getEnableSkinConstraintsin interfaceConstSoftBodyMotionProperties- Returns:
trueif enabled,falseif disabled
-
getFace
Access the specified face.- Specified by:
getFacein interfaceConstSoftBodyMotionProperties- Parameters:
index- the index of the face (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getFaces
Enumerate all faces in the soft body.- Specified by:
getFacesin interfaceConstSoftBodyMotionProperties- 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:
getNumIterationsin interfaceConstSoftBodyMotionProperties- Returns:
- the number of iterations (≥0)
-
getSettings
Access the shared settings.- Specified by:
getSettingsin interfaceConstSoftBodyMotionProperties- 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:
getSkinnedMaxDistanceMultiplierin interfaceConstSoftBodyMotionProperties- Returns:
- the multiplier
-
getVertex
Access the specified vertex.- Specified by:
getVertexin interfaceConstSoftBodyMotionProperties- Parameters:
index- the index of the vertex (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getVertices
Enumerate all vertices in the soft body.- Specified by:
getVerticesin interfaceConstSoftBodyMotionProperties- Returns:
- a new array of new JVM objects with pre-existing native objects assigned
-
putPinLocations
Write the locations of all pinned vertices to the specified buffer and advance the buffer's position. The properties are unaffected.- Specified by:
putPinLocationsin interfaceConstSoftBodyMotionProperties- Parameters:
comLocation- the location of the body's center of mass (not null)storeFloats- the destination buffer (not null, modified)
-
putVertexLocations
Write the locations of all vertices to the specified buffer and advance the buffer's position. The properties are unaffected.- Specified by:
putVertexLocationsin interfaceConstSoftBodyMotionProperties- Parameters:
comLocation- the location of the body's center of mass (not null)storeFloats- the destination buffer (not null, modified)
-