public class VehicleWheel
extends java.lang.Object
implements com.jme3.export.Savable
| Modifier and Type | Field and Description |
|---|---|
protected com.jme3.math.Vector3f |
axle |
protected com.jme3.math.Vector3f |
direction |
protected float |
frictionSlip |
protected boolean |
frontWheel |
protected com.jme3.math.Vector3f |
location |
protected float |
maxSuspensionForce |
protected float |
maxSuspensionTravelCm |
protected float |
radius |
protected float |
restLength |
protected float |
rollInfluence |
protected float |
suspensionStiffness |
protected com.jme3.math.Quaternion |
tmp_inverseWorldRotation |
protected com.jme3.math.Matrix3f |
tmp_Matrix |
protected com.bulletphysics.dynamics.vehicle.WheelInfo |
wheelInfo |
protected float |
wheelsDampingCompression |
protected float |
wheelsDampingRelaxation |
protected com.jme3.scene.Spatial |
wheelSpatial |
protected com.jme3.math.Vector3f |
wheelWorldLocation |
protected com.jme3.math.Quaternion |
wheelWorldRotation |
| Modifier | Constructor and Description |
|---|---|
protected |
VehicleWheel() |
|
VehicleWheel(com.jme3.scene.Spatial spat,
com.jme3.math.Vector3f location,
com.jme3.math.Vector3f direction,
com.jme3.math.Vector3f axle,
float restLength,
float radius,
boolean frontWheel) |
|
VehicleWheel(com.jme3.math.Vector3f location,
com.jme3.math.Vector3f direction,
com.jme3.math.Vector3f axle,
float restLength,
float radius,
boolean frontWheel) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyWheelTransform() |
com.jme3.math.Vector3f |
getAxle() |
com.jme3.math.Vector3f |
getCollisionLocation()
returns the location where the wheel collides with the ground (world space)
|
com.jme3.math.Vector3f |
getCollisionLocation(com.jme3.math.Vector3f vec)
returns the location where the wheel collides with the ground (world space)
|
com.jme3.math.Vector3f |
getCollisionNormal()
returns the normal where the wheel collides with the ground (world space)
|
com.jme3.math.Vector3f |
getCollisionNormal(com.jme3.math.Vector3f vec)
returns the normal where the wheel collides with the ground (world space)
|
float |
getDeltaRotation()
returns how many degrees the wheel has turned since the last physics
step.
|
com.jme3.math.Vector3f |
getDirection() |
float |
getFrictionSlip() |
PhysicsCollisionObject |
getGroundObject()
returns the object this wheel is in contact with or null if no contact
|
com.jme3.math.Vector3f |
getLocation() |
float |
getMaxSuspensionForce() |
float |
getMaxSuspensionTravelCm() |
float |
getRadius() |
float |
getRestLength() |
float |
getRollInfluence() |
float |
getSkidInfo()
returns how much the wheel skids on the ground (for skid sounds/smoke etc.)
0.0 = wheels are sliding, 1.0 = wheels have traction. |
float |
getSuspensionStiffness() |
com.bulletphysics.dynamics.vehicle.WheelInfo |
getWheelInfo() |
float |
getWheelsDampingCompression() |
float |
getWheelsDampingRelaxation() |
com.jme3.scene.Spatial |
getWheelSpatial() |
void |
getWheelWorldLocation(com.jme3.math.Vector3f store)
write the content of the wheelWorldLocation into the store
|
void |
getWheelWorldRotation(com.jme3.math.Quaternion store)
write the content of the wheelWorldRotation into the store
|
boolean |
isApplyLocal() |
boolean |
isFrontWheel() |
void |
read(com.jme3.export.JmeImporter im) |
void |
setApplyLocal(boolean applyLocal) |
void |
setFrictionSlip(float frictionSlip)
the coefficient of friction between the tyre and the ground.
|
void |
setFrontWheel(boolean frontWheel) |
void |
setMaxSuspensionForce(float maxSuspensionForce)
The maximum suspension force, raise this above the default 6000 if your suspension cannot
handle the weight of your vehicle.
|
void |
setMaxSuspensionTravelCm(float maxSuspensionTravelCm)
the maximum distance the suspension can be compressed (centimetres)
|
void |
setRadius(float radius) |
void |
setRestLength(float restLength) |
void |
setRollInfluence(float rollInfluence)
reduces the rolling torque applied from the wheels that cause the vehicle to roll over.
|
void |
setSuspensionStiffness(float suspensionStiffness)
the stiffness constant for the suspension.
|
void |
setWheelInfo(com.bulletphysics.dynamics.vehicle.WheelInfo wheelInfo) |
void |
setWheelsDampingCompression(float wheelsDampingCompression)
the damping coefficient for when the suspension is compressed.
|
void |
setWheelsDampingRelaxation(float wheelsDampingRelaxation)
the damping coefficient for when the suspension is expanding.
|
void |
setWheelSpatial(com.jme3.scene.Spatial wheelSpatial) |
void |
updatePhysicsState() |
void |
write(com.jme3.export.JmeExporter ex) |
protected com.bulletphysics.dynamics.vehicle.WheelInfo wheelInfo
protected boolean frontWheel
protected com.jme3.math.Vector3f location
protected com.jme3.math.Vector3f direction
protected com.jme3.math.Vector3f axle
protected float suspensionStiffness
protected float wheelsDampingRelaxation
protected float wheelsDampingCompression
protected float frictionSlip
protected float rollInfluence
protected float maxSuspensionTravelCm
protected float maxSuspensionForce
protected float radius
protected float restLength
protected com.jme3.math.Vector3f wheelWorldLocation
protected com.jme3.math.Quaternion wheelWorldRotation
protected com.jme3.scene.Spatial wheelSpatial
protected com.jme3.math.Matrix3f tmp_Matrix
protected final com.jme3.math.Quaternion tmp_inverseWorldRotation
protected VehicleWheel()
public VehicleWheel(com.jme3.scene.Spatial spat,
com.jme3.math.Vector3f location,
com.jme3.math.Vector3f direction,
com.jme3.math.Vector3f axle,
float restLength,
float radius,
boolean frontWheel)
public VehicleWheel(com.jme3.math.Vector3f location,
com.jme3.math.Vector3f direction,
com.jme3.math.Vector3f axle,
float restLength,
float radius,
boolean frontWheel)
public void updatePhysicsState()
public void applyWheelTransform()
public com.bulletphysics.dynamics.vehicle.WheelInfo getWheelInfo()
public void setWheelInfo(com.bulletphysics.dynamics.vehicle.WheelInfo wheelInfo)
public boolean isFrontWheel()
public void setFrontWheel(boolean frontWheel)
public com.jme3.math.Vector3f getLocation()
public com.jme3.math.Vector3f getDirection()
public com.jme3.math.Vector3f getAxle()
public float getSuspensionStiffness()
public void setSuspensionStiffness(float suspensionStiffness)
suspensionStiffness - the desired stiffness coefficient
(10→off-road buggy, 50→sports car, 200→Formula-1 race car,
default=20)public float getWheelsDampingRelaxation()
public void setWheelsDampingRelaxation(float wheelsDampingRelaxation)
wheelsDampingRelaxation - the desired damping coefficient
(default=2.3)public float getWheelsDampingCompression()
public void setWheelsDampingCompression(float wheelsDampingCompression)
wheelsDampingCompression - the desired damping coefficient
(default=4.4)public float getFrictionSlip()
public void setFrictionSlip(float frictionSlip)
frictionSlip - the desired coefficient of friction between tyre and
ground (0.8→realistic car, 10000→kart racer, default=10.5)public float getRollInfluence()
public void setRollInfluence(float rollInfluence)
rollInfluence - the rollInfluence to setpublic float getMaxSuspensionTravelCm()
public void setMaxSuspensionTravelCm(float maxSuspensionTravelCm)
maxSuspensionTravelCm - 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 float getMaxSuspensionForce()
public void setMaxSuspensionForce(float maxSuspensionForce)
maxSuspensionForce - the desired maximum force per wheel
(default=6000)public float getRadius()
public void setRadius(float radius)
public float getRestLength()
public void setRestLength(float restLength)
public PhysicsCollisionObject getGroundObject()
public com.jme3.math.Vector3f getCollisionLocation(com.jme3.math.Vector3f vec)
vec - storage for the result (not null, modified)public com.jme3.math.Vector3f getCollisionLocation()
public com.jme3.math.Vector3f getCollisionNormal(com.jme3.math.Vector3f vec)
vec - storage for the result (not null, modified)public com.jme3.math.Vector3f getCollisionNormal()
public float getSkidInfo()
public float getDeltaRotation()
public void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savablejava.io.IOExceptionpublic void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablejava.io.IOExceptionpublic com.jme3.scene.Spatial getWheelSpatial()
public void setWheelSpatial(com.jme3.scene.Spatial wheelSpatial)
wheelSpatial - the wheelSpatial to setpublic boolean isApplyLocal()
public void setApplyLocal(boolean applyLocal)
public void getWheelWorldRotation(com.jme3.math.Quaternion store)
store - storage for the result (not null, modified)public void getWheelWorldLocation(com.jme3.math.Vector3f store)
store - storage for the result (not null, modified)