java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RodStretchShear
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstRodStretchShear
,AutoCloseable
,Comparable<JoltPhysicsObject>
Join 2 soft-body vertices with a discrete Cosserat rod. (native type:
SoftBodySharedSettings::RodStretchShear
)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default rod.RodStretchShear
(int vertex0, int vertex1) Instantiate a rod joining the specified vertices with infinite stiffness.RodStretchShear
(int vertex0, int vertex1, float compliance) Instantiate a rod joining the specified vertices with the specified stiffness. -
Method Summary
Modifier and TypeMethodDescriptionReturn the Bishop frame of the rod.float
Return the inverse of the spring's stiffness.float
Return the inverse mass of the rod.float
Return the length of the rod.int
getVertex
(int indexInRod) Return the mesh vertex at the specified end.Alter the Bishop frame of the rod.setCompliance
(float compliance) Alter the stiffness of the rod.setInvMass
(float invMass) Alter the inverse mass of the rod.setLength
(float length) Alter the length of the rod.setVertex
(int indexInRod, int indexInMesh) Assign the specified mesh vertex to the rod.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
-
RodStretchShear
public RodStretchShear()Instantiate a default rod. -
RodStretchShear
public RodStretchShear(int vertex0, int vertex1) Instantiate a rod joining the specified vertices with infinite stiffness.- Parameters:
vertex0
- the mesh index of the first vertex (≥0)vertex1
- the mesh index of the 2nd vertex (≥0)
-
RodStretchShear
public RodStretchShear(int vertex0, int vertex1, float compliance) Instantiate a rod joining the specified vertices with the specified stiffness.- Parameters:
vertex0
- the mesh index of the first vertex (≥0)vertex1
- the mesh index of the 2nd vertex (≥0)compliance
- the inverse of the desired stiffness (default=0)
-
-
Method Details
-
setBishop
Alter the Bishop frame of the rod. (native attribute: mBishop)- Parameters:
bishop
- the desired orientation (not null, unaffected)- Returns:
- the modified settings, for chaining
-
setCompliance
Alter the stiffness of the rod. (native attribute: mCompliance)- Parameters:
compliance
- the inverse of the desired stiffness (default=0)- Returns:
- the modified settings, for chaining
-
setInvMass
Alter the inverse mass of the rod. (native attribute: mInvMass)- Parameters:
invMass
- the desired inverse mass (in 1/kilograms, default=1, 0 for a static rod)- Returns:
- the modified settings, for chaining
-
setLength
Alter the length of the rod. (native attribute: mLength)- Parameters:
length
- the desired length (in meters, default=1)- Returns:
- the modified settings, for chaining
-
setVertex
Assign the specified mesh vertex to the rod. (native attribute: mVertex)- Parameters:
indexInRod
- which end of the rod (0 or 1)indexInMesh
- the index of the vertex to assign (≥0)- Returns:
- the modified settings, for chaining
-
getBishop
Return the Bishop frame of the rod. The rod is unaffected. (native attribute: mBishop)- Specified by:
getBishop
in interfaceConstRodStretchShear
- Returns:
- orientation of the rod
-
getCompliance
public float getCompliance()Return the inverse of the spring's stiffness. The rod is unaffected. (native attribute: mCompliance)- Specified by:
getCompliance
in interfaceConstRodStretchShear
- Returns:
- the compliance value
-
getInvMass
public float getInvMass()Return the inverse mass of the rod. The rod is unaffected. (native attribute: mInvMass)- Specified by:
getInvMass
in interfaceConstRodStretchShear
- Returns:
- the inverse of the mass (in 1/kilograms)
-
getLength
public float getLength()Return the length of the rod. The rod is unaffected. (native attribute: mLength)- Specified by:
getLength
in interfaceConstRodStretchShear
- Returns:
- the length (in meters)
-
getVertex
public int getVertex(int indexInRod) Return the mesh vertex at the specified end. (native attribute: mVertex)- Specified by:
getVertex
in interfaceConstRodStretchShear
- Parameters:
indexInRod
- which end of the rod (0 or 1)- Returns:
- the mesh index of the vertex (≥0)
-