java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Skinned
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A constraint that skins a soft-body vertex. (native type:
SoftBodySharedSettings::Skinned
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetWeight
(int index) Access the specified weight.void
Normalize the weights so that they sum to one.void
setWeight
(int index, SkinWeight weight) Copy the specified weight into the array.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
Skinned
public Skinned()Instantiate a default constraint. -
Skinned
public Skinned(int vertexIndex, float maxDistance, float backstopDistance, float backstopRadius) Instantiate a backstopped constraint for the specified vertex.- Parameters:
vertexIndex
- the index of the vertex to constrain (≥0)maxDistance
- the maximum distancebackstopDistance
- the backstop distancebackstopRadius
- the backstop radius
-
-
Method Details
-
getWeight
Access the specified weight. (native attribute: mWeight)- Parameters:
index
- an index into the weight array (≥0, <4)- Returns:
- a new JVM object with the pre-existing native object assigned
-
normalizeWeights
public void normalizeWeights()Normalize the weights so that they sum to one. -
setWeight
Copy the specified weight into the array. (native attribute: mWeight)- Parameters:
index
- an index into the weight array (≥0, <4)weight
- the desired weight (alias created)
-