Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Component::WheelSettings Struct Reference

Settings for an individual wheel in a vehicle. More...

#include <WheelSettings.hpp>

Static Public Member Functions

static WheelSettings CreateFrontWheel ()
 Create default front wheel settings with steering.
static WheelSettings CreateRearWheel ()
 Create default rear wheel settings without steering.

Public Attributes

float radius = 0.3f
 Wheel radius in meters.
float width = 0.1f
 Wheel width in meters (for cylinder collider).
float suspensionMaxLength = 0.3f
 Maximum suspension extension length in meters.
float suspensionMinLength = 0.0f
 Minimum suspension compression length in meters (usually 0).
float suspensionFrequency = 1.5f
float suspensionDamping = 0.5f
float maxSteerAngle = 0.0f
 Maximum steering angle in radians (0 for non-steered wheels).
float inertia = 0.9f
float angularDamping = 0.2f
std::vector< FrictionCurvePointlongitudinalFriction
std::vector< FrictionCurvePointlateralFriction
float maxBrakeTorque = 1500.0f
 Maximum brake torque (Nm) that can be applied to this wheel.
float maxHandBrakeTorque = 4000.0f
 Maximum handbrake torque (Nm) - usually only applied to rear wheels.

Detailed Description

Settings for an individual wheel in a vehicle.

Defines physical properties of a single wheel including suspension, dimensions, and friction characteristics.

Member Function Documentation

◆ CreateFrontWheel()

WheelSettings Physics::Component::WheelSettings::CreateFrontWheel ( )
inlinestatic

Create default front wheel settings with steering.

◆ CreateRearWheel()

WheelSettings Physics::Component::WheelSettings::CreateRearWheel ( )
inlinestatic

Create default rear wheel settings without steering.

Member Data Documentation

◆ angularDamping

float Physics::Component::WheelSettings::angularDamping = 0.2f

Angular damping factor: dw/dt = -c * w Value should be zero or positive, usually close to 0

◆ inertia

float Physics::Component::WheelSettings::inertia = 0.9f

Moment of inertia (kg m^2) of the wheel For a cylinder: I = 0.5 * M * R^2 Example: 0.9 for wheel with mass 20kg and radius 0.3m

◆ lateralFriction

std::vector<FrictionCurvePoint> Physics::Component::WheelSettings::lateralFriction
Initial value:
= {
{0.0f, 0.0f},
{3.0f, 1.2f},
{20.0f, 1.0f}
}

Lateral friction curve (sideways/slip angle direction) X-axis: Slip angle in degrees (angle between velocity and tire direction) Y-axis: Friction coefficient (typically 0-1.2) Default: realistic tire slip angle curve

◆ longitudinalFriction

std::vector<FrictionCurvePoint> Physics::Component::WheelSettings::longitudinalFriction
Initial value:
= {
{0.0f, 0.0f},
{0.06f, 1.2f},
{0.2f, 1.0f}
}

Longitudinal friction curve (forward/backward direction) X-axis: Slip ratio = (omega_wheel * r_wheel - v_longitudinal) / |v_longitudinal| Y-axis: Friction coefficient (typically 0-1.2) Default: realistic tire slip curve with peak at 6% slip

◆ maxBrakeTorque

float Physics::Component::WheelSettings::maxBrakeTorque = 1500.0f

Maximum brake torque (Nm) that can be applied to this wheel.

◆ maxHandBrakeTorque

float Physics::Component::WheelSettings::maxHandBrakeTorque = 4000.0f

Maximum handbrake torque (Nm) - usually only applied to rear wheels.

◆ maxSteerAngle

float Physics::Component::WheelSettings::maxSteerAngle = 0.0f

Maximum steering angle in radians (0 for non-steered wheels).

◆ radius

float Physics::Component::WheelSettings::radius = 0.3f

Wheel radius in meters.

◆ suspensionDamping

float Physics::Component::WheelSettings::suspensionDamping = 0.5f

Suspension damping ratio (0 = no damping, 1 = critical damping) Typical car values are 0.3-0.7

◆ suspensionFrequency

float Physics::Component::WheelSettings::suspensionFrequency = 1.5f

Suspension spring frequency in Hz (typically 1.0-2.0 for cars) Higher values = stiffer suspension

◆ suspensionMaxLength

float Physics::Component::WheelSettings::suspensionMaxLength = 0.3f

Maximum suspension extension length in meters.

◆ suspensionMinLength

float Physics::Component::WheelSettings::suspensionMinLength = 0.0f

Minimum suspension compression length in meters (usually 0).

◆ width

float Physics::Component::WheelSettings::width = 0.1f

Wheel width in meters (for cylinder collider).


The documentation for this struct was generated from the following file: