reckfellENGINE

VehicleWheel3D

A 3D physics body for a VehicleBody3D that simulates the behavior of a wheel.

On this page
class VehicleWheel3DReckfellSharpInherits Entity3D

A 3D physics body for a VehicleBody3D that simulates the behavior of a wheel.

A node used as a child of a VehicleBody3D parent to simulate the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. Note: This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you may need to write your own physics integration using another PhysicsBody3D class.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

VehicleWheel3DConstructor
# VehicleWheel3D
C#
public VehicleWheel3D();

Properties14

BrakeProperty
# Brake
C#
public float Brake { get; set; }

Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the RigidBody3D.Mass of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking.

DampingCompressionProperty
# DampingCompression
C#
public float DampingCompression { get; set; }

The damping applied to the suspension spring when being compressed, meaning when the wheel is moving up relative to the vehicle. It is measured in Newton-seconds per millimeter (N⋅s/mm), or megagrams per second (Mg/s). This value should be between 0.0 (no damping) and 1.0, but may be more. 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.

DampingRelaxationProperty
# DampingRelaxation
C#
public float DampingRelaxation { get; set; }

The damping applied to the suspension spring when rebounding or extending, meaning when the wheel is moving down relative to the vehicle. It is measured in Newton-seconds per millimeter (N⋅s/mm), or megagrams per second (Mg/s). This value should be between 0.0 (no damping) and 1.0, but may be more. This value should always be slightly higher than the VehicleWheel3D.DampingCompression property. For a VehicleWheel3D.DampingCompression value of 0.3, try a relaxation value of 0.5.

EngineForceProperty
# EngineForce
C#
public float EngineForce { get; set; }

Accelerates the wheel by applying an engine force. The wheel is only sped up if it is in contact with a surface. The RigidBody3D.Mass of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. Note: The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the wheel reversing.

SteeringProperty
# Steering
C#
public float Steering { get; set; }

The steering angle for the wheel, in radians. Setting this to a non-zero value will result in the vehicle turning when it's moving.

SuspensionMaxForceProperty
# SuspensionMaxForce
C#
public float SuspensionMaxForce { get; set; }

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

SuspensionStiffnessProperty
# SuspensionStiffness
C#
public float SuspensionStiffness { get; set; }

The stiffness of the suspension, measured in Newtons per millimeter (N/mm), or megagrams per second squared (Mg/s²). 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.

SuspensionTravelProperty
# SuspensionTravel
C#
public float SuspensionTravel { get; set; }

This is the distance the suspension can travel. As Reckfell units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car.

UseAsSteeringProperty
# UseAsSteering
C#
public bool UseAsSteering { get; set; }

If true, this wheel will be turned when the car steers. This value is used in conjunction with VehicleBody3D.Steering and ignored if you are using the per-wheel VehicleWheel3D.Steering value instead.

UseAsTractionProperty
# UseAsTraction
C#
public bool UseAsTraction { get; set; }

If true, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with VehicleBody3D.EngineForce and ignored if you are using the per-wheel VehicleWheel3D.EngineForce value instead.

WheelFrictionSlipProperty
# WheelFrictionSlip
C#
public float WheelFrictionSlip { get; set; }

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.

WheelRadiusProperty
# WheelRadius
C#
public float WheelRadius { get; set; }

The radius of the wheel in meters.

WheelRestLengthProperty
# WheelRestLength
C#
public float WheelRestLength { get; set; }

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 Reckfell) 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.

WheelRollInfluenceProperty
# WheelRollInfluence
C#
public float WheelRollInfluence { get; set; }

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

Methods34

GetBrakefloat
# GetBrake
C#
public float GetBrake();
Returns float
GetContactBodyEntity3D
# GetContactBody
C#
public Entity3D GetContactBody();

Returns the contacting body node if valid in the tree, as Entity3D. At the moment, GridMap is not supported so the node will be always of type PhysicsBody3D. Returns null if the wheel is not in contact with a surface, or the contact body is not a PhysicsBody3D.

Returns Entity3D
GetContactNormalVector3
# GetContactNormal
C#
public Vector3 GetContactNormal();

Returns the normal of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns a vector pointing directly along the suspension axis toward the vehicle in world space.

Returns Vector3
GetContactPointVector3
# GetContactPoint
C#
public Vector3 GetContactPoint();

Returns the point of the suspension's collision in world space if the wheel is in contact. If the wheel isn't in contact with anything, returns the maximum point of the wheel's ray cast in world space, which is defined by wheel_rest_length + wheel_radius.

Returns Vector3
GetDampingCompressionfloat
# GetDampingCompression
C#
public float GetDampingCompression();
Returns float
GetDampingRelaxationfloat
# GetDampingRelaxation
C#
public float GetDampingRelaxation();
Returns float
GetEngineForcefloat
# GetEngineForce
C#
public float GetEngineForce();
Returns float
GetFrictionSlipfloat
# GetFrictionSlip
C#
public float GetFrictionSlip();
Returns float
GetRadiusfloat
# GetRadius
C#
public float GetRadius();
Returns float
GetRollInfluencefloat
# GetRollInfluence
C#
public float GetRollInfluence();
Returns float
GetRpmfloat
# GetRpm
C#
public float GetRpm();

Returns the rotational speed of the wheel in revolutions per minute.

Returns float
GetSkidinfofloat
# GetSkidinfo
C#
public float GetSkidinfo();

Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road).

Returns float
GetSteeringfloat
# GetSteering
C#
public float GetSteering();
Returns float
GetSuspensionMaxForcefloat
# GetSuspensionMaxForce
C#
public float GetSuspensionMaxForce();
Returns float
GetSuspensionRestLengthfloat
# GetSuspensionRestLength
C#
public float GetSuspensionRestLength();
Returns float
GetSuspensionStiffnessfloat
# GetSuspensionStiffness
C#
public float GetSuspensionStiffness();
Returns float
GetSuspensionTravelfloat
# GetSuspensionTravel
C#
public float GetSuspensionTravel();
Returns float
IsInContactbool
# IsInContact
C#
public bool IsInContact();

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

Returns bool
IsUsedAsSteeringbool
# IsUsedAsSteering
C#
public bool IsUsedAsSteering();
Returns bool
IsUsedAsTractionbool
# IsUsedAsTraction
C#
public bool IsUsedAsTraction();
Returns bool
SetBrakevoid
# SetBrake
C#
public void SetBrake(float brake);
Parameters
NameTypeDefault
brakefloat—
SetDampingCompressionvoid
# SetDampingCompression
C#
public void SetDampingCompression(float length);
Parameters
NameTypeDefault
lengthfloat—
SetDampingRelaxationvoid
# SetDampingRelaxation
C#
public void SetDampingRelaxation(float length);
Parameters
NameTypeDefault
lengthfloat—
SetEngineForcevoid
# SetEngineForce
C#
public void SetEngineForce(float engineForce);
Parameters
NameTypeDefault
engineForcefloat—
SetFrictionSlipvoid
# SetFrictionSlip
C#
public void SetFrictionSlip(float length);
Parameters
NameTypeDefault
lengthfloat—
SetRadiusvoid
# SetRadius
C#
public void SetRadius(float length);
Parameters
NameTypeDefault
lengthfloat—
SetRollInfluencevoid
# SetRollInfluence
C#
public void SetRollInfluence(float rollInfluence);
Parameters
NameTypeDefault
rollInfluencefloat—
SetSteeringvoid
# SetSteering
C#
public void SetSteering(float steering);
Parameters
NameTypeDefault
steeringfloat—
SetSuspensionMaxForcevoid
# SetSuspensionMaxForce
C#
public void SetSuspensionMaxForce(float length);
Parameters
NameTypeDefault
lengthfloat—
SetSuspensionRestLengthvoid
# SetSuspensionRestLength
C#
public void SetSuspensionRestLength(float length);
Parameters
NameTypeDefault
lengthfloat—
SetSuspensionStiffnessvoid
# SetSuspensionStiffness
C#
public void SetSuspensionStiffness(float length);
Parameters
NameTypeDefault
lengthfloat—
SetSuspensionTravelvoid
# SetSuspensionTravel
C#
public void SetSuspensionTravel(float length);
Parameters
NameTypeDefault
lengthfloat—
SetUseAsSteeringvoid
# SetUseAsSteering
C#
public void SetUseAsSteering(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseAsTractionvoid
# SetUseAsTraction
C#
public void SetUseAsTraction(bool enable);
Parameters
NameTypeDefault
enablebool—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.