Class VehicleAntiRollBar

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.VehicleAntiRollBar
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class VehicleAntiRollBar extends JoltPhysicsObject
A spring that connects two wheels and reduces a vehicle's rolling motion.
  • 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)