5#include <Jolt/Physics/Vehicle/VehicleAntiRollBar.h>
6#include <Jolt/Physics/Vehicle/VehicleConstraint.h>
194 glm::vec3(-0.9f, -0.3f, 1.2f),
195 glm::vec3(0.9f, -0.3f, 1.2f),
196 glm::vec3(-0.9f, -0.3f, -1.2f),
197 glm::vec3(0.9f, -0.3f, -1.2f)
Definition BoxCollider.hpp:27
WheelIndex
Enum for identifying wheel positions in a 4-wheel vehicle.
Definition WheelSettings.hpp:11
@ FrontRight
Definition WheelSettings.hpp:13
@ FrontLeft
Definition WheelSettings.hpp:12
@ RearRight
Definition WheelSettings.hpp:15
@ RearLeft
Definition WheelSettings.hpp:14
@ Count
Definition WheelSettings.hpp:16
DrivetrainType
Drivetrain configuration for vehicle.
Definition Vehicle.hpp:15
@ RWD
Rear-Wheel Drive - power to rear wheels only.
Definition Vehicle.hpp:21
@ AWD
All-Wheel Drive - power to all 4 wheels.
Definition Vehicle.hpp:17
@ FWD
Front-Wheel Drive - power to front wheels only.
Definition Vehicle.hpp:19
TransmissionMode
Transmission mode - how gears are shifted.
Definition Vehicle.hpp:43
@ Auto
Automatically shift gear up and down.
Definition Vehicle.hpp:45
@ Manual
Manual gear shift (controlled by user input).
Definition Vehicle.hpp:47
CollisionTesterType
Collision tester type for vehicle wheel collision detection.
Definition Vehicle.hpp:31
@ CastSphere
Sphere cast - better than ray, good for rough terrain.
Definition Vehicle.hpp:35
@ Ray
Simple raycast - fastest but prone to ghost collisions on tiled floors.
Definition Vehicle.hpp:33
@ CastCylinder
Cylinder cast - most accurate, best for tiled floors and complex terrain (default).
Definition Vehicle.hpp:37
Engine configuration.
Definition Vehicle.hpp:107
float maxRPM
Maximum RPM.
Definition Vehicle.hpp:115
float minRPM
Minimum RPM.
Definition Vehicle.hpp:112
float maxTorque
Maximum engine torque in Nm.
Definition Vehicle.hpp:109
std::vector< TorqueCurvePoint > normalizedTorque
Definition Vehicle.hpp:121
float angularDamping
Definition Vehicle.hpp:132
float inertia
Moment of inertia (kg m^2) of the engine.
Definition Vehicle.hpp:128
Gearbox configuration for vehicle transmission.
Definition Vehicle.hpp:65
int currentGear
Current gear (-1 = reverse, 0 = neutral, 1 = first forward, etc.).
Definition Vehicle.hpp:78
float clutchFriction
Current clutch friction (0 = no friction, 1 = full friction) - for manual mode.
Definition Vehicle.hpp:101
float switchLatency
How long to wait after releasing clutch before another switch is attempted (s) - only used in auto mo...
Definition Vehicle.hpp:87
TransmissionMode mode
Transmission mode (auto or manual shifting).
Definition Vehicle.hpp:67
std::vector< float > forwardGearRatios
Definition Vehicle.hpp:71
float switchTime
How long it takes to switch gears (s) - only used in auto mode.
Definition Vehicle.hpp:81
float shiftUpRPM
If RPM of engine is bigger than this, shift a gear up - only used in auto mode.
Definition Vehicle.hpp:90
float clutchReleaseTime
How long it takes to release the clutch (go to full friction) - only used in auto mode.
Definition Vehicle.hpp:84
float shiftDownRPM
If RPM of engine is smaller than this, shift a gear down - only used in auto mode.
Definition Vehicle.hpp:93
float clutchStrength
Definition Vehicle.hpp:98
std::vector< float > reverseGearRatios
Definition Vehicle.hpp:75
Rollbar (anti-roll bar) configuration.
Definition Vehicle.hpp:138
float rearStiffness
Rear rollbar stiffness (N/rad).
Definition Vehicle.hpp:143
float frontStiffness
Front rollbar stiffness (N/rad).
Definition Vehicle.hpp:140
Torque curve point for normalized engine torque.
Definition Vehicle.hpp:57
float rpm
Normalized RPM (0.0 to 1.0).
Definition Vehicle.hpp:58
float torque
Normalized torque (0.0 to 1.0).
Definition Vehicle.hpp:59
Main vehicle component containing all configuration.
Definition Vehicle.hpp:152
std::array< Engine::EntityId, 4 > wheelEntities
Wheel entities for visual representation.
Definition Vehicle.hpp:169
static std::array< glm::vec3, 4 > GetDefaultWheelPositions()
Get default wheel positions relative to chassis center.
Definition Vehicle.hpp:191
RollbarSettings rollbar
Rollbar configuration.
Definition Vehicle.hpp:166
GearboxSettings gearbox
Gearbox configuration.
Definition Vehicle.hpp:163
DrivetrainType drivetrain
Drivetrain configuration.
Definition Vehicle.hpp:157
std::array< glm::vec3, 4 > wheelPositions
Wheel positions relative to chassis center.
Definition Vehicle.hpp:172
static Vehicle CreateDefaultCar()
Create a default RWD sports car configuration.
Definition Vehicle.hpp:204
EngineSettings engine
Engine configuration.
Definition Vehicle.hpp:160
CollisionTesterType collisionTesterType
Collision tester type for wheel-ground detection (default: CastCylinder).
Definition Vehicle.hpp:175
std::array< WheelSettings, static_cast< size_t >(WheelIndex::Count)> wheels
Wheel settings for all 4 wheels (indexed by WheelIndex).
Definition Vehicle.hpp:154
float convexRadiusFraction
Definition Vehicle.hpp:179
static WheelSettings CreateRearWheel()
Create default rear wheel settings without steering.
Definition WheelSettings.hpp:109
static WheelSettings CreateFrontWheel()
Create default front wheel settings with steering.
Definition WheelSettings.hpp:99