mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
245 lines
11 KiB
C#
245 lines
11 KiB
C#
// <auto-generated/>
|
|
// 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
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Runtime data for engine
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L43">Jolt/Physics/Vehicle/VehicleEngine.h:43</see>
|
|
/// <br/>
|
|
/// <c>class VehicleEngine : public VehicleEngineSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct VehicleEngine : IDisposable
|
|
{
|
|
public static VehicleEngine Create() => Jolt.PInvoke.VehicleEngine_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Clamp the RPM between min and max RPM
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L50">Jolt/Physics/Vehicle/VehicleEngine.h:50</see>
|
|
/// <br/>
|
|
/// <c>inline void ClampRPM()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void ClampRPM() => Jolt.PInvoke.VehicleEngine_ClampRPM(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Current rotation speed of engine in rounds per minute
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L53">Jolt/Physics/Vehicle/VehicleEngine.h:53</see>
|
|
/// <br/>
|
|
/// <c>float GetCurrentRPM() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetCurrentRPM() => Jolt.PInvoke.VehicleEngine_GetCurrentRPM(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Update rotation speed of engine in rounds per minute
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L56">Jolt/Physics/Vehicle/VehicleEngine.h:56</see>
|
|
/// <br/>
|
|
/// <c>void SetCurrentRPM(float inRPM)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetCurrentRPM(float rpm) => Jolt.PInvoke.VehicleEngine_SetCurrentRPM(this, rpm);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get current angular velocity of the engine in radians / second
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L59">Jolt/Physics/Vehicle/VehicleEngine.h:59</see>
|
|
/// <br/>
|
|
/// <c>inline float GetAngularVelocity() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetAngularVelocity() => Jolt.PInvoke.VehicleEngine_GetAngularVelocity(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the amount of torque (N m) that the engine can supply
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L63">Jolt/Physics/Vehicle/VehicleEngine.h:63</see>
|
|
/// <br/>
|
|
/// <c>float GetTorque(float inAcceleration) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Get the amount of torque (N m) that the engine can supply
|
|
/// @param inAcceleration How much the gas pedal is pressed [0, 1]
|
|
/// </code>
|
|
/// </remarks>
|
|
public float GetTorque(float acceleration) => Jolt.PInvoke.VehicleEngine_GetTorque(this, acceleration);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Apply a torque to the engine rotation speed
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L68">Jolt/Physics/Vehicle/VehicleEngine.h:68</see>
|
|
/// <br/>
|
|
/// <c>void ApplyTorque(float inTorque, float inDeltaTime)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Apply a torque to the engine rotation speed
|
|
/// @param inTorque Torque in N m
|
|
/// @param inDeltaTime Delta time in seconds
|
|
/// </code>
|
|
/// </remarks>
|
|
public void ApplyTorque(float torque, float deltaTime) =>
|
|
Jolt.PInvoke.VehicleEngine_ApplyTorque(this, torque, deltaTime);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Update the engine RPM for damping
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L72">Jolt/Physics/Vehicle/VehicleEngine.h:72</see>
|
|
/// <br/>
|
|
/// <c>void ApplyDamping(float inDeltaTime)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Update the engine RPM for damping
|
|
/// @param inDeltaTime Delta time in seconds
|
|
/// </code>
|
|
/// </remarks>
|
|
public void ApplyDamping(float deltaTime) => Jolt.PInvoke.VehicleEngine_ApplyDamping(this, deltaTime);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Function that converts RPM to an angle in radians for debugging purposes
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L76">Jolt/Physics/Vehicle/VehicleEngine.h:76</see>
|
|
/// <br/>
|
|
/// <c>float ConvertRPMToAngle(float inRPM) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float ConvertRPMToAngle(float rpm) => Jolt.PInvoke.VehicleEngine_ConvertRPMToAngle(this, rpm);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Debug draw a RPM meter
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L79">Jolt/Physics/Vehicle/VehicleEngine.h:79</see>
|
|
/// <br/>
|
|
/// <c>void DrawRPM(DebugRenderer *inRenderer, RVec3Arg inPosition, Vec3Arg inForward, Vec3Arg inUp, float inSize, float inShiftDownRPM, float inShiftUpRPM) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
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);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// If the engine is idle we allow the vehicle to sleep
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L83">Jolt/Physics/Vehicle/VehicleEngine.h:83</see>
|
|
/// <br/>
|
|
/// <c>bool AllowSleep() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public bool AllowSleep() => Jolt.PInvoke.VehicleEngine_AllowSleep(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleEngine.h#L47">Jolt/Physics/Vehicle/VehicleEngine.h:47</see>
|
|
/// <br/>
|
|
/// <c>static constexpr float cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static float GetAngularVelocityToRPM() => Jolt.PInvoke.VehicleEngine_GetAngularVelocityToRPM();
|
|
|
|
public static implicit operator VehicleEngineSettings(VehicleEngine value) =>
|
|
Unsafe.BitCast<VehicleEngine, VehicleEngineSettings>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.VehicleEngine_Destroy(this);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SaveBinaryState(StreamOut)"/>
|
|
public void SaveBinaryState(StreamOut stream) => ((VehicleEngineSettings)this).SaveBinaryState(stream);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.RestoreBinaryState(StreamIn)"/>
|
|
public void RestoreBinaryState(StreamIn stream) => ((VehicleEngineSettings)this).RestoreBinaryState(stream);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetMaxTorque()"/>
|
|
public float GetMaxTorque() => ((VehicleEngineSettings)this).GetMaxTorque();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetMaxTorque(float)"/>
|
|
public void SetMaxTorque(float value) => ((VehicleEngineSettings)this).SetMaxTorque(value);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetMinRPM()"/>
|
|
public float GetMinRPM() => ((VehicleEngineSettings)this).GetMinRPM();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetMinRPM(float)"/>
|
|
public void SetMinRPM(float value) => ((VehicleEngineSettings)this).SetMinRPM(value);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetMaxRPM()"/>
|
|
public float GetMaxRPM() => ((VehicleEngineSettings)this).GetMaxRPM();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetMaxRPM(float)"/>
|
|
public void SetMaxRPM(float value) => ((VehicleEngineSettings)this).SetMaxRPM(value);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetNormalizedTorque()"/>
|
|
public LinearCurve GetNormalizedTorque() => ((VehicleEngineSettings)this).GetNormalizedTorque();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetNormalizedTorque(LinearCurve)"/>
|
|
public void SetNormalizedTorque(LinearCurve value) => ((VehicleEngineSettings)this).SetNormalizedTorque(value);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetInertia()"/>
|
|
public float GetInertia() => ((VehicleEngineSettings)this).GetInertia();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetInertia(float)"/>
|
|
public void SetInertia(float value) => ((VehicleEngineSettings)this).SetInertia(value);
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.GetAngularDamping()"/>
|
|
public float GetAngularDamping() => ((VehicleEngineSettings)this).GetAngularDamping();
|
|
|
|
/// <inheritdoc cref="VehicleEngineSettings.SetAngularDamping(float)"/>
|
|
public void SetAngularDamping(float value) => ((VehicleEngineSettings)this).SetAngularDamping(value);
|
|
}
|
|
}
|