public class Wheel
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
| Constructor and Description |
|---|
Wheel(Vehicle vehicle,
int wheelIndex,
boolean isSteering,
boolean steeringFlipped,
Suspension suspension,
Brake mainBrake,
Brake parkingBrake,
float extraDamping)
Instantiate a wheel with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
float |
calculateLateralSlipAngle() |
float |
calculateLongitudinalSlipAngle() |
float |
getDiameter() |
float |
getFriction()
Determine the friction between this wheel's tire and the ground.
|
float |
getGrip()
Determine the tire's grip.
|
Brake |
getMainBrake()
Access the main brake for this wheel.
|
float |
getMaxSteerAngle() |
float |
getPowerFraction()
Determine the fraction of the engine's output power transmitted to this
wheel.
|
float |
getRotationDelta() |
float |
getSteeringAngle() |
Suspension |
getSuspension() |
PacejkaTireModel |
getTireModel()
Access the tire model.
|
Vehicle |
getVehicle()
Access the Vehicle that contains this Wheel.
|
com.jme3.bullet.objects.VehicleWheel |
getVehicleWheel()
Access the wheel's physics object.
|
boolean |
isBraking()
Test whether this wheel's brakes are applied.
|
boolean |
isPowered()
Test whether this wheel receives power from the Engine.
|
boolean |
isSteering()
Test whether this wheel is used for steering.
|
boolean |
isSteeringFlipped()
Test whether this wheel turns in the opposite direction relative to the
Vehicle.
|
float |
linearDamping()
Determine how much linear damping this Wheel contributes to its Vehicle.
|
void |
setDiameter(float diameter) |
void |
setFriction(float friction) |
void |
setGrip(float grip)
Alter the tire's grip.
|
void |
setMaxSteerAngle(float maxSteerAngle) |
void |
setPowerFraction(float fraction)
Alter the fraction of the of the engine's output power that gets
transmitted this wheel.
|
void |
setRotationDelta(float rotationDelta) |
void |
setSteering(boolean steering) |
void |
setSteering(boolean steering,
boolean flipped) |
void |
setSteeringFlipped(boolean steeringFlipped) |
void |
setTireModel(PacejkaTireModel tireModel)
Alter the tire model.
|
void |
setTireSmokeColor(com.jme3.math.ColorRGBA color)
Alter the color of smoke produced by the tire.
|
float |
skidFraction()
Determine how much the wheel is skidding.
|
void |
steer(float strength) |
com.jme3.math.ColorRGBA |
tireSmokeColor(com.jme3.math.ColorRGBA storeResult)
Determine the color of smoke produced by the tire.
|
float |
traction()
Determine how much traction this wheel has.
|
void |
updateAccelerate(float force)
Update the drive force applied via this wheel.
|
void |
updateBrakes(float mainStrength,
float parkingStrength)
Update the braking impulse applied to this wheel.
|
public static final java.util.logging.Logger logger
public Wheel(Vehicle vehicle, int wheelIndex, boolean isSteering, boolean steeringFlipped, Suspension suspension, Brake mainBrake, Brake parkingBrake, float extraDamping)
vehicle - the vehicle that will contain this Wheel (not null, alias
created)wheelIndex - the index among the vehicle's wheels (≥0)isSteering - true if used for steering, otherwise falsesteeringFlipped - true for rear-wheel steering, otherwise falsesuspension - the suspension spring (not null, alias created)mainBrake - the main brake (not null, alias created)parkingBrake - the parking brake (not null, alias created)extraDamping - the additional linear damping (≥0, <1)public float calculateLateralSlipAngle()
public float calculateLongitudinalSlipAngle()
public float getDiameter()
public float getFriction()
public float getGrip()
public Brake getMainBrake()
public float getMaxSteerAngle()
public float getPowerFraction()
public float getRotationDelta()
public float getSteeringAngle()
public Suspension getSuspension()
public PacejkaTireModel getTireModel()
public Vehicle getVehicle()
public com.jme3.bullet.objects.VehicleWheel getVehicleWheel()
public boolean isBraking()
public boolean isPowered()
public boolean isSteering()
public boolean isSteeringFlipped()
public float linearDamping()
public void setDiameter(float diameter)
public void setFriction(float friction)
public void setGrip(float grip)
grip - the fraction of the original grip remaining (≥0, ≤1,
default=1)public void setMaxSteerAngle(float maxSteerAngle)
public void setPowerFraction(float fraction)
fraction - the desired power fraction (≥0, ≤1)public void setRotationDelta(float rotationDelta)
public void setSteering(boolean steering)
public void setSteering(boolean steering,
boolean flipped)
public void setSteeringFlipped(boolean steeringFlipped)
public void setTireModel(PacejkaTireModel tireModel)
tireModel - the desired model (alias created)public void setTireSmokeColor(com.jme3.math.ColorRGBA color)
color - the desired color (not null, unaffected)public float skidFraction()
public void steer(float strength)
public com.jme3.math.ColorRGBA tireSmokeColor(com.jme3.math.ColorRGBA storeResult)
storeResult - storage for the result (modified if not null)public float traction()
public void updateAccelerate(float force)
force - the desired drive force (negative if reversing)public void updateBrakes(float mainStrength,
float parkingStrength)
mainStrength - the strength of the main-brake control signal (≥0,
≤1)parkingStrength - the strength of the parking-brake control signal
(≥0, ≤1)