Package com.github.stephengold.joltjni
Class VehicleAntiRollBar
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleAntiRollBar
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A spring that connects two wheels and reduces a vehicle's rolling motion.
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the index of the left wheel.int
Return the index of the right wheel.float
Return the stiffness of the bar.void
setLeftWheel
(int wheelIndex) Alter the index of the left wheel.void
setRightWheel
(int wheelIndex) Alter the index of the right wheel.void
setStiffness
(float stiffness) Alter the stiffness of the bar.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
getLeftWheel
public int getLeftWheel()Return the index of the left wheel. The bar is unaffected. (native attribute: mLeftWheel)- Returns:
- the index of the wheel
-
getRightWheel
public int getRightWheel()Return the index of the right wheel. The bar is unaffected. (native attribute: mRightWheel)- Returns:
- the index of the wheel
-
getStiffness
public float getStiffness()Return the stiffness of the bar. The bar is unaffected. (native attribute: mStiffness)- Returns:
- the spring constant (in Newtons per meter)
-
setLeftWheel
public void setLeftWheel(int wheelIndex) Alter the index of the left wheel. (native attribute: mLeftWheel)- Parameters:
wheelIndex
- the index of the desired wheel (default=0)
-
setRightWheel
public void setRightWheel(int wheelIndex) Alter the index of the right wheel. (native attribute: mRightWheel)- Parameters:
wheelIndex
- the index of the desired wheel (default=1)
-
setStiffness
public void setStiffness(float stiffness) Alter the stiffness of the bar. (native attribute: mStiffness)- Parameters:
stiffness
- the desired spring constant (in Newtons per meter, default=1000)
-