public class RaycastVehicle extends TypedConstraint
| Modifier and Type | Field and Description |
|---|---|
ObjectArrayList<WheelInfo> |
wheelInfo |
| Constructor and Description |
|---|
RaycastVehicle(VehicleTuning tuning,
RigidBody chassis,
VehicleRaycaster raycaster) |
| Modifier and Type | Method and Description |
|---|---|
WheelInfo |
addWheel(Vector3f connectionPointCS,
Vector3f wheelDirectionCS0,
Vector3f wheelAxleCS,
float suspensionRestLength,
float wheelRadius,
VehicleTuning tuning,
boolean isFrontWheel)
Basically most of the code is general for 2 or 4 wheel vehicles, but some of it needs to be reviewed.
|
void |
applyEngineForce(float force,
int wheel) |
void |
buildJacobian() |
Transform |
getChassisWorldTransform(Transform out) |
float |
getCurrentSpeedKmHour()
Velocity of vehicle (positive if velocity vector has same direction as foward vector).
|
int |
getForwardAxis() |
Vector3f |
getForwardVector(Vector3f out)
Worldspace forward vector.
|
int |
getNumWheels() |
int |
getRightAxis() |
RigidBody |
getRigidBody() |
float |
getSteeringValue(int wheel) |
int |
getUpAxis() |
WheelInfo |
getWheelInfo(int index) |
Transform |
getWheelTransformWS(int wheelIndex,
Transform out) |
float |
rayCast(WheelInfo wheel) |
void |
resetSuspension() |
void |
setBrake(float brake,
int wheelIndex) |
void |
setCoordinateSystem(int rightIndex,
int upIndex,
int forwardIndex) |
void |
setPitchControl(float pitch) |
void |
setSteeringValue(float steering,
int wheel) |
void |
solveConstraint(float timeStep) |
void |
updateFriction(float timeStep) |
void |
updateSuspension(float deltaTime) |
void |
updateVehicle(float step) |
void |
updateWheelTransform(int wheelIndex) |
void |
updateWheelTransform(int wheelIndex,
boolean interpolatedTransform) |
void |
updateWheelTransformsWS(WheelInfo wheel) |
void |
updateWheelTransformsWS(WheelInfo wheel,
boolean interpolatedTransform) |
getAppliedImpulse, getConstraintType, getRigidBodyA, getRigidBodyB, getUid, getUserConstraintId, getUserConstraintType, setUserConstraintId, setUserConstraintTypepublic ObjectArrayList<WheelInfo> wheelInfo
public RaycastVehicle(VehicleTuning tuning, RigidBody chassis, VehicleRaycaster raycaster)
public WheelInfo addWheel(Vector3f connectionPointCS, Vector3f wheelDirectionCS0, Vector3f wheelAxleCS, float suspensionRestLength, float wheelRadius, VehicleTuning tuning, boolean isFrontWheel)
public void updateWheelTransform(int wheelIndex)
public void updateWheelTransform(int wheelIndex,
boolean interpolatedTransform)
public void resetSuspension()
public void updateWheelTransformsWS(WheelInfo wheel)
public void updateWheelTransformsWS(WheelInfo wheel, boolean interpolatedTransform)
public float rayCast(WheelInfo wheel)
public void updateVehicle(float step)
public void setSteeringValue(float steering,
int wheel)
public float getSteeringValue(int wheel)
public void applyEngineForce(float force,
int wheel)
public WheelInfo getWheelInfo(int index)
public void setBrake(float brake,
int wheelIndex)
public void updateSuspension(float deltaTime)
public void updateFriction(float timeStep)
public void buildJacobian()
buildJacobian in class TypedConstraintpublic void solveConstraint(float timeStep)
solveConstraint in class TypedConstraintpublic int getNumWheels()
public void setPitchControl(float pitch)
public RigidBody getRigidBody()
public int getRightAxis()
public int getUpAxis()
public int getForwardAxis()
public float getCurrentSpeedKmHour()
public void setCoordinateSystem(int rightIndex,
int upIndex,
int forwardIndex)