Package com.github.stephengold.joltjni
Class SixDofConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.TwoBodyConstraintSettings
com.github.stephengold.joltjni.SixDofConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings,ConstJoltPhysicsObject,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
SixDofConstraint. (native type:
SixDOFConstraintSettings)-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionCopy the X axis for body 1.Copy the X axis for body 2.Copy the Y axis for body 1.Copy the Y axis for body 2.floatgetLimitMax(int dofIndex) Return the upper limit of the specified degree of freedom.floatgetLimitMax(EAxis dof) Return the upper limit of the specified degree of freedom.floatgetLimitMin(int dofIndex) Return the lower limit of the specified degree of freedom.floatgetLimitMin(EAxis dof) Return the lower limit of the specified degree of freedom.getLimitsSpringSettings(EAxis translationDof) Access the spring settings for the specified degree of freedom.floatgetMaxFriction(EAxis dof) Return the maximum friction of the specified degree of freedom.getMotorSettings(int dofIndex) Access the motor settings for the specified degree of freedom.getMotorSettings(EAxis dof) Access the motor settings for the specified degree of freedom.Copy the constraint location for body 1.Copy the constraint location for body 2.getSpace()Return which space the other properties are specified in.Return type of swing constraint.booleanisFixedAxis(EAxis dof) Test whether the specified degree of freedom is fixed.booleanisFreeAxis(EAxis dof) Test whether the specified degree of freedom is free.voidmakeFixedAxis(int dofIndex) Make the specified degree of freedom a fixed one.voidmakeFixedAxis(EAxis dof) Make the specified degree of freedom a fixed one.voidmakeFreeAxis(int dofIndex) Make the specified degree of freedom a free one.voidmakeFreeAxis(EAxis dof) Make the specified degree of freedom a free one.Alter the X axis for body 1.Alter the X axis for body 2.Alter the Y axis for body 1.Alter the Y axis for body 2.voidsetLimitedAxis(int dofIndex, float min, float max) Alter the limits of the specified degree of freedom.voidsetLimitedAxis(EAxis dof, float min, float max) Alter the limits of the specified degree of freedom.voidsetLimitMax(EAxis dof, float max) Alter the upper limit of the specified degree of freedom.voidsetLimitMin(EAxis dof, float min) Alter the lower limit of the specified DOF.voidsetMaxFriction(EAxis dof, float friction) Alter the maximum friction of the specified degree of freedom.voidsetMotorSettings(int dofIndex, MotorSettings motorSettings) Alter the motor settings for the specified degree of freedom.setMotorSettings(EAxis dof, MotorSettings motorSettings) Alter the motor settings for the specified degree of freedom.setPosition1(RVec3Arg location) Alter the constraint location for body 1.setPosition2(RVec3Arg location) Alter the constraint location for body 2.voidsetSpace(EConstraintSpace space) Alter which space the other properties are specified in.voidsetSwingType(ESwingType swingType) Alter the type of swing constraint.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRefMethods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, saveBinaryState, setConstraintPriority, setDrawConstraintSize, setEmbedded, setEnabled, setNumPositionStepsOverride, setNumVelocityStepsOverride, setVirtualAddressAsCoOwner, sRestoreFromBinaryStateMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
SixDofConstraintSettings
public SixDofConstraintSettings()Instantiate default settings. -
SixDofConstraintSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
getAxisX1
Copy the X axis for body 1. The settings are unaffected. (native attribute: mAxisX1)- Returns:
- a new direction vector
-
getAxisX2
Copy the X axis for body 2. The settings are unaffected. (native attribute: mAxisX2)- Returns:
- a new direction vector
-
getAxisY1
Copy the Y axis for body 1. The settings are unaffected. (native attribute: mAxisY1)- Returns:
- a new direction vector
-
getAxisY2
Copy the Y axis for body 2. The settings are unaffected. (native attribute: mAxisY2)- Returns:
- a new direction vector
-
getLimitMax
Return the upper limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMax)- Parameters:
dof- which DOF (not null)- Returns:
- the upper limit
-
getLimitMax
public float getLimitMax(int dofIndex) Return the upper limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMax)- Parameters:
dofIndex- which DOF (≥0, <6)- Returns:
- the upper limit
-
getLimitMin
Return the lower limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMin)- Parameters:
dof- which DOF (not null)- Returns:
- the lower limit
-
getLimitMin
public float getLimitMin(int dofIndex) Return the lower limit of the specified degree of freedom. The settings are unaffected. (native attribute: mLimitMin)- Parameters:
dofIndex- which DOF (≥0,<6)- Returns:
- the lower limit
-
getLimitsSpringSettings
Access the spring settings for the specified degree of freedom. (native attribute: mLimitsSpringSettings)- Parameters:
translationDof- which DOF (not null, not a rotation DOF)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMaxFriction
Return the maximum friction of the specified degree of freedom. The settings are unaffected. (native attribute: mMaxFriction)- Parameters:
dof- which DOF (not null)- Returns:
- the maximum friction value
-
getMotorSettings
Access the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)- Parameters:
dof- which DOF (not null)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getMotorSettings
Access the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)- Parameters:
dofIndex- which DOF (≥0, <6)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getPosition1
Copy the constraint location for body 1. The settings are unaffected. (native attribute: mPosition1)- Returns:
- a new location vector
-
getPosition2
Copy the constraint location for body 2. The settings are unaffected. (native attribute: mPosition2)- Returns:
- a new location vector
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not null)
-
getSwingType
Return type of swing constraint. The settings are unaffected. (native attribute: mSwingType)- Returns:
- an enum value (not null)
-
isFixedAxis
Test whether the specified degree of freedom is fixed. The settings are unaffected.- Parameters:
dof- which DOF to test (not null)- Returns:
trueif fixed, otherwisefalse
-
isFreeAxis
Test whether the specified degree of freedom is free. The settings are unaffected.- Parameters:
dof- which DOF to test (not null)- Returns:
trueif free, otherwisefalse
-
makeFixedAxis
Make the specified degree of freedom a fixed one.- Parameters:
dof- which DOF to modify (not null)
-
makeFixedAxis
public void makeFixedAxis(int dofIndex) Make the specified degree of freedom a fixed one.- Parameters:
dofIndex- which DOF to modify (≥0, <6)
-
makeFreeAxis
Make the specified degree of freedom a free one.- Parameters:
dof- which DOF to modify (not null)
-
makeFreeAxis
public void makeFreeAxis(int dofIndex) Make the specified degree of freedom a free one.- Parameters:
dofIndex- which DOF to modify (≥0, <5)
-
setAxisX1
Alter the X axis for body 1. (native attribute: mAxisX1)- Parameters:
axis- the desired direction vector (default=(1,0,0))- Returns:
- the argument, for chaining
-
setAxisX2
Alter the X axis for body 2. (native attribute: mAxisX2)- Parameters:
axis- the desired direction vector (default=(1,0,0))- Returns:
- the argument, for chaining
-
setAxisY1
Alter the Y axis for body 1. (native attribute: mAxisY1)- Parameters:
axis- the desired direction vector (default=(0,1,0))- Returns:
- the argument, for chaining
-
setAxisY2
Alter the Y axis for body 2. (native attribute: mAxisY2)- Parameters:
axis- the desired direction vector (default=(0,1,0))- Returns:
- the argument, for chaining
-
setLimitedAxis
Alter the limits of the specified degree of freedom.- Parameters:
dof- which DOF to modify (not null)min- the desired minimum valuemax- the desired maximum value
-
setLimitedAxis
public void setLimitedAxis(int dofIndex, float min, float max) Alter the limits of the specified degree of freedom.- Parameters:
dofIndex- which DOF to modify (≥0, <6)min- the desired minimum valuemax- the desired maximum value
-
setLimitMax
Alter the upper limit of the specified degree of freedom. (native attribute: mLimitMax)- Parameters:
dof- which DOF to modify (not null)max- the desired limit value (default=MAX_VALUE)
-
setLimitMin
Alter the lower limit of the specified DOF. (native attribute: mLimitMin)- Parameters:
dof- which DOF to modify (not null)min- the desired limit value (default=-MAX_VALUE)
-
setMaxFriction
Alter the maximum friction of the specified degree of freedom. (native attribute: mMaxFriction)- Parameters:
dof- which DOF to modify (not null)friction- the desired value (default=0)
-
setMotorSettings
Alter the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)- Parameters:
dof- which DOF (not null)motorSettings- the settings to copy (not null, unaffected)- Returns:
- the motor settings, for chaining
-
setMotorSettings
Alter the motor settings for the specified degree of freedom. (native attribute: mMotorSettings)- Parameters:
dofIndex- which DOF (≥0, <6)motorSettings- the settings to copy (not null, unaffected)
-
setPosition1
Alter the constraint location for body 1. (native attribute: mPosition1)- Parameters:
location- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setPosition2
Alter the constraint location for body 2. (native attribute: mPosition2)- Parameters:
location- the desired location (not null, unaffected, default=(0,0,0))- Returns:
- the argument, for chaining
-
setSpace
Alter which space the other properties are specified in. (native attribute: mSpace)- Parameters:
space- an enum value (not null, default=WorldSpace)
-
setSwingType
Alter the type of swing constraint. (native attribute: mSwingType)- Parameters:
swingType- an enum value (not null, default=Cone)
-