java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VertexAttributes
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstVertexAttributes
,AutoCloseable
,Comparable<JoltPhysicsObject>
Per-vertex attributes used to configure the constraints in a soft body. The
compliance of each constraint is determined by averaging attached vertices.
(native type:
SoftBodySharedSettings::VertexAttributes
)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default attributes.VertexAttributes
(float compliance, float shearCompliance, float bendCompliance) Instantiate attributes as specified.VertexAttributes
(float compliance, float shearCompliance, float bendCompliance, ELraType lraType) Instantiate attributes as specified.VertexAttributes
(float compliance, float shearCompliance, float bendCompliance, ELraType lraType, float lraMultiplier) Instantiate attributes as specified. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the compliance of bend edges.float
Return the compliance of the regular edges.float
Return the multiplier for the maximum distance of the long-range attachment (LRA) constraint.Return the type of the long-range attachment (LRA) constraint.float
Return the compliance of the shear edges.float
setBendCompliance
(float compliance) Alter the compliance for bend edges.float
setCompliance
(float compliance) Alter the compliance for regular edges.float
setLraMaxDistanceMultiplier
(float multiplier) Alter the multiplier for the maximum distance of the long-range attachment (LRA) constraint.void
setLraType
(ELraType type) Alter the type of the long-range attachment (LRA) constraint.float
setShearCompliance
(float compliance) Alter the compliance for shear edges.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
-
Constructor Details
-
VertexAttributes
public VertexAttributes()Instantiate default attributes. -
VertexAttributes
public VertexAttributes(float compliance, float shearCompliance, float bendCompliance) Instantiate attributes as specified.- Parameters:
compliance
- the desired compliance for regular edges (default=0)shearCompliance
- the desired compliance for shear edges (default=0)bendCompliance
- the desired compliance for bend edges (default=MAX_VALUE)
-
VertexAttributes
public VertexAttributes(float compliance, float shearCompliance, float bendCompliance, ELraType lraType) Instantiate attributes as specified.- Parameters:
compliance
- the desired compliance for regular edges (default=0)shearCompliance
- the desired compliance for shear edges (default=0)bendCompliance
- the desired compliance for bend edges (default=MAX_VALUE)lraType
- the desired long-range attachment (LRA) constraint (not null, default=None)
-
VertexAttributes
public VertexAttributes(float compliance, float shearCompliance, float bendCompliance, ELraType lraType, float lraMultiplier) Instantiate attributes as specified.- Parameters:
compliance
- the desired compliance for regular edges (default=0)shearCompliance
- the desired compliance for shear edges (default=0)bendCompliance
- the desired compliance for bend edges (default=MAX_VALUE)lraType
- the desired long-range attachment (LRA) constraint (not null, default=None)lraMultiplier
- the desired multiplier for the maximum distance of the LRA constraint (relative to the rest-pose distance, default=1)
-
-
Method Details
-
setBendCompliance
public float setBendCompliance(float compliance) Alter the compliance for bend edges. (native attribute: mBendCompliance)- Parameters:
compliance
- the desired compliance value (MAX_VALUE to disable any bend edges attached to the vertex, default=MAX_VALUE)- Returns:
- the argument, for chaining
-
setCompliance
public float setCompliance(float compliance) Alter the compliance for regular edges. (native attribute: mCompliance)- Parameters:
compliance
- the desired compliance value (MAX_VALUE to disable any regular edges attached to the vertex, default=0)- Returns:
- the argument, for chaining
-
setLraMaxDistanceMultiplier
public float setLraMaxDistanceMultiplier(float multiplier) Alter the multiplier for the maximum distance of the long-range attachment (LRA) constraint. (native attribute: mLRAMaxDistanceMultiplier)- Parameters:
multiplier
- the desired multiplier for the maximum distance of the LRA constraint (relative to the rest-pose distance, default=1)- Returns:
- the argument, for chaining
-
setLraType
Alter the type of the long-range attachment (LRA) constraint. (native attribute: mLRAType)- Parameters:
type
- the desired type (not null, default=None)
-
setShearCompliance
public float setShearCompliance(float compliance) Alter the compliance for shear edges. (native attribute: mShearCompliance)- Parameters:
compliance
- the desired compliance value (MAX_VALUE to disable any shear edges attached to the vertex, default=0)- Returns:
- the argument, for chaining
-
getBendCompliance
public float getBendCompliance()Return the compliance of bend edges. The attributes are unaffected. (native attribute: mBendCompliance)- Specified by:
getBendCompliance
in interfaceConstVertexAttributes
- Returns:
- the compliance value
-
getCompliance
public float getCompliance()Return the compliance of the regular edges. The attributes are unaffected. (native attribute: mCompliance)- Specified by:
getCompliance
in interfaceConstVertexAttributes
- Returns:
- the compliance value
-
getLraMaxDistanceMultiplier
public float getLraMaxDistanceMultiplier()Return the multiplier for the maximum distance of the long-range attachment (LRA) constraint. The attributes are unaffected. (native attribute: mLRAMaxDistanceMultiplier)- Specified by:
getLraMaxDistanceMultiplier
in interfaceConstVertexAttributes
- Returns:
- the multiplier (relative to the rest-pose distance)
-
getLraType
Return the type of the long-range attachment (LRA) constraint. The attributes are unaffected. (native attribute: mLRAType)- Specified by:
getLraType
in interfaceConstVertexAttributes
- Returns:
- the enum value (not null)
-
getShearCompliance
public float getShearCompliance()Return the compliance of the shear edges. The attributes are unaffected. (native attribute: mShearCompliance)- Specified by:
getShearCompliance
in interfaceConstVertexAttributes
- Returns:
- the compliance value
-