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 TypeMethodDescriptionvoid
customUpdate
(float deltaTime, Body softBody, PhysicsSystem system) Update the specified soft body without updating the rest of the physics system.boolean
Test whether skinning constraints are enabled.getFace
(int index) Access the specified face.Face[]
getFaces()
Enumerate all faces in the soft body.int
Return the number of solver iterations.Access the shared settings.float
Return the maximum distance multiplier for skinned vertices.getVertex
(int index) Access the specified vertex.Enumerate all vertices in the soft body.void
putPinLocations
(RVec3Arg comLocation, FloatBuffer storeFloats) Write the locations of all pinned vertices to the specified buffer and advance the buffer's position.void
putVertexLocations
(RVec3Arg comLocation, FloatBuffer storeFloats) Write the locations of all vertices to the specified buffer and advance the buffer's position.void
setEnableSkinConstraints
(boolean enable) Enable or disable any skinning constraints.void
setNumIterations
(int numIterations) Alter the number of solver iterations.void
setSkinnedMaxDistanceMultiplier
(float multiplier) Alter the maximum distance multiplier for skinned vertices.void
skinVertices
(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, setNumVelocityStepsOverride
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
Methods 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
-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 locationsallocator
- for temporary allocations (not null)
-
getEnableSkinConstraints
public boolean getEnableSkinConstraints()Test whether skinning constraints are enabled. The properties are unaffected.- Specified by:
getEnableSkinConstraints
in interfaceConstSoftBodyMotionProperties
- Returns:
true
if enabled,false
if disabled
-
getFace
Access the specified face.- Specified by:
getFace
in 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:
getFaces
in 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:
getNumIterations
in interfaceConstSoftBodyMotionProperties
- Returns:
- the number of iterations (≥0)
-
getSettings
Access the shared settings.- Specified by:
getSettings
in 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:
getSkinnedMaxDistanceMultiplier
in interfaceConstSoftBodyMotionProperties
- Returns:
- the multiplier
-
getVertex
Access the specified vertex.- Specified by:
getVertex
in 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:
getVertices
in 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:
putPinLocations
in 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:
putVertexLocations
in interfaceConstSoftBodyMotionProperties
- Parameters:
comLocation
- the location of the body's center of mass (not null)storeFloats
- the destination buffer (not null, modified)
-