Package com.github.stephengold.joltjni
Class SoftBodySharedSettingsRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.SoftBodySharedSettingsRef
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstSoftBodySharedSettings
,AutoCloseable
,Comparable<JoltPhysicsObject>
A counted reference to a
SoftBodySharedSettings
object. (native type:
Ref<SoftBodySharedSettings>
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEdgeConstraint
(ConstEdge edge) Add the specified edge constraint.void
Add the specified face.void
addInvBindMatrix
(InvBind invBind) Append the specified inverse-bind matrix.void
addRodBendTwistConstraint
(ConstRodBendTwist constraint) Append the specified bend-twist constraint.void
Append the specified discrete Cosserat rod.void
addSkinnedConstraint
(Skinned skinned) Append the specified skinning constraint.void
addVertex
(ConstVertex vertex) Add the specified vertex.void
addVolumeConstraint
(ConstVolume volume) Add the specified volume constraint.void
Calculate the initial lengths of all edges in the body.void
Calculate the information needed to simulate Cosserat rods.void
Calculate the information needed for skinned constraint normals.void
Calculate the initial volumes of all tetrahedra in the body.int
Count the edge constraints.int
Count the faces.int
Count the pinned vertices.int
Count the bend-twist constraints.int
Count the discrete Cosserat rods.int
Count the vertices.int
Count the volume constraints.void
createConstraints
(ConstVertexAttributes[] vertexAttributes, EBendType bendType) Automatically generate constraints based on the faces.void
createConstraints
(ConstVertexAttributes[] vertexAttributes, EBendType bendType, float angleTolerance) Automatically generate constraints based on the faces.void
createConstraints
(ConstVertexAttributes vertexAttributes, int numAttributes, EBendType bendType) Automatically generate constraints based on the faces.getPtr()
Temporarily access the referencedSoftBodySharedSettings
.Enumerate all Cosserat rods in the settings.void
optimize()
Optimize the settings without writing any results.void
putEdgeIndices
(IntBuffer storeIndices) Write the vertex indices of all edges to the specified buffer and advance the buffer's position.void
putFaceIndices
(IntBuffer storeIndices) Write the vertex indices of all faces to the specified buffer and advance the buffer's position.void
saveBinaryState
(StreamOut stream) Write the state of this object to the specified stream, excluding the materials.void
saveWithMaterials
(StreamOut stream, SharedSettingsToIdMap settingsMap, MaterialToIdMap materialMap) Write the state of this object to the specified stream.void
setMaterials
(PhysicsMaterial material) Replace the materials.long
targetVa()
Return the address of the nativeSoftBodySharedSettings
.toRef()
Create another counted reference to the nativeSoftBodySharedSettings
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, 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
-
Constructor Details
-
SoftBodySharedSettingsRef
public SoftBodySharedSettingsRef()Instantiate an empty reference.
-
-
Method Details
-
addEdgeConstraint
Add the specified edge constraint.- Parameters:
edge
- the edge to add (not null, unaffected)
-
addFace
Add the specified face.- Parameters:
face
- the face to add (not null, unaffected)
-
addInvBindMatrix
Append the specified inverse-bind matrix. (native member: mInvBindMatrices)- Parameters:
invBind
- the matrix to add (not null)
-
addRodBendTwistConstraint
Append the specified bend-twist constraint. (native member: mRodBendTwistConstraints)- Parameters:
constraint
- the constraint to add (not null)
-
addRodStretchShearConstraint
Append the specified discrete Cosserat rod. (native member: mRodStretchShearConstraints)- Parameters:
rod
- the rod to add (not null)
-
addSkinnedConstraint
Append the specified skinning constraint. (native member: mSkinnedConstraints)- Parameters:
skinned
- the constraint to add (not null)
-
addVertex
Add the specified vertex. (native member: mVertices)- Parameters:
vertex
- the vertex to add (not null, unaffected)
-
addVolumeConstraint
Add the specified volume constraint. (native member: mVolumeConstraints)- Parameters:
volume
- the constraint to add (not null, unaffected)
-
calculateEdgeLengths
public void calculateEdgeLengths()Calculate the initial lengths of all edges in the body. -
calculateRodProperties
public void calculateRodProperties()Calculate the information needed to simulate Cosserat rods. -
calculateSkinnedConstraintNormals
public void calculateSkinnedConstraintNormals()Calculate the information needed for skinned constraint normals. -
calculateVolumeConstraintVolumes
public void calculateVolumeConstraintVolumes()Calculate the initial volumes of all tetrahedra in the body. -
createConstraints
public void createConstraints(ConstVertexAttributes vertexAttributes, int numAttributes, EBendType bendType) Automatically generate constraints based on the faces.- Parameters:
vertexAttributes
- the desired attributes (one for each vertex)numAttributes
- the number of attributes provided (≥0)bendType
- the desired type of bend constraint (not null, default=Distance)
-
createConstraints
Automatically generate constraints based on the faces.- Parameters:
vertexAttributes
- the desired attributes (one for each vertex)bendType
- the desired type of bend constraint (not null, default=Distance)
-
createConstraints
public void createConstraints(ConstVertexAttributes[] vertexAttributes, EBendType bendType, float angleTolerance) Automatically generate constraints based on the faces.- Parameters:
vertexAttributes
- the desired attributes (one for each vertex)bendType
- the desired type of bend constraint (not null, default=Distance)angleTolerance
- the desired tolerance for creating shear edges (in radians, default=2*Pi/45)
-
optimize
public void optimize()Optimize the settings without writing any results. -
setMaterials
Replace the materials. (native member: mMaterials)- Parameters:
material
- the desired material, ornull
-
countEdgeConstraints
public int countEdgeConstraints()Count the edge constraints. The settings are unaffected. (native member: mEdgeConstraints)- Specified by:
countEdgeConstraints
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countFaces
public int countFaces()Count the faces. The settings are unaffected. (native member: mFaces)- Specified by:
countFaces
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countPinnedVertices
public int countPinnedVertices()Count the pinned vertices. The settings are unaffected.- Specified by:
countPinnedVertices
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countRodBendTwistConstraints
public int countRodBendTwistConstraints()Count the bend-twist constraints. The settings are unaffected. (native member: mRodBendTwistConstraint)- Specified by:
countRodBendTwistConstraints
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countRodStretchShearConstraints
public int countRodStretchShearConstraints()Count the discrete Cosserat rods. The settings are unaffected. (native member: mRodStretchShearConstraint)- Specified by:
countRodStretchShearConstraints
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countVertices
public int countVertices()Count the vertices. The settings are unaffected. (native member: mVertices)- Specified by:
countVertices
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
countVolumeConstraints
public int countVolumeConstraints()Count the volume constraints. The settings are unaffected. (native member: mVolumeConstraints)- Specified by:
countVolumeConstraints
in interfaceConstSoftBodySharedSettings
- Returns:
- the count (≥0)
-
getRodStretchShearConstraints
Enumerate all Cosserat rods in the settings. (native member: mRodStretchShearConstraints)- Specified by:
getRodStretchShearConstraints
in interfaceConstSoftBodySharedSettings
- Returns:
- a new array of new JVM objects with the pre-existing native objects assigned
-
putEdgeIndices
Write the vertex indices of all edges to the specified buffer and advance the buffer's position. The settings are unaffected.- Specified by:
putEdgeIndices
in interfaceConstSoftBodySharedSettings
- Parameters:
storeIndices
- the destination buffer (not null, modified)
-
putFaceIndices
Write the vertex indices of all faces to the specified buffer and advance the buffer's position. The settings are unaffected.- Specified by:
putFaceIndices
in interfaceConstSoftBodySharedSettings
- Parameters:
storeIndices
- the destination buffer (not null, modified)
-
saveBinaryState
Write the state of this object to the specified stream, excluding the materials. The settings are unaffected.- Specified by:
saveBinaryState
in interfaceConstSoftBodySharedSettings
- Parameters:
stream
- where to write objects (notnull
)
-
getPtr
Temporarily access the referencedSoftBodySharedSettings
. -
targetVa
public long targetVa()Return the address of the nativeSoftBodySharedSettings
. No objects are affected.- Specified by:
targetVa
in interfaceConstJoltPhysicsObject
- Overrides:
targetVa
in classJoltPhysicsObject
- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeSoftBodySharedSettings
.
-