Package com.github.stephengold.joltjni
Class DistanceConstraint
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Constraint
com.github.stephengold.joltjni.TwoBodyConstraint
com.github.stephengold.joltjni.DistanceConstraint
- All Implemented Interfaces:
ConstConstraint
,ConstJoltPhysicsObject
,ConstTwoBodyConstraint
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
A
TwoBodyConstraint
that holds 2 points at a fixed distance from each
other.-
Method Summary
Modifier and TypeMethodDescriptionAccess the spring settings.float
Return the maximum distance.float
Return the minimum distance.void
setDistance
(float min, float max) Alter the limits.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraint
getBody1, getBody2, getConstraintToBody1Matrix, getConstraintToBody2Matrix, toRef
Methods inherited from class com.github.stephengold.joltjni.Constraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, getSubType, getType, notifyShapeChanged, setConstraintPriority, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride
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.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
getLimitsSpringSettings
Access the spring settings.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxDistance
public float getMaxDistance()Return the maximum distance. The constraint is unaffected.- Returns:
- the distance
-
getMinDistance
public float getMinDistance()Return the minimum distance. The constraint is unaffected.- Returns:
- the distance
-
setDistance
public void setDistance(float min, float max) Alter the limits.- Parameters:
min
- the desired lower limit (in meters)max
- the desired upper limit (in meters)
-