public class Suspension
extends java.lang.Object
If you use this class, you should avoid directly invoking certain physics setters, notably:
| Constructor and Description |
|---|
Suspension(com.jme3.bullet.objects.VehicleWheel vehicleWheel)
Instantiate a suspension with reasonable parameter settings.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getCompressDamping()
Determine the damping for compression.
|
float |
getMaxForce()
Determine the maximum force exerted by this suspension.
|
float |
getRelaxDamping()
Determine the damping for relaxation.
|
float |
getRestLength()
Determine the rest length of this suspension.
|
float |
getStiffness()
Determine the stiffness of this suspension.
|
void |
setCompressDamping(float dampingRatio)
Alter the damping for compression.
|
void |
setMaxForce(float maxForce)
Alter the maximum force exerted by this suspension.
|
void |
setMaxTravelCm(float travelCm)
Alter the maximum travel distance.
|
void |
setRelaxDamping(float dampingRatio)
Alter the damping for relaxation.
|
void |
setRestLength(float restLength)
Alter the length of this suspension.
|
void |
setStiffness(float stiffness)
Alter the stiffness of this suspension.
|
public Suspension(com.jme3.bullet.objects.VehicleWheel vehicleWheel)
vehicleWheel - the physics object to manage (not null, alias
created)public float getCompressDamping()
public float getMaxForce()
public float getRelaxDamping()
public float getRestLength()
public float getStiffness()
public void setCompressDamping(float dampingRatio)
dampingRatio - the desired damping ratio (0=undamped, 1=critically
damped, default=0.2)public void setMaxForce(float maxForce)
Increase this if the suspension cannot handle the weight of your vehicle.
maxForce - the desired maximum force (default=10_000)public void setMaxTravelCm(float travelCm)
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)public void setRelaxDamping(float dampingRatio)
dampingRatio - the desired damping ratio (0=undamped, 1=critically
damped, default=0.3)public void setRestLength(float restLength)
restLength - the desired length (in physics-space units)public void setStiffness(float stiffness)
stiffness - the desired stiffness constant (10→off-road buggy,
50→sports car, 200→Formula-1 race car, default=25)