//
// 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
{
///
///
/// Configuration for the transmission of a vehicle (gear box)
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:22
///
/// class VehicleTransmissionSettings
///
///
[InteropHandle]
public readonly partial struct VehicleTransmissionSettings : IDisposable
{
public static VehicleTransmissionSettings Create() => Jolt.PInvoke.VehicleTransmissionSettings_Create();
///
///
/// Saves the contents in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:28
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) =>
Jolt.PInvoke.VehicleTransmissionSettings_SaveBinaryState(this, stream);
///
///
/// Restores the contents in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:31
///
/// void RestoreBinaryState(StreamIn &inStream)
///
///
public void RestoreBinaryState(StreamIn stream) =>
Jolt.PInvoke.VehicleTransmissionSettings_RestoreBinaryState(this, stream);
///
///
/// How to switch gears
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:33
///
/// ETransmissionMode mMode = ETransmissionMode::Auto
///
///
public TransmissionMode GetMode() => Jolt.PInvoke.VehicleTransmissionSettings_GetMode(this);
///
///
/// How to switch gears
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:33
///
/// ETransmissionMode mMode = ETransmissionMode::Auto
///
///
public void SetMode(TransmissionMode value) => Jolt.PInvoke.VehicleTransmissionSettings_SetMode(this, value);
///
///
/// Ratio in rotation rate between engine and gear box, first element is 1st gear, 2nd element 2nd gear etc.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:34
///
/// Array<float> mGearRatios { 2.66f, 1.78f, 1.3f, 1.0f, 0.74f }
///
///
///
///
/// The span is a view of the container's own storage, not a copy: edits land in the object that owns it.
/// It's only valid until that container is resized or its owner is destroyed.
///
///
[return: Brutal.Attributes.Fixed]
public unsafe Span GetGearRatios()
{
Jolt.PInvoke.VehicleTransmissionSettings_GetGearRatios(this, out var _outResult);
return new Span((void*)_outResult.Data, checked((int)_outResult.Count));
}
///
///
/// Ratio in rotation rate between engine and gear box, first element is 1st gear, 2nd element 2nd gear etc.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:34
///
/// Array<float> mGearRatios { 2.66f, 1.78f, 1.3f, 1.0f, 0.74f }
///
///
public unsafe void SetGearRatios(ReadOnlySpan value)
{
fixed (float* value_fixed = value)
{
Jolt.PInvoke.VehicleTransmissionSettings_SetGearRatios(this, value_fixed, (nuint)value.Length);
}
}
///
///
/// Ratio in rotation rate between engine and gear box when driving in reverse
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:35
///
/// Array<float> mReverseGearRatios { -2.90f }
///
///
///
///
/// The span is a view of the container's own storage, not a copy: edits land in the object that owns it.
/// It's only valid until that container is resized or its owner is destroyed.
///
///
[return: Brutal.Attributes.Fixed]
public unsafe Span GetReverseGearRatios()
{
Jolt.PInvoke.VehicleTransmissionSettings_GetReverseGearRatios(this, out var _outResult);
return new Span((void*)_outResult.Data, checked((int)_outResult.Count));
}
///
///
/// Ratio in rotation rate between engine and gear box when driving in reverse
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:35
///
/// Array<float> mReverseGearRatios { -2.90f }
///
///
public unsafe void SetReverseGearRatios(ReadOnlySpan value)
{
fixed (float* value_fixed = value)
{
Jolt.PInvoke.VehicleTransmissionSettings_SetReverseGearRatios(this, value_fixed, (nuint)value.Length);
}
}
///
///
/// How long it takes to switch gears (s), only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:36
///
/// float mSwitchTime = 0.5f
///
///
public float GetSwitchTime() => Jolt.PInvoke.VehicleTransmissionSettings_GetSwitchTime(this);
///
///
/// How long it takes to switch gears (s), only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:36
///
/// float mSwitchTime = 0.5f
///
///
public void SetSwitchTime(float value) => Jolt.PInvoke.VehicleTransmissionSettings_SetSwitchTime(this, value);
///
///
/// How long it takes to release the clutch (go to full friction), only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:37
///
/// float mClutchReleaseTime = 0.3f
///
///
public float GetClutchReleaseTime() => Jolt.PInvoke.VehicleTransmissionSettings_GetClutchReleaseTime(this);
///
///
/// How long it takes to release the clutch (go to full friction), only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:37
///
/// float mClutchReleaseTime = 0.3f
///
///
public void SetClutchReleaseTime(float value) =>
Jolt.PInvoke.VehicleTransmissionSettings_SetClutchReleaseTime(this, value);
///
///
/// How long to wait after releasing the clutch before another switch is attempted (s), only used in auto
/// mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:38
///
/// float mSwitchLatency = 0.5f
///
///
public float GetSwitchLatency() => Jolt.PInvoke.VehicleTransmissionSettings_GetSwitchLatency(this);
///
///
/// How long to wait after releasing the clutch before another switch is attempted (s), only used in auto
/// mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:38
///
/// float mSwitchLatency = 0.5f
///
///
public void SetSwitchLatency(float value) =>
Jolt.PInvoke.VehicleTransmissionSettings_SetSwitchLatency(this, value);
///
///
/// If RPM of engine is bigger then this we will shift a gear up, only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:39
///
/// float mShiftUpRPM = 4000.0f
///
///
public float GetShiftUpRPM() => Jolt.PInvoke.VehicleTransmissionSettings_GetShiftUpRPM(this);
///
///
/// If RPM of engine is bigger then this we will shift a gear up, only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:39
///
/// float mShiftUpRPM = 4000.0f
///
///
public void SetShiftUpRPM(float value) => Jolt.PInvoke.VehicleTransmissionSettings_SetShiftUpRPM(this, value);
///
///
/// If RPM of engine is smaller then this we will shift a gear down, only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:40
///
/// float mShiftDownRPM = 2000.0f
///
///
public float GetShiftDownRPM() => Jolt.PInvoke.VehicleTransmissionSettings_GetShiftDownRPM(this);
///
///
/// If RPM of engine is smaller then this we will shift a gear down, only used in auto mode
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:40
///
/// float mShiftDownRPM = 2000.0f
///
///
public void SetShiftDownRPM(float value) =>
Jolt.PInvoke.VehicleTransmissionSettings_SetShiftDownRPM(this, value);
///
///
/// Strength of the clutch when fully engaged. Total torque a clutch applies is Torque = ClutchStrength *
/// (Velocity Engine - Avg Velocity Wheels At Clutch) (units: k m^2 s^-1)
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:41
///
/// float mClutchStrength = 10.0f
///
///
public float GetClutchStrength() => Jolt.PInvoke.VehicleTransmissionSettings_GetClutchStrength(this);
///
///
/// Strength of the clutch when fully engaged. Total torque a clutch applies is Torque = ClutchStrength *
/// (Velocity Engine - Avg Velocity Wheels At Clutch) (units: k m^2 s^-1)
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTransmission.h:41
///
/// float mClutchStrength = 10.0f
///
///
public void SetClutchStrength(float value) =>
Jolt.PInvoke.VehicleTransmissionSettings_SetClutchStrength(this, value);
public void Dispose() => Jolt.PInvoke.VehicleTransmissionSettings_Destroy(this);
}
}