//
// 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
{
///
///
/// Settings of a vehicle with regular wheels
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:72
///
/// class WheeledVehicleControllerSettings : public VehicleControllerSettings
///
///
///
///
/// Settings of a vehicle with regular wheels
///
/// The properties in this controller are largely based on "Car Physics for Games" by Marco Monster.
/// See: https://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html
///
///
[InteropHandle]
public readonly partial struct WheeledVehicleControllerSettings : IDisposable
{
public static WheeledVehicleControllerSettings Create() =>
Jolt.PInvoke.WheeledVehicleControllerSettings_Create();
///
public RTTI GetRTTI() => ((VehicleControllerSettings)this).GetRTTI();
///
public unsafe Ptr CastTo(RTTI rtti) => ((VehicleControllerSettings)this).CastTo(rtti);
///
public void SaveBinaryState(StreamOut stream) => ((VehicleControllerSettings)this).SaveBinaryState(stream);
///
public void RestoreBinaryState(StreamIn stream) => ((VehicleControllerSettings)this).RestoreBinaryState(stream);
///
///
/// The properties of the engine
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:82
///
/// VehicleEngineSettings mEngine
///
///
///
///
/// The returned handle is an owned copy; Dispose it when you're done with it.
///
///
public VehicleEngineSettings GetEngine() => Jolt.PInvoke.WheeledVehicleControllerSettings_GetEngine(this);
///
///
/// The properties of the engine
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:82
///
/// VehicleEngineSettings mEngine
///
///
///
///
/// The value is copied into the field; the handle you pass stays yours to Dispose.
///
///
public void SetEngine(VehicleEngineSettings value) =>
Jolt.PInvoke.WheeledVehicleControllerSettings_SetEngine(this, value);
///
///
/// The properties of the transmission (aka gear box)
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:83
///
/// VehicleTransmissionSettings mTransmission
///
///
///
///
/// The returned handle is an owned copy; Dispose it when you're done with it.
///
///
public VehicleTransmissionSettings GetTransmission() =>
Jolt.PInvoke.WheeledVehicleControllerSettings_GetTransmission(this);
///
///
/// The properties of the transmission (aka gear box)
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:83
///
/// VehicleTransmissionSettings mTransmission
///
///
///
///
/// The value is copied into the field; the handle you pass stays yours to Dispose.
///
///
public void SetTransmission(VehicleTransmissionSettings value) =>
Jolt.PInvoke.WheeledVehicleControllerSettings_SetTransmission(this, value);
///
///
/// List of differentials and their properties
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:84
///
/// Array<VehicleDifferentialSettings> mDifferentials
///
///
///
///
/// 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 GetDifferentials()
{
Jolt.PInvoke.WheeledVehicleControllerSettings_GetDifferentials(this, out var _outResult);
return new Span((void*)_outResult.Data, checked((int)_outResult.Count));
}
///
///
/// List of differentials and their properties
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:84
///
/// Array<VehicleDifferentialSettings> mDifferentials
///
///
public unsafe void SetDifferentials(ReadOnlySpan value)
{
fixed (VehicleDifferentialSettings* value_fixed = value)
{
Jolt.PInvoke.WheeledVehicleControllerSettings_SetDifferentials(this, value_fixed, (nuint)value.Length);
}
}
///
///
/// Ratio max / min average wheel speed of each differential (measured at the clutch). When the ratio is
/// exceeded all torque gets distributed to the differential with the minimal average velocity. This allows
/// implementing a limited slip differential between differentials. Set to FLT_MAX for an open differential.
/// Value should be > 1.
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:85
///
/// float mDifferentialLimitedSlipRatio = 1.4f
///
///
public float GetDifferentialLimitedSlipRatio() =>
Jolt.PInvoke.WheeledVehicleControllerSettings_GetDifferentialLimitedSlipRatio(this);
///
///
/// Ratio max / min average wheel speed of each differential (measured at the clutch). When the ratio is
/// exceeded all torque gets distributed to the differential with the minimal average velocity. This allows
/// implementing a limited slip differential between differentials. Set to FLT_MAX for an open differential.
/// Value should be > 1.
///
///
/// C++:
/// Jolt/Physics/Vehicle/WheeledVehicleController.h:85
///
/// float mDifferentialLimitedSlipRatio = 1.4f
///
///
public void SetDifferentialLimitedSlipRatio(float value) =>
Jolt.PInvoke.WheeledVehicleControllerSettings_SetDifferentialLimitedSlipRatio(this, value);
public void AddRef() => ((VehicleControllerSettings)this).AddRef();
public void Release() => ((VehicleControllerSettings)this).Release();
public uint GetRefCount() => ((VehicleControllerSettings)this).GetRefCount();
public static implicit operator VehicleControllerSettings(WheeledVehicleControllerSettings value) =>
Unsafe.BitCast(value);
public void Dispose()
{
if (IsNull())
return;
Release();
}
}
}