Runtime data for engine.
More...
#include <VehicleEngine.h>
|
static constexpr float | cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI) |
| Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
|
|
|
float | mMaxTorque = 500.0f |
| Max amount of torque (Nm) that the engine can deliver.
|
|
float | mMinRPM = 1000.0f |
| Min amount of revolutions per minute (rpm) the engine can produce without stalling.
|
|
float | mMaxRPM = 6000.0f |
| Max amount of revolutions per minute (rpm) the engine can generate.
|
|
LinearCurve | mNormalizedTorque |
| Curve that describes a ratio of the max torque the engine can produce vs the fraction of the max RPM of the engine.
|
|
float | mInertia = 0.5f |
| Moment of inertia (kg m^2) of the engine.
|
|
float | mAngularDamping = 0.2f |
| Angular damping factor of the wheel: dw/dt = -c * w.
|
|
◆ ApplyDamping()
void VehicleEngine::ApplyDamping |
( |
float | inDeltaTime | ) |
|
Update the engine RPM for damping
- Parameters
-
inDeltaTime | Delta time in seconds |
◆ ApplyTorque()
void VehicleEngine::ApplyTorque |
( |
float | inTorque, |
|
|
float | inDeltaTime ) |
Apply a torque to the engine rotation speed
- Parameters
-
inTorque | Torque in N m |
inDeltaTime | Delta time in seconds |
◆ ClampRPM()
void VehicleEngine::ClampRPM |
( |
| ) |
|
|
inline |
Clamp the RPM between min and max RPM.
◆ DrawRPM()
◆ GetAngularVelocity()
float VehicleEngine::GetAngularVelocity |
( |
| ) |
const |
|
inline |
Get current angular velocity of the engine in radians / second.
◆ GetCurrentRPM()
float VehicleEngine::GetCurrentRPM |
( |
| ) |
const |
|
inline |
Current rotation speed of engine in rounds per minute.
◆ GetTorque()
float VehicleEngine::GetTorque |
( |
float | inAcceleration | ) |
const |
|
inline |
Get the amount of torque (N m) that the engine can supply
- Parameters
-
inAcceleration | How much the gas pedal is pressed [0, 1] |
◆ RestoreState()
◆ SaveState()
◆ SetCurrentRPM()
void VehicleEngine::SetCurrentRPM |
( |
float | inRPM | ) |
|
|
inline |
Update rotation speed of engine in rounds per minute.
◆ cAngularVelocityToRPM
constexpr float VehicleEngine::cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI) |
|
staticconstexpr |
Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
The documentation for this class was generated from the following files: