java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Edge
- All Implemented Interfaces:
ConstEdge
,ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Join 2 soft-body vertices with a spring. (native type:
SoftBodySharedSettings::Edge
)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the inverse of the spring's stiffness.float
Return the rest length of the spring.int
getVertex
(int indexInEdge) Return the mesh vertex at the specified end.setCompliance
(float compliance) Alter the stiffness of the spring.setRestLength
(float length) Alter the rest length of the spring.setVertex
(int indexInEdge, int indexInMesh) Assign the specified mesh vertex to the edge.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
-
Edge
public Edge()Instantiate a default edge constraint.
-
-
Method Details
-
setCompliance
Alter the stiffness of the spring. (native attribute: mCompliance)- Parameters:
compliance
- the inverse of the desired stiffness (default=0)- Returns:
- the modified settings, for chaining
-
setRestLength
Alter the rest length of the spring. (native attribute: mRestLength)- Parameters:
length
- the desired length (in meters, default=1)- Returns:
- the modified settings, for chaining
-
setVertex
Assign the specified mesh vertex to the edge. (native attribute: mVertex)- Parameters:
indexInEdge
- which end of the edge (0 or 1)indexInMesh
- the index of the vertex to assign (≥0)- Returns:
- the modified settings, for chaining
-
getCompliance
public float getCompliance()Return the inverse of the spring's stiffness. The edge is unaffected. (native attribute: mCompliance)- Specified by:
getCompliance
in interfaceConstEdge
- Returns:
- the compliance value
-
getRestLength
public float getRestLength()Return the rest length of the spring. The edge is unaffected. (native attribute: mRestLength)- Specified by:
getRestLength
in interfaceConstEdge
- Returns:
- the length (in meters)
-
getVertex
public int getVertex(int indexInEdge) Return the mesh vertex at the specified end. (native attribute: mVertex)
-