Vehicle Actors

Vehicle physics actors with wheel simulation. Create with CreateVehicleActor().


Function AddVehicleWheel(actor, wheel_actor, is_front_wheel)

Add a wheel to a vehicle actor

is_front_wheel sets whether it should be considered a front wheel for physics and control

NOTE: Once an actor is set as a wheel, the vehicle controls all transforms for the actor


Function GetVehicleAxis(actor, ByRef x, ByRef y, ByRef z)

Gets the axis used to define a vehicles orientation.

Direction

Axis

Meaning

X

Right Axis

Wheel axle direction

Y

Up Axis

Suspension direction

Z

Forward Axis

Driving direction


Sub GetVehicleForwardVector(actor, ByRef x, ByRef y, ByRef z)

Gets the forward vector of a vehicle.


Function GetVehicleCurrentSpeed(actor)

Returns the current speed set on the vehicle.


Function GetWheelCount(actor)

Returns the number of wheels on a vehicle.


Sub GetVehicleChassisWorldTransform(actor, t_matrix)

Stores the world transform of the chassis actor in a vehicle.


Function GetWheelSteeringValue(actor, wheel)

Returns the steering value for a wheel.


Sub GetWheelWorldTransform(actor, wheel, t_matrix)

Returns the world transform of a wheel on a vehicle.

NOTE: This will not be the world tranform of the actor if an offset transform has been set. In that case you will need to multiply the offset by the world transform.


Sub GetWheelConnectionPoint(actor, wheel, ByRef x, ByRef y, ByRef z)

Gets the point in local space that a wheel is connected to a vehicle at.


Sub GetWheelDirection(actor, wheel ByRef x, ByRef y, ByRef z)

Gets the direction of a wheel on a vehicle.


Sub GetWheelAxel(actor, wheel, ByRef x, ByRef y, ByRef z)

Get the axel direction of a wheel on a vehiclet.

See also

SetWheelAxel()


Function GetWheelSuspensionLength(actor, wheel)

Returns the suspsension rest length of a wheel.


Function GetWheelMaxSuspensionTravel(actor, wheel)

Returns the max suspension travel distance.

This value is the maximum distance the suspension is allowed to extend or compress from its rest length set with SetSuspensionLength().


Function GetWheelRadius(actor, wheel)

You will never guess what this returns.

See also

SetWheelRadius()


Function GetWheelSuspensionStiffness(actor, wheel)

Returns the suspension stiffness of a wheel.

  • Higher stiffness - stronger upward force for the same compression.
  • Lower stiffness - softer suspension.

Function GetWheelDampingCompression(actor, wheel)

Returns the damping compression of a wheel.


Function GetWheelDampingRelaxation(actor, wheel)

Returns the damping relaxation of a wheel.


Function GetWheelFrictionSlip(actor, wheel)

Returns the friction slip of a wheel.


Function GetWheelRotation(actor, wheel)

Returns a wheel's spin rotation.


Function GetWheelRotationDelta(actor, wheel)

Returns how much the wheels spin angle changed since the last frame.


Function GetWheelRollInfluence(actor, wheel)

Returns the roll_influence for a wheel.

Roll influence controls how much a wheel’s suspension force contributes to the vehicle’s body roll (sideways tipping).

It’s essentially a stability scaling factor.


Function GetWheelEngineForce(actor, wheel)

Returns the engine force currently applied to a wheel.


Function GetWheelBrake(actor, wheel)

Returns the brake value of a wheel on a vehicle.

See also

SetWheelBrake()


Function WheelIsFront(actor, wheel)

Returns TRUE if a wheel is set as a front wheel.


Function GetWheelInverseContactSuspension(actor, wheel)

Returns the clipped inverse contact dot suspension.

This value is a stability factor used to adjust suspension force when the ground contact surface is tilted.

It prevents suspension forces from exploding when the wheel contacts steep surfaces.


Function GetWheelSuspensionVelocity(actor, wheel)

Returns the suspension velocity.

This value is the speed that the suspension compresses or extends at.


Sub ResetVehicleSuspension(actor)

Sets the suspension of a vehicle back to its base length.


Sub SetWheelSteeringValue(actor, wheel, steering)

Sets the steering value for a wheel.


Sub ApplyWheelEngineForce(actor, wheel, force)

Apply force to a wheel.

NOTE: For movement, you can apply force to a vehicle the same way you apply it to any actor. Refer to the actor physics section for documentation on that.


Sub SetWheelBrake(actor, wheel, brake)

Sets the brake value for a wheel.

See also

GetWheelBrake()


Sub SetVehiclePitchControl(actor, brake)

Sets a vehicles pitch control.

Pitch control is a tuning parameter that adds an extra torque to the chassis based on engine force to control how much the vehicle tilts forward or backward under acceleration and braking.


Sub SetWheelConnectionPoint(actor, wheel, x, y, z)

Sets the point in local space where the wheel connects to the chassis.


Sub SetWheelDirection(actor, wheel, x, y, z)

Sets a wheel's direction.

This direction is the direction the suspension of the wheel extends to and not the direction the wheel rolls. Basically, if the suspension is pointing straight down then the direction would be (0, -1, 0).


Sub SetWheelAxel(actor, wheel, x, y, z)

Sets the wheel axel direction.

The axel is the axis the wheel rotates around.

See also

GetWheelAxel()


Sub SetWheelSuspensionLength(actor, wheel, s_length)

Sets the suspsension rest length of a wheel.


Sub SetWheelMaxSuspensionTravel(actor, wheel, max_travel)

Sets the max suspension travel distance.

This value is the maximum distance the suspension is allowed to extend or compress from its rest length set with SetSuspensionLength().


Sub SetWheelRadius(actor, wheel, radius)

Sets the radius of a wheel.

See also

GetWheelRadius()


Sub SetWheelSuspensionStiffness(actor, wheel, stiffness)

Sets the suspension stiffness of a wheel.


Sub SetWheelDampingCompression(actor, wheel, dcomp_value)

Sets a wheels damping compression.


Sub SetWheelDampingRelaxation(actor, wheel, drel_value)

Sets a wheels damping relaxation.


Sub SetWheelFrictionSlip(actor, wheel, fslip_value)

Sets the friction slip value for a wheel.

This value determines how much grip a wheel has before it starts sliding

  • Lower value - more slippery.
  • Higher value - more firm grip.

Sub SetWheelRotation(actor, wheel, rot)

Sets a wheel's spin rotation.


Sub SetWheelRollInfluence(actor, wheel, roll_influence)

Sets the roll_influence for a wheel.

Roll influence controls how much a wheel’s suspension force contributes to the vehicle’s body roll (sideways tipping).

It’s essentially a stability scaling factor.


Sub SetWheelInverseContactSuspension(actor, wheel, c_value)

Sets the clipped inverse contact dot suspension.

This value is a stability factor used to adjust suspension force when the ground contact surface is tilted.

It prevents suspension forces from exploding when the wheel contacts steep surfaces.


Sub SetWheelSuspensionVelocity(actor, wheel, velocity)

Sets the suspension velocity.

This value is the speed that the suspension compresses or extends at.


Sub SetWheelActorOffsetTransform(actor, wheel, t_matrix)

Sets an local offset transform for the wheel actor. This is mainly for when the actors local transform does not line up with the axis for the vehicle.

Refer to the Vehicle demo to see an example of this.


Sub GetWheelActorOffsetTransform(actor, wheel, t_matrix)

Stores the local offset transform for the wheel actor in t_matrix.

This is mainly for when the actors local transform does not line up with the axis for the vehicle.

Refer to the Vehicle demo to see an example of this.


Function GetVehiclePitchControl(actor)

Returns the pitch control for a vehicle.