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) More...
|
| |
|
| float | mMaxTorque = 500.0f |
| | Max amount of torque (Nm) that the engine can deliver. More...
|
| |
| float | mMinRPM = 1000.0f |
| | Min amount of revolutions per minute (rpm) the engine can produce without stalling. More...
|
| |
| float | mMaxRPM = 6000.0f |
| | Max amount of revolutions per minute (rpm) the engine can generate. More...
|
| |
| LinearCurve | mNormalizedTorque |
| | Y-axis: Curve that describes a ratio of the max torque the engine can produce (0 = 0, 1 = mMaxTorque). X-axis: the fraction of the RPM of the engine (0 = mMinRPM, 1 = mMaxRPM) More...
|
| |
| float | mInertia = 0.5f |
| | Moment of inertia (kg m^2) of the engine. More...
|
| |
| float | mAngularDamping = 0.2f |
| | Angular damping factor of the wheel: dw/dt = -c * w. More...
|
| |
◆ AllowSleep()
| bool VehicleEngine::AllowSleep |
( |
| ) |
const |
|
inline |
If the engine is idle we allow the vehicle to sleep.
◆ 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.
◆ ConvertRPMToAngle()
| float VehicleEngine::ConvertRPMToAngle |
( |
float |
inRPM | ) |
const |
|
inline |
◆ 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: