VehicleWheel

Physics object that simulates the behaviour of a wheel.

This node needs to be used as a child node of VehicleBody and simulates the behaviour of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface.

@GodotBaseClass
struct VehicleWheel {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

getDampingCompression
double getDampingCompression()
getDampingRelaxation
double getDampingRelaxation()
getFrictionSlip
double getFrictionSlip()
getRadius
double getRadius()
getRollInfluence
double getRollInfluence()
getSkidinfo
double getSkidinfo()

Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is not skidding, 1.0 means the wheel has lost grip.

getSuspensionMaxForce
double getSuspensionMaxForce()
getSuspensionRestLength
double getSuspensionRestLength()
getSuspensionStiffness
double getSuspensionStiffness()
getSuspensionTravel
double getSuspensionTravel()
isInContact
bool isInContact()

Returns true if this wheel is in contact with a surface.

isUsedAsSteering
bool isUsedAsSteering()
isUsedAsTraction
bool isUsedAsTraction()
opAssign
VehicleWheel opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(VehicleWheel other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setDampingCompression
void setDampingCompression(double length)
setDampingRelaxation
void setDampingRelaxation(double length)
setFrictionSlip
void setFrictionSlip(double length)
setRadius
void setRadius(double length)
setRollInfluence
void setRollInfluence(double roll_influence)
setSuspensionMaxForce
void setSuspensionMaxForce(double length)
setSuspensionRestLength
void setSuspensionRestLength(double length)
setSuspensionStiffness
void setSuspensionStiffness(double length)
setSuspensionTravel
void setSuspensionTravel(double length)
setUseAsSteering
void setUseAsSteering(bool enable)
setUseAsTraction
void setUseAsTraction(bool enable)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

dampingCompression
double dampingCompression [@property setter]

The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car.

dampingCompression
double dampingCompression [@property getter]

The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car.

dampingRelaxation
double dampingRelaxation [@property getter]
double dampingRelaxation [@property setter]

The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the dampingCompression property. For a dampingCompression value of 0.3, try a relaxation value of 0.5

suspensionMaxForce
double suspensionMaxForce [@property getter]
double suspensionMaxForce [@property setter]

The maximum force the spring can resist. This value should be higher than a quarter of the RigidBody.mass of the VehicleBody or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3x to 4x this number.

suspensionStiffness
double suspensionStiffness [@property getter]
double suspensionStiffness [@property setter]

This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car.

suspensionTravel
double suspensionTravel [@property getter]
double suspensionTravel [@property setter]

This is the distance the suspension can travel. As Godot measures are in meters keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car .

useAsSteering
bool useAsSteering [@property getter]
bool useAsSteering [@property setter]

If true this wheel will be turned when the car steers.

useAsTraction
bool useAsTraction [@property getter]
bool useAsTraction [@property setter]

If true this wheel transfers engine force to the ground to propel the vehicle forward.

wheelFrictionSlip
double wheelFrictionSlip [@property getter]
double wheelFrictionSlip [@property setter]

This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear. It's best to set this to 1.0 when starting out.

wheelRadius
double wheelRadius [@property getter]
double wheelRadius [@property setter]

The radius of the wheel in meters.

wheelRestLength
double wheelRestLength [@property getter]
double wheelRestLength [@property setter]

This is the distance in meters the wheel is lowered from its origin point. Don't set this to 0.0 and move the wheel into position, instead move the origin point of your wheel (the gizmo in Godot) to the position the wheel will take when bottoming out, then use the rest length to move the wheel down to the position it should be in when the car is in rest.

wheelRollInfluence
double wheelRollInfluence [@property getter]
double wheelRollInfluence [@property setter]

This value effects the roll of your vehicle. If set to 0.0 for all wheels your vehicle will be prone to rolling over while a value of 1.0 will resist body roll.

Static functions

_new
VehicleWheel _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta