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 TypeMethodDescriptionfloat
Return the maximum friction force when not driven by a motor.getPath()
Access the path.float
Return how far the body is along the path.Access the settings of the position motor.Return the state of the position motor.float
Return how far the body is along the path.float
Return the target speed.float
Return the total lambda of the motor.float
Return the total lambda of the limits.Copy the total lambda of rotation.void
setMaxFrictionForce
(float force) Alter the maximum friction force when not driven by a motor.void
setPath
(PathConstraintPath path, float amount) Replace the path.void
setPositionMotorState
(EMotorState state) Alter the state of the position motor.void
setTargetPathFraction
(float amount) Alter how far the body is along the path.void
setTargetVelocity
(float speed) Alter the target speed.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
-
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
-