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.PathConstraint
- All Implemented Interfaces:
ConstConstraint,ConstJoltPhysicsObject,ConstTwoBodyConstraint,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A
TwoBodyConstraint that constrains motion to a path.-
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the maximum friction force when not driven by a motor.getPath()Access the path.floatReturn how far the body is along the path.Access the settings of the position motor.Return the state of the position motor.floatReturn how far the body is along the path.floatReturn the target speed.floatReturn the total lambda of the motor.floatReturn the total lambda of the limits.Copy the total lambda of rotation.voidsetMaxFrictionForce(float force) Alter the maximum friction force when not driven by a motor.voidsetPath(PathConstraintPath path, float amount) Replace the path.voidsetPositionMotorState(EMotorState state) Alter the state of the position motor.voidsetTargetPathFraction(float amount) Alter how far the body is along the path.voidsetTargetVelocity(float speed) Alter the target speed.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraint
getBody1, getBody1PivotLocation, getBody2, getBody2PivotLocation, getConstraintToBody1Matrix, getConstraintToBody2Matrix, toRefMethods inherited from class com.github.stephengold.joltjni.Constraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, getSubType, getType, isActive, notifyShapeChanged, restoreState, saveState, setConstraintPriority, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwnerMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstConstraint
getConstraintPriority, getConstraintSettings, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getSubType, getType, isActive, saveStateMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Method Details
-
getMaxFrictionForce
public float getMaxFrictionForce()Return the maximum friction force when not driven by a motor. The constraint is unaffected.- Returns:
- the force (in Newtons)
-
getPath
Access the path.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getPathFraction
public float getPathFraction()Return how far the body is along the path. The constraint is unaffected.- Returns:
- the amount
-
getPositionMotorSettings
Access the settings of the position motor.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getPositionMotorState
Return the state of the position motor. The constraint is unaffected.- Returns:
- an enum value (not null)
-
getTargetPathFraction
public float getTargetPathFraction()Return how far the body is along the path. The constraint is unaffected.- Returns:
- the amount (≥0)
-
getTargetVelocity
public float getTargetVelocity()Return the target speed. The constraint is unaffected.- Returns:
- the target speed (in meters per second)
-
getTotalLambdaMotor
public float getTotalLambdaMotor()Return the total lambda of the motor. The constraint is unaffected.- Returns:
- the total lambda
-
getTotalLambdaPositionLimits
public float getTotalLambdaPositionLimits()Return the total lambda of the limits. The constraint is unaffected.- Returns:
- the total lambda
-
getTotalLambdaRotation
Copy the total lambda of rotation. The constraint is unaffected.- Returns:
- a new vector
-
setMaxFrictionForce
public void setMaxFrictionForce(float force) Alter the maximum friction force when not driven by a motor.- Parameters:
force- the desired force (in Newtons)
-
setPath
Replace the path.- Parameters:
path- the desired path (not null)amount- how far the body is along the new path
-
setPositionMotorState
Alter the state of the position motor.- Parameters:
state- the desired state (not null)
-
setTargetPathFraction
public void setTargetPathFraction(float amount) Alter how far the body is along the path.- Parameters:
amount- the desired amount (≥0)
-
setTargetVelocity
public void setTargetVelocity(float speed) Alter the target speed.- Parameters:
speed- the desired speed
-