//
// 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
{
///
///
/// Generic properties for tank tracks
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:24
///
/// class VehicleTrackSettings
///
///
[InteropHandle]
public readonly partial struct VehicleTrackSettings : IDisposable
{
public static VehicleTrackSettings Create() => Jolt.PInvoke.VehicleTrackSettings_Create();
///
///
/// Saves the contents in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:30
///
/// void SaveBinaryState(StreamOut &inStream) const
///
///
public void SaveBinaryState(StreamOut stream) =>
Jolt.PInvoke.VehicleTrackSettings_SaveBinaryState(this, stream);
///
///
/// Restores the contents in binary form to inStream.
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:33
///
/// void RestoreBinaryState(StreamIn &inStream)
///
///
public void RestoreBinaryState(StreamIn stream) =>
Jolt.PInvoke.VehicleTrackSettings_RestoreBinaryState(this, stream);
///
///
/// Which wheel on the track is connected to the engine
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:35
///
/// uint mDrivenWheel
///
///
public uint GetDrivenWheel() => Jolt.PInvoke.VehicleTrackSettings_GetDrivenWheel(this);
///
///
/// Which wheel on the track is connected to the engine
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:35
///
/// uint mDrivenWheel
///
///
public void SetDrivenWheel(uint value) => Jolt.PInvoke.VehicleTrackSettings_SetDrivenWheel(this, value);
///
///
/// Indices of wheels that are inside this track, should include the driven wheel too
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:36
///
/// Array<uint> mWheels
///
///
///
///
/// 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 GetWheels()
{
Jolt.PInvoke.VehicleTrackSettings_GetWheels(this, out var _outResult);
return new Span((void*)_outResult.Data, checked((int)_outResult.Count));
}
///
///
/// Indices of wheels that are inside this track, should include the driven wheel too
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:36
///
/// Array<uint> mWheels
///
///
public unsafe void SetWheels(ReadOnlySpan value)
{
fixed (uint* value_fixed = value)
{
Jolt.PInvoke.VehicleTrackSettings_SetWheels(this, value_fixed, (nuint)value.Length);
}
}
///
///
/// Moment of inertia (kg m^2) of the track and its wheels as seen on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:37
///
/// float mInertia = 10.0f
///
///
public float GetInertia() => Jolt.PInvoke.VehicleTrackSettings_GetInertia(this);
///
///
/// Moment of inertia (kg m^2) of the track and its wheels as seen on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:37
///
/// float mInertia = 10.0f
///
///
public void SetInertia(float value) => Jolt.PInvoke.VehicleTrackSettings_SetInertia(this, value);
///
///
/// Damping factor of track and its wheels: dw/dt = -c * w as seen on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:38
///
/// float mAngularDamping = 0.5f
///
///
public float GetAngularDamping() => Jolt.PInvoke.VehicleTrackSettings_GetAngularDamping(this);
///
///
/// Damping factor of track and its wheels: dw/dt = -c * w as seen on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:38
///
/// float mAngularDamping = 0.5f
///
///
public void SetAngularDamping(float value) => Jolt.PInvoke.VehicleTrackSettings_SetAngularDamping(this, value);
///
///
/// How much torque (Nm) the brakes can apply on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:39
///
/// float mMaxBrakeTorque = 15000.0f
///
///
public float GetMaxBrakeTorque() => Jolt.PInvoke.VehicleTrackSettings_GetMaxBrakeTorque(this);
///
///
/// How much torque (Nm) the brakes can apply on the driven wheel
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:39
///
/// float mMaxBrakeTorque = 15000.0f
///
///
public void SetMaxBrakeTorque(float value) => Jolt.PInvoke.VehicleTrackSettings_SetMaxBrakeTorque(this, value);
///
///
/// Ratio between rotation speed of gear box and driven wheel of track
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:40
///
/// float mDifferentialRatio = 6.0f
///
///
public float GetDifferentialRatio() => Jolt.PInvoke.VehicleTrackSettings_GetDifferentialRatio(this);
///
///
/// Ratio between rotation speed of gear box and driven wheel of track
///
///
/// C++:
/// Jolt/Physics/Vehicle/VehicleTrack.h:40
///
/// float mDifferentialRatio = 6.0f
///
///
public void SetDifferentialRatio(float value) =>
Jolt.PInvoke.VehicleTrackSettings_SetDifferentialRatio(this, value);
public void Dispose() => Jolt.PInvoke.VehicleTrackSettings_Destroy(this);
}
}