//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using System.Runtime.CompilerServices;
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// Runtime data for engine
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:43
///
/// class VehicleEngine : public VehicleEngineSettings
///
///
[InteropHandle]
public readonly partial struct VehicleEngine : IDisposable
{
public static VehicleEngine Create() => Jolt.PInvoke.VehicleEngine_Create();
///
///
/// Clamp the RPM between min and max RPM
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:50
///
/// inline void ClampRPM()
///
///
public void ClampRPM() => Jolt.PInvoke.VehicleEngine_ClampRPM(this);
///
///
/// Current rotation speed of engine in rounds per minute
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:53
///
/// float GetCurrentRPM() const
///
///
public float GetCurrentRPM() => Jolt.PInvoke.VehicleEngine_GetCurrentRPM(this);
///
///
/// Update rotation speed of engine in rounds per minute
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:56
///
/// void SetCurrentRPM(float inRPM)
///
///
public void SetCurrentRPM(float rpm) => Jolt.PInvoke.VehicleEngine_SetCurrentRPM(this, rpm);
///
///
/// Get current angular velocity of the engine in radians / second
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:59
///
/// inline float GetAngularVelocity() const
///
///
public float GetAngularVelocity() => Jolt.PInvoke.VehicleEngine_GetAngularVelocity(this);
///
///
/// Get the amount of torque (N m) that the engine can supply
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:63
///
/// float GetTorque(float inAcceleration) const
///
///
///
///
/// Get the amount of torque (N m) that the engine can supply
/// @param inAcceleration How much the gas pedal is pressed [0, 1]
///
///
public float GetTorque(float acceleration) => Jolt.PInvoke.VehicleEngine_GetTorque(this, acceleration);
///
///
/// Apply a torque to the engine rotation speed
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:68
///
/// void ApplyTorque(float inTorque, float inDeltaTime)
///
///
///
///
/// Apply a torque to the engine rotation speed
/// @param inTorque Torque in N m
/// @param inDeltaTime Delta time in seconds
///
///
public void ApplyTorque(float torque, float deltaTime) =>
Jolt.PInvoke.VehicleEngine_ApplyTorque(this, torque, deltaTime);
///
///
/// Update the engine RPM for damping
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:72
///
/// void ApplyDamping(float inDeltaTime)
///
///
///
///
/// Update the engine RPM for damping
/// @param inDeltaTime Delta time in seconds
///
///
public void ApplyDamping(float deltaTime) => Jolt.PInvoke.VehicleEngine_ApplyDamping(this, deltaTime);
///
///
/// Function that converts RPM to an angle in radians for debugging purposes
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:76
///
/// float ConvertRPMToAngle(float inRPM) const
///
///
public float ConvertRPMToAngle(float rpm) => Jolt.PInvoke.VehicleEngine_ConvertRPMToAngle(this, rpm);
///
///
/// Debug draw a RPM meter
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:79
///
/// void DrawRPM(DebugRenderer *inRenderer, RVec3Arg inPosition, Vec3Arg inForward, Vec3Arg inUp, float inSize, float inShiftDownRPM, float inShiftUpRPM) const
///
///
public void DrawRPM(
DebugRenderer renderer,
float3 position,
float3 forward,
float3 up,
float size,
float shiftDownRPM,
float shiftUpRPM
) => Jolt.PInvoke.VehicleEngine_DrawRPM(this, renderer, position, forward, up, size, shiftDownRPM, shiftUpRPM);
///
///
/// If the engine is idle we allow the vehicle to sleep
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:83
///
/// bool AllowSleep() const
///
///
public bool AllowSleep() => Jolt.PInvoke.VehicleEngine_AllowSleep(this);
///
///
/// Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleEngine.h:47
///
/// static constexpr float cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI)
///
///
public static float GetAngularVelocityToRPM() => Jolt.PInvoke.VehicleEngine_GetAngularVelocityToRPM();
public static implicit operator VehicleEngineSettings(VehicleEngine value) =>
Unsafe.BitCast(value);
public void Dispose() => Jolt.PInvoke.VehicleEngine_Destroy(this);
///
public void SaveBinaryState(StreamOut stream) => ((VehicleEngineSettings)this).SaveBinaryState(stream);
///
public void RestoreBinaryState(StreamIn stream) => ((VehicleEngineSettings)this).RestoreBinaryState(stream);
///
public float GetMaxTorque() => ((VehicleEngineSettings)this).GetMaxTorque();
///
public void SetMaxTorque(float value) => ((VehicleEngineSettings)this).SetMaxTorque(value);
///
public float GetMinRPM() => ((VehicleEngineSettings)this).GetMinRPM();
///
public void SetMinRPM(float value) => ((VehicleEngineSettings)this).SetMinRPM(value);
///
public float GetMaxRPM() => ((VehicleEngineSettings)this).GetMaxRPM();
///
public void SetMaxRPM(float value) => ((VehicleEngineSettings)this).SetMaxRPM(value);
///
public LinearCurve GetNormalizedTorque() => ((VehicleEngineSettings)this).GetNormalizedTorque();
///
public void SetNormalizedTorque(LinearCurve value) => ((VehicleEngineSettings)this).SetNormalizedTorque(value);
///
public float GetInertia() => ((VehicleEngineSettings)this).GetInertia();
///
public void SetInertia(float value) => ((VehicleEngineSettings)this).SetInertia(value);
///
public float GetAngularDamping() => ((VehicleEngineSettings)this).GetAngularDamping();
///
public void SetAngularDamping(float value) => ((VehicleEngineSettings)this).SetAngularDamping(value);
}
}