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

Vehicle input controller component. More...

#include <VehicleController.hpp>

Public Member Functions

void SetForward (float value)
 Set forward/backward input.
void SetSteering (float value)
 Set steering input.
void SetBrake (float value)
 Set brake input.
void SetHandBrake (float value)
 Set handbrake input.
void ResetInputs ()
 Reset all inputs to neutral.

Public Attributes

float forwardInput = 0.0f
 Forward/backward input (-1.0 = full brake/reverse, 0.0 = neutral, 1.0 = full throttle).
float steeringInput = 0.0f
 Steering input (-1.0 = full left, 0.0 = straight, 1.0 = full right).
float brakeInput = 0.0f
 Brake input (0.0 = no brake, 1.0 = full brake).
float handBrakeInput = 0.0f
 Handbrake input (0.0 = off, 1.0 = full handbrake).

Detailed Description

Vehicle input controller component.

Attach this component to a vehicle chassis entity to control it. Set input values between -1.0 and 1.0, which will be applied to the Jolt vehicle controller during the physics update.

Member Function Documentation

◆ ResetInputs()

void Physics::Component::VehicleController::ResetInputs ( )
inline

Reset all inputs to neutral.

◆ SetBrake()

void Physics::Component::VehicleController::SetBrake ( float value)
inline

Set brake input.

Parameters
valueInput value clamped to [0.0, 1.0]

◆ SetForward()

void Physics::Component::VehicleController::SetForward ( float value)
inline

Set forward/backward input.

Parameters
valueInput value clamped to [-1.0, 1.0]

◆ SetHandBrake()

void Physics::Component::VehicleController::SetHandBrake ( float value)
inline

Set handbrake input.

Parameters
valueInput value clamped to [0.0, 1.0]

◆ SetSteering()

void Physics::Component::VehicleController::SetSteering ( float value)
inline

Set steering input.

Parameters
valueInput value clamped to [-1.0, 1.0]

Member Data Documentation

◆ brakeInput

float Physics::Component::VehicleController::brakeInput = 0.0f

Brake input (0.0 = no brake, 1.0 = full brake).

◆ forwardInput

float Physics::Component::VehicleController::forwardInput = 0.0f

Forward/backward input (-1.0 = full brake/reverse, 0.0 = neutral, 1.0 = full throttle).

◆ handBrakeInput

float Physics::Component::VehicleController::handBrakeInput = 0.0f

Handbrake input (0.0 = off, 1.0 = full handbrake).

◆ steeringInput

float Physics::Component::VehicleController::steeringInput = 0.0f

Steering input (-1.0 = full left, 0.0 = straight, 1.0 = full right).


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