Class VehicleTuning

java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.objects.infos.VehicleTuning
All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class VehicleTuning extends NativePhysicsObject
Tuning parameters for a PhysicsVehicle, based on Bullet's btVehicleTuning.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • VehicleTuning

      public VehicleTuning()
      Instantiate an instance with the default parameter values.
  • Method Details

    • getFrictionSlip

      public float getFrictionSlip()
      Return the friction between tires and ground (native field: m_frictionSlip).
      Returns:
      the coefficient of friction
    • getMaxSuspensionForce

      public float getMaxSuspensionForce()
      Return the maximum force exerted by each wheel's suspension (native field: m_maxSuspensionForce).
      Returns:
      the maximum force
    • getMaxSuspensionTravelCm

      public float getMaxSuspensionTravelCm()
      Determine the maximum travel distance for each wheel's suspension (native field: m_maxSuspensionTravelCm).

      Note that the units are centimeters ONLY if the physics-space unit is exactly one meter.

      Returns:
      the maximum amount the suspension can be compressed or expanded, relative to its rest length (in hundredths of a physics-space unit)
    • getSuspensionCompression

      public float getSuspensionCompression()
      Return the suspension damping when compressed (native field: m_suspensionCompression).
      Returns:
      the damping amount
    • getSuspensionDamping

      public float getSuspensionDamping()
      Return the suspension damping when expanded (native field: m_suspensionDamping).
      Returns:
      the damping amount (0→no damping, default=0.88)
    • getSuspensionStiffness

      public float getSuspensionStiffness()
      Return the suspension stiffness (native field: m_suspensionStiffness).
      Returns:
      the stiffness constant
    • setFrictionSlip

      public void setFrictionSlip(float coeff)
      Alter the friction between tires and ground (native field: m_frictionSlip).
      Parameters:
      coeff - the desired coefficient of friction (0.8→realistic car, 10000→kart racer, default=10.5)
    • setMaxSuspensionForce

      public void setMaxSuspensionForce(float maxForce)
      Alter the force exerted by each wheel's suspension (native field: m_maxSuspensionForce).
      Parameters:
      maxForce - the desired maximum force (default=6000)
    • setMaxSuspensionTravelCm

      public void setMaxSuspensionTravelCm(float travelCm)
      Alter the maximum travel distance for the suspension (native field: m_maxSuspensionTravelCm). Note that the units are centimeters ONLY if the physics-space unit is exactly one meter.
      Parameters:
      travelCm - the desired maximum amount the suspension can be compressed or expanded, relative to its rest length (in hundredths of a physics-space unit, default=500)
    • setSuspensionCompression

      public void setSuspensionCompression(float damping)
      Alter the suspension damping when compressed (native field: m_suspensionCompression).
      Parameters:
      damping - the desired damping amount (0→no damping, default=0.83)
    • setSuspensionDamping

      public void setSuspensionDamping(float damping)
      Alter the suspension damping when expanded (native field: m_suspensionDamping).
      Parameters:
      damping - the desired damping (0→no damping, default=0.88)
    • setSuspensionStiffness

      public void setSuspensionStiffness(float stiffness)
      Alter the stiffness of the suspension (native field: m_suspensionStiffness).
      Parameters:
      stiffness - the desired stiffness constant (10→off-road buggy, 50→sports car, 200→Formula-1 race car, default=5.88)