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.SixDofConstraint
- All Implemented Interfaces:
ConstConstraint,ConstJoltPhysicsObject,ConstTwoBodyConstraint,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
A
TwoBodyConstraint that can constrain all 6 degrees of freedom.
(native type: SixDOFConstraint)-
Method Summary
Modifier and TypeMethodDescriptionfloatgetLimitsMax(EAxis dof) Return the upper limit of the specified degree of freedom.floatgetLimitsMin(EAxis dof) Return the lower limit of the specified degree of freedom.Access the spring settings of the specified degree of freedom.floatgetMaxFriction(EAxis dof) Return the maximum friction of the specified degree of freedom.getMotorSettings(EAxis dof) Access the motor settings of the specified degree of freedom.getMotorState(EAxis dof) Return the motor state of the specified degree of freedom.Copy the rotation of the constraint.voidgetRotationInConstraintSpace(Quat storeResult) Copy the rotation of the constraint.Copy the rotation upper limits.voidgetRotationLimitsMax(Vec3 storeResult) Copy the rotation upper limits.Copy the rotation lower limits.voidgetRotationLimitsMin(Vec3 storeResult) Copy the rotation lower limits.Copy the target velocities of the angular motors.voidgetTargetAngularVelocityCs(Vec3 storeResult) Copy the target velocities of the angular motors.Copy the target orientation of the angular motors.voidgetTargetOrientationCs(Quat storeResult) Copy the target orientation of the angular motors.Copy the target position of the linear motors.voidgetTargetPositionCs(Vec3 storeResult) Copy the target position of the linear motors.Copy the target velocities of the linear motors.voidgetTargetVelocityCs(Vec3 storeResult) Copy the target velocities of the linear motors.Copy the translation upper limits.voidgetTranslationLimitsMax(Vec3 storeResult) Copy the translation upper limits.Copy the translation lower limits.voidgetTranslationLimitsMin(Vec3 storeResult) Copy the translation lower limits.booleanisFixedAxis(EAxis dof) Test whether the specified degree of freedom is fixed.booleanisFreeAxis(EAxis dof) Test whether the specified degree of freedom is free.voidsetLimitsSpringSettings(EAxis dof, ConstSpringSettings springSettings) Alter the spring settings of the specified degree of freedom.voidsetMaxFriction(EAxis dof, float friction) Alter the maximum friction of the specified degree of freedom.voidsetMotorState(EAxis dof, EMotorState state) Alter the motor state of the specified degree of freedom.voidsetRotationLimits(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) Alter the rotation limits.voidsetRotationLimits(Vec3Arg min, Vec3Arg max) Alter the rotation limits.voidsetTargetAngularVelocityCs(float wx, float wy, float wz) Alter the target velocities of the angular motors.voidAlter the target velocities of the angular motors.voidsetTargetOrientationBs(float qx, float qy, float qz, float qw) Alter the target orientation of the angular motors in body space.voidsetTargetOrientationBs(QuatArg orientation) Alter the target orientation of the angular motors in body space.voidsetTargetOrientationCs(float qx, float qy, float qz, float qw) Alter the target orientation of the angular motors.voidsetTargetOrientationCs(QuatArg orientation) Alter the target orientation of the angular motors.voidsetTargetPositionCs(float x, float y, float z) Alter the target position of the linear motors.voidsetTargetPositionCs(Vec3Arg offsets) Alter the target position of the linear motors.voidsetTargetVelocityCs(float vx, float vy, float vz) Alter the target velocities of the linear motors.voidsetTargetVelocityCs(Vec3Arg velocity) Alter the target velocities of the linear motors.voidsetTranslationLimits(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) Alter the translation limits.voidsetTranslationLimits(Vec3Arg min, Vec3Arg max) Alter the translation limits.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraint
getBody1, getBody1PivotLocation, getBody1PivotLocation, getBody2, getBody2PivotLocation, 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, targetVaOrZero, 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, targetVaOrZero
-
Method Details
-
getLimitsMax
Return the upper limit of the specified degree of freedom. The constraint is unaffected.- Parameters:
dof- which DOF to query (not null)- Returns:
- the limit value
-
getLimitsMin
Return the lower limit of the specified degree of freedom. The constraint is unaffected.- Parameters:
dof- which DOF to query (not null)- Returns:
- the limit value
-
getLimitsSpringSettings
Access the spring settings of the specified degree of freedom. The constraint is unaffected.- Parameters:
dof- which degree of freedom to query (not null)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxFriction
Return the maximum friction of the specified degree of freedom. The constraint is unaffected.- Parameters:
dof- which DPF to alter (not null)- Returns:
- the friction value
-
getMotorSettings
Access the motor settings of the specified degree of freedom.- Parameters:
dof- which degree of freedom to query (not null)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMotorState
Return the motor state of the specified degree of freedom. The constraint is unaffected.- Parameters:
dof- which DOF to alter (not null)- Returns:
- an enum value (not null)
-
getRotationInConstraintSpace
Copy the rotation of the constraint. The constraint is unaffected.- Returns:
- a new rotation quaternion
-
getRotationInConstraintSpace
Copy the rotation of the constraint. The constraint is unaffected.- Parameters:
storeResult- storage for the rotation (notnull, modified)
-
getRotationLimitsMax
Copy the rotation upper limits. The constraint is unaffected.- Returns:
- the upper limit for each axis (not null)
-
getRotationLimitsMax
Copy the rotation upper limits. The constraint is unaffected.- Parameters:
storeResult- storage for the limits (notnull, modified)
-
getRotationLimitsMin
Copy the rotation lower limits. The constraint is unaffected.- Returns:
- the lower limit for each axis (not null)
-
getRotationLimitsMin
Copy the rotation lower limits. The constraint is unaffected.- Parameters:
storeResult- storage for the limits (notnull, modified)
-
getTargetAngularVelocityCs
Copy the target velocities of the angular motors. The constraint is unaffected. (native function: GetTargetAngularVelocityCS)- Returns:
- a new angular velocity vector (radians per second in body 2 constraint space)
-
getTargetAngularVelocityCs
Copy the target velocities of the angular motors. The constraint is unaffected. (native function: GetTargetAngularVelocityCS)- Parameters:
storeResult- storage for the velocity (radians per second in body 2 constraint space, notnull, modified)
-
getTargetPositionCs
Copy the target position of the linear motors. The constraint is unaffected. (native function: GetTargetPositionCS)- Returns:
- a new offset vector (meters in body 1 constraint space)
-
getTargetPositionCs
Copy the target position of the linear motors. The constraint is unaffected. (native function: GetTargetPositionCS)- Parameters:
storeResult- storage for the offset (meters in body 1 constraint space, notnull, modified)
-
getTargetOrientationCs
Copy the target orientation of the angular motors. The constraint is unaffected. (native function: GetTargetOrientationCS)- Returns:
- the target orientation (in constraint space)
-
getTargetOrientationCs
Copy the target orientation of the angular motors. The constraint is unaffected. (native function: GetTargetOrientationCS)- Parameters:
storeResult- storage for the orientation (in body 1 constraint space, notnull, modified)
-
getTargetVelocityCs
Copy the target velocities of the linear motors. The constraint is unaffected. (native function: GetTargetVelocityCS)- Returns:
- a new linear velocity vector (meters per second in body 1 constraint space)
-
getTargetVelocityCs
Copy the target velocities of the linear motors. The constraint is unaffected. (native function: GetTargetVelocityCS)- Parameters:
storeResult- storage for the velocity (meters per second in body 1 constraint space, notnull, modified)
-
getTranslationLimitsMax
Copy the translation upper limits. The constraint is unaffected.- Returns:
- the upper limit for each axis (not null)
-
getTranslationLimitsMax
Copy the translation upper limits. The constraint is unaffected.- Parameters:
storeResult- storage for the limits (notnull, modified)
-
getTranslationLimitsMin
Copy the translation lower limits. The constraint is unaffected.- Returns:
- the lower limit for each axis (not null)
-
getTranslationLimitsMin
Copy the translation lower limits. The constraint is unaffected.- Parameters:
storeResult- storage for the limits (notnull, modified)
-
isFixedAxis
Test whether the specified degree of freedom is fixed. The constraint is unaffected.- Parameters:
dof- which DOF to query (not null)- Returns:
trueif fixed, otherwisefalse
-
isFreeAxis
Test whether the specified degree of freedom is free. The constraint is unaffected.- Parameters:
dof- which DOF to query (not null)- Returns:
trueif free, otherwisefalse
-
setLimitsSpringSettings
Alter the spring settings of the specified degree of freedom.- Parameters:
dof- which DOF to alter (notnull)springSettings- the desired settings (notnull, unaffected)
-
setMaxFriction
Alter the maximum friction of the specified degree of freedom.- Parameters:
dof- which DOF to alter (notnull)friction- the desired value
-
setMotorState
Alter the motor state of the specified degree of freedom.- Parameters:
dof- which DOF to alter (notnull)state- the desired state (notnull)
-
setRotationLimits
public void setRotationLimits(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) Alter the rotation limits.- Parameters:
minX- the lower limit on the X axisminY- the lower limit on the Y axisminZ- the lower limit on the Z axismaxX- the upper limit on the X axismaxY- the upper limit on the Y axismaxZ- the upper limit on the Z axis
-
setRotationLimits
Alter the rotation limits.- Parameters:
min- the lower limit for each axis (notnull, unaffected)max- the upper limit for each axis (notnull, unaffected)
-
setTargetVelocityCs
public void setTargetVelocityCs(float vx, float vy, float vz) Alter the target velocities of the linear motors. (native function: SetTargetVelocityCS)- Parameters:
vx- the desired X component of the velocity (meters per second in body 1 constraint space)vy- the desired Y component of the velocity (meters per second in body 1 constraint space)vz- the desired Z component of the velocity (meters per second in body 1 constraint space)
-
setTargetVelocityCs
Alter the target velocities of the linear motors. (native function: SetTargetVelocityCS)- Parameters:
velocity- the desired linear velocity (meters per second in body 1 constraint space, notnull)
-
setTargetAngularVelocityCs
public void setTargetAngularVelocityCs(float wx, float wy, float wz) Alter the target velocities of the angular motors. (native function: SetTargetAngularVelocityCS)- Parameters:
wx- the desired X component of the angular velocity (radians per second in body 2 constraint space)wy- the desired Y component of the angular velocity (radians per second in body 2 constraint space)wz- the desired Z component of the angular velocity (radians per second in body 2 constraint space)
-
setTargetAngularVelocityCs
Alter the target velocities of the angular motors. (native function: SetTargetAngularVelocityCS)- Parameters:
omega- the desired angular velocity (radians per second in body 2 constraint space, notnull)
-
setTargetPositionCs
public void setTargetPositionCs(float x, float y, float z) Alter the target position of the linear motors. (native function: SetTargetPositionCS)- Parameters:
x- the desired X offset (meters in body 1 constraint space)y- the desired Y offset (meters in body 1 constraint space)z- the desired Z offset (meters in body 1 constraint space)
-
setTargetPositionCs
Alter the target position of the linear motors. (native function: SetTargetPositionCS)- Parameters:
offsets- the desired offsets (meters in body 1 constraint space)
-
setTargetOrientationBs
public void setTargetOrientationBs(float qx, float qy, float qz, float qw) Alter the target orientation of the angular motors in body space. (native function: SetTargetOrientationBS)- Parameters:
qx- the X component of the desired orientationqy- the Y component of the desired orientationqz- the Z component of the desired orientationqw- the W component of the desired orientation
-
setTargetOrientationBs
Alter the target orientation of the angular motors in body space. (native function: SetTargetOrientationBS)- Parameters:
orientation- the desired targetVa orientation (notnull, unaffected)
-
setTargetOrientationCs
public void setTargetOrientationCs(float qx, float qy, float qz, float qw) Alter the target orientation of the angular motors. (native function: SetTargetOrientationCS)- Parameters:
qx- the X component of the desired orientationqy- the Y component of the desired orientationqz- the Z component of the desired orientationqw- the W component of the desired orientation
-
setTargetOrientationCs
Alter the target orientation of the angular motors. (native function: SetTargetOrientationCS)- Parameters:
orientation- the desired orientation (in body 1 constraint space)
-
setTranslationLimits
public void setTranslationLimits(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) Alter the translation limits.- Parameters:
minX- the lower limit on the X axisminY- the lower limit on the Y axisminZ- the lower limit on the Z axismaxX- the upper limit on the X axismaxY- the upper limit on the Y axismaxZ- the upper limit on the Z axis
-
setTranslationLimits
Alter the translation limits.- Parameters:
min- the lower limit for each axis (notnull, unaffected)max- the upper limit for each axis (notnull, unaffected)
-