Package com.github.stephengold.joltjni
Class RackAndPinionConstraintSettings
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.RackAndPinionConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings,ConstJoltPhysicsObject,ConstSerializableObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
RackAndPinionConstraint.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate default settings.Instantiate a copy of the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionCopy the hinge axis of the pinion.floatgetRatio()Return the ratio of pinion rotation divided rack translation.Copy the translation axis of the slider.getSpace()Return which space the other properties are specified in.setHingeAxis(Vec3Arg direction) Alter the hinge axis of the pinion.voidsetRatio(float ratio) Alter the ratio of pinion rotation to rack translation.voidsetRatio(int rackTeeth, float rackLength, int pinionTeeth) Update the ratio of pinion rotation to rack translation.setSliderAxis(Vec3Arg direction) Alter the translation axis of the rack.voidsetSpace(EConstraintSpace space) Alter which space the other properties are specified in.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
-
RackAndPinionConstraintSettings
public RackAndPinionConstraintSettings()Instantiate default settings. -
RackAndPinionConstraintSettings
Instantiate a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, unaffected)
-
-
Method Details
-
getHingeAxis
Copy the hinge axis of the pinion. The settings are unaffected. (native attribute: mHingeAxis)- Returns:
- a new direction vector
-
getRatio
public float getRatio()Return the ratio of pinion rotation divided rack translation. The settings are unaffected. (native attribute: mRatio)- Returns:
- the ratio (in radians per meter)
-
getSliderAxis
Copy the translation axis of the slider. The settings are unaffected. (native attribute: mSliderAxis)- Returns:
- a new direction vector
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not
null)
-
setHingeAxis
Alter the hinge axis of the pinion. (native attribute: mHingeAxis)- Parameters:
direction- the desired axis direction (notnull, unaffected, default=(1,0,0))- Returns:
- the argument, for chaining
-
setRatio
public void setRatio(float ratio) Alter the ratio of pinion rotation to rack translation. (native attribute: mRatio)- Parameters:
ratio- the desired radio (in radians/meter)
-
setRatio
public void setRatio(int rackTeeth, float rackLength, int pinionTeeth) Update the ratio of pinion rotation to rack translation.- Parameters:
rackTeeth- the number of teeth in the rackrackLength- the length of the rack (in meters)pinionTeeth- the number of teeth in the pinion
-
setSliderAxis
Alter the translation axis of the rack. (native attribute: mSliderAxis)- Parameters:
direction- the desired axis direction (notnull, unaffected, default=(1,0,0))- Returns:
- the argument, for chaining
-
setSpace
Alter which space the other properties are specified in. (native attribute: mSpace)- Parameters:
space- enum value (notnull, default=WorldSpace)
-