Class MotorcycleControllerSettings

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstMotorcycleControllerSettings, ConstSerializableObject, ConstVehicleControllerSettings, ConstWheeledVehicleControllerSettings, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>

public class MotorcycleControllerSettings extends WheeledVehicleControllerSettings implements ConstMotorcycleControllerSettings
Settings used to construct a MotorcycleController.
  • Constructor Details

    • MotorcycleControllerSettings

      public MotorcycleControllerSettings()
      Instantiate default settings.
    • MotorcycleControllerSettings

      public MotorcycleControllerSettings(ConstMotorcycleControllerSettings original)
      Instantiate a copy of the specified settings.
      Parameters:
      original - the settings to copy (not null, unaffected)
  • Method Details

    • set

      public void set(ConstMotorcycleControllerSettings source)
      Copy the argument to the current settings.
      Parameters:
      source - the settings to copy (not null, unaffected)
    • setLeanSmoothingFactor

      public void setLeanSmoothingFactor(float factor)
      Alter the lean smoothing factor. (native attribute: mLeanSmoothingFactor)
      Parameters:
      factor - the desired factor (default=0.8)
    • setLeanSpringConstant

      public void setLeanSpringConstant(float k)
      Alter the spring constant for the lean spring. (native attribute: mLeanSpringConstant)
      Parameters:
      k - the desired spring constant (default=5000)
    • setLeanSpringDamping

      public void setLeanSpringDamping(float damping)
      Alter the damping constant for the lean spring. (native attribute: mLeanSpringDamping)
      Parameters:
      damping - the desired damping constant (default=1000)
    • setLeanSpringIntegrationCoefficient

      public void setLeanSpringIntegrationCoefficient(float coefficient)
      Alter the coefficient of additional force to control the lean angle. (native attribute: mLeanSpringIntegrationCoefficient)
      Parameters:
      coefficient - the desired integration coefficient (default=0)
    • setLeanSpringIntegrationCoefficientDecay

      public void setLeanSpringIntegrationCoefficientDecay(float decay)
      Alter the rate of decay of the angle integral when the wheels are unsupported. (native attribute: mLeanSpringIntegrationCoefficientDecay)
      Parameters:
      decay - the desired rate of decay (per second, default=4)
    • setMaxLeanAngle

      public void setMaxLeanAngle(float angle)
      Alter the maximum lean angle (during turns). (native attribute: mMaxLeanAngle)
      Parameters:
      angle - the desired angle (in radians, default=Pi/4)
    • getLeanSmoothingFactor

      public float getLeanSmoothingFactor()
      Return the lean smoothing factor. The settings are unaffected. (native attribute: mLeanSmoothingFactor)
      Specified by:
      getLeanSmoothingFactor in interface ConstMotorcycleControllerSettings
      Returns:
      the factor
    • getLeanSpringConstant

      public float getLeanSpringConstant()
      Return the spring constant for the lean spring. The settings are unaffected. (native attribute: mLeanSpringConstant)
      Specified by:
      getLeanSpringConstant in interface ConstMotorcycleControllerSettings
      Returns:
      the spring constant
    • getLeanSpringDamping

      public float getLeanSpringDamping()
      Return the damping constant for the lean spring. The settings are unaffected. (native attribute: mLeanSpringDamping)
      Specified by:
      getLeanSpringDamping in interface ConstMotorcycleControllerSettings
      Returns:
      the damping constant
    • getLeanSpringIntegrationCoefficient

      public float getLeanSpringIntegrationCoefficient()
      Return the coefficient of additional force to control the lean angle. The settings are unaffected. (native attribute: mLeanSpringIntegrationCoefficient)
      Specified by:
      getLeanSpringIntegrationCoefficient in interface ConstMotorcycleControllerSettings
      Returns:
      the integration coefficient
    • getLeanSpringIntegrationCoefficientDecay

      public float getLeanSpringIntegrationCoefficientDecay()
      Return the rate of decay of the angle integral when the wheels are unsupported. The settings are unaffected. (native attribute: mLeanSpringIntegrationCoefficientDecay)
      Specified by:
      getLeanSpringIntegrationCoefficientDecay in interface ConstMotorcycleControllerSettings
      Returns:
      the rate of decay (per second)
    • getMaxLeanAngle

      public float getMaxLeanAngle()
      Return the maximum lean angle (during turns). The settings are unaffected. (native attribute: mMaxLeanAngle)
      Specified by:
      getMaxLeanAngle in interface ConstMotorcycleControllerSettings
      Returns:
      the angle (in radians)