Package com.github.stephengold.joltjni
Class GearConstraintSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ConstraintSettings
com.github.stephengold.joltjni.TwoBodyConstraintSettings
com.github.stephengold.joltjni.GearConstraintSettings
- All Implemented Interfaces:
ConstConstraintSettings
,ConstJoltPhysicsObject
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
GearConstraint
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy the hinge axis for body 1.Copy the hinge axis for body 2.float
getRatio()
Return the gear ratio.getSpace()
Return which space the other properties are specified in.void
setHingeAxis1
(Vec3Arg axis) Alter the hinge axis for body 1.void
setHingeAxis2
(Vec3Arg axis) Alter the hinge axis for body 2.void
setRatio
(float ratio) Alter the gear ratio.void
setRatio
(int numTeeth1, int numTeeth2) Alter the gear ratio.void
setSpace
(EConstraintSpace space) Alter which space the other properties are specified in.Methods inherited from class com.github.stephengold.joltjni.TwoBodyConstraintSettings
create, toRef
Methods inherited from class com.github.stephengold.joltjni.ConstraintSettings
getConstraintPriority, getControllerType, getDrawConstraintSize, getEnabled, getNumPositionStepsOverride, getNumVelocityStepsOverride, getRefCount, setConstraintPriority, setDrawConstraintSize, 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.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
GearConstraintSettings
public GearConstraintSettings()Instantiate default settings.
-
-
Method Details
-
getHingeAxis1
Copy the hinge axis for body 1. The settings are unaffected. (native attribute: mHingeAxis1)- Returns:
- a new direction vector
-
getHingeAxis2
Copy the hinge axis for body 2. The settings are unaffected. (native attribute: mHingeAxis2)- Returns:
- a new direction vector
-
getRatio
public float getRatio()Return the gear ratio.- Returns:
- the ratio
-
getSpace
Return which space the other properties are specified in. The settings are unaffected. (native attribute: mSpace)- Returns:
- an enum value (not null)
-
setHingeAxis1
Alter the hinge axis for body 1. (native attribute: mHingeAxis1)- Parameters:
axis
- the desired direction vector (default=(1,0,0))
-
setHingeAxis2
Alter the hinge axis for body 2. (native attribute: mHingeAxis2)- Parameters:
axis
- the desired direction vector (default=(1,0,0))
-
setRatio
public void setRatio(float ratio) Alter the gear ratio.- Parameters:
ratio
- the desired ratio (default=1)
-
setRatio
public void setRatio(int numTeeth1, int numTeeth2) Alter the gear ratio.- Parameters:
numTeeth1
- the number of teeth in the body 1 gearnumTeeth2
- the number of teeth in the body 2 gear
-
setSpace
Alter which space the other properties are specified in. (native attribute: mSpace)- Parameters:
space
- enum value (not null, default=WorldSpace)
-