mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
296 lines
14 KiB
C#
296 lines
14 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>
|
|
/// Configuration for constraint that simulates a wheeled vehicle.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L23">Jolt/Physics/Vehicle/VehicleConstraint.h:23</see>
|
|
/// <br/>
|
|
/// <c>class VehicleConstraintSettings : public ConstraintSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Configuration for constraint that simulates a wheeled vehicle.
|
|
///
|
|
/// The properties in this constraint 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
|
|
/// </code>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct VehicleConstraintSettings : IDisposable
|
|
{
|
|
public static VehicleConstraintSettings Create() => Jolt.PInvoke.VehicleConstraintSettings_Create();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetRTTI()"/>
|
|
public RTTI GetRTTI() => ((ConstraintSettings)this).GetRTTI();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.CastTo(RTTI)"/>
|
|
public unsafe Ptr CastTo(RTTI rtti) => ((ConstraintSettings)this).CastTo(rtti);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SaveBinaryState(StreamOut)"/>
|
|
public void SaveBinaryState(StreamOut stream) => ((ConstraintSettings)this).SaveBinaryState(stream);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Vector indicating the up direction of the vehicle (in local space to the body)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L31">Jolt/Physics/Vehicle/VehicleConstraint.h:31</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mUp { 0, 1, 0 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float3 GetUp() => Jolt.PInvoke.VehicleConstraintSettings_GetUp(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Vector indicating the up direction of the vehicle (in local space to the body)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L31">Jolt/Physics/Vehicle/VehicleConstraint.h:31</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mUp { 0, 1, 0 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetUp(float3 value) => Jolt.PInvoke.VehicleConstraintSettings_SetUp(this, value);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Vector indicating forward direction of the vehicle (in local space to the body)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L32">Jolt/Physics/Vehicle/VehicleConstraint.h:32</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mForward { 0, 0, 1 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float3 GetForward() => Jolt.PInvoke.VehicleConstraintSettings_GetForward(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Vector indicating forward direction of the vehicle (in local space to the body)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L32">Jolt/Physics/Vehicle/VehicleConstraint.h:32</see>
|
|
/// <br/>
|
|
/// <c>Vec3 mForward { 0, 0, 1 }</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetForward(float3 value) => Jolt.PInvoke.VehicleConstraintSettings_SetForward(this, value);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Defines the maximum pitch/roll angle (rad), can be used to avoid the car from getting upside down. The
|
|
/// vehicle up direction will stay within a cone centered around the up axis with half top angle
|
|
/// mMaxPitchRollAngle, set to pi to turn off.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L33">Jolt/Physics/Vehicle/VehicleConstraint.h:33</see>
|
|
/// <br/>
|
|
/// <c>float mMaxPitchRollAngle = JPH_PI</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetMaxPitchRollAngle() => Jolt.PInvoke.VehicleConstraintSettings_GetMaxPitchRollAngle(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Defines the maximum pitch/roll angle (rad), can be used to avoid the car from getting upside down. The
|
|
/// vehicle up direction will stay within a cone centered around the up axis with half top angle
|
|
/// mMaxPitchRollAngle, set to pi to turn off.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L33">Jolt/Physics/Vehicle/VehicleConstraint.h:33</see>
|
|
/// <br/>
|
|
/// <c>float mMaxPitchRollAngle = JPH_PI</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetMaxPitchRollAngle(float value) =>
|
|
Jolt.PInvoke.VehicleConstraintSettings_SetMaxPitchRollAngle(this, value);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// List of wheels and their properties
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L34">Jolt/Physics/Vehicle/VehicleConstraint.h:34</see>
|
|
/// <br/>
|
|
/// <c>Array<Ref<WheelSettings>> mWheels</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Returns an owned native buffer - read it through AsSpan() and Dispose it when you are done with it. The
|
|
/// handles in it are borrowed views into the buffer: they stay valid until Dispose and must not be disposed
|
|
/// themselves.
|
|
/// </para>
|
|
/// </remarks>
|
|
public NativeArray<WheelSettings> GetWheels() =>
|
|
new NativeArray<WheelSettings>(Jolt.PInvoke.VehicleConstraintSettings_GetWheels(this));
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// List of wheels and their properties
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L34">Jolt/Physics/Vehicle/VehicleConstraint.h:34</see>
|
|
/// <br/>
|
|
/// <c>Array<Ref<WheelSettings>> mWheels</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void SetWheels(ReadOnlySpan<WheelSettings> value)
|
|
{
|
|
fixed (WheelSettings* value_fixed = value)
|
|
{
|
|
Jolt.PInvoke.VehicleConstraintSettings_SetWheels(this, value_fixed, (nuint)value.Length);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// List of anti rollbars and their properties
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L35">Jolt/Physics/Vehicle/VehicleConstraint.h:35</see>
|
|
/// <br/>
|
|
/// <c>VehicleAntiRollBars mAntiRollBars</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// 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.
|
|
/// </para>
|
|
/// </remarks>
|
|
[return: Brutal.Attributes.Fixed]
|
|
public unsafe Span<VehicleAntiRollBar> GetAntiRollBars()
|
|
{
|
|
Jolt.PInvoke.VehicleConstraintSettings_GetAntiRollBars(this, out var _outResult);
|
|
return new Span<VehicleAntiRollBar>((void*)_outResult.Data, checked((int)_outResult.Count));
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// List of anti rollbars and their properties
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L35">Jolt/Physics/Vehicle/VehicleConstraint.h:35</see>
|
|
/// <br/>
|
|
/// <c>VehicleAntiRollBars mAntiRollBars</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public unsafe void SetAntiRollBars(ReadOnlySpan<VehicleAntiRollBar> value)
|
|
{
|
|
fixed (VehicleAntiRollBar* value_fixed = value)
|
|
{
|
|
Jolt.PInvoke.VehicleConstraintSettings_SetAntiRollBars(this, value_fixed, (nuint)value.Length);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Defines how the vehicle can accelerate / decelerate
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L36">Jolt/Physics/Vehicle/VehicleConstraint.h:36</see>
|
|
/// <br/>
|
|
/// <c>Ref<VehicleControllerSettings> mController</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle carries its own reference; Dispose it once when you're done.
|
|
/// </para>
|
|
/// </remarks>
|
|
public VehicleControllerSettings GetController() => Jolt.PInvoke.VehicleConstraintSettings_GetController(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Defines how the vehicle can accelerate / decelerate
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleConstraint.h#L36">Jolt/Physics/Vehicle/VehicleConstraint.h:36</see>
|
|
/// <br/>
|
|
/// <c>Ref<VehicleControllerSettings> mController</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetController(VehicleControllerSettings value) =>
|
|
Jolt.PInvoke.VehicleConstraintSettings_SetController(this, value);
|
|
|
|
public void AddRef() => ((ConstraintSettings)this).AddRef();
|
|
|
|
public void Release() => ((ConstraintSettings)this).Release();
|
|
|
|
public uint GetRefCount() => ((ConstraintSettings)this).GetRefCount();
|
|
|
|
public static implicit operator ConstraintSettings(VehicleConstraintSettings value) =>
|
|
Unsafe.BitCast<VehicleConstraintSettings, ConstraintSettings>(value);
|
|
|
|
public void Dispose()
|
|
{
|
|
if (IsNull())
|
|
return;
|
|
Release();
|
|
}
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetEnabled()"/>
|
|
public bool GetEnabled() => ((ConstraintSettings)this).GetEnabled();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetEnabled(bool)"/>
|
|
public void SetEnabled(bool value) => ((ConstraintSettings)this).SetEnabled(value);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetConstraintPriority()"/>
|
|
public uint GetConstraintPriority() => ((ConstraintSettings)this).GetConstraintPriority();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetConstraintPriority(uint)"/>
|
|
public void SetConstraintPriority(uint value) => ((ConstraintSettings)this).SetConstraintPriority(value);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetNumVelocityStepsOverride()"/>
|
|
public uint GetNumVelocityStepsOverride() => ((ConstraintSettings)this).GetNumVelocityStepsOverride();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetNumVelocityStepsOverride(uint)"/>
|
|
public void SetNumVelocityStepsOverride(uint value) =>
|
|
((ConstraintSettings)this).SetNumVelocityStepsOverride(value);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetNumPositionStepsOverride()"/>
|
|
public uint GetNumPositionStepsOverride() => ((ConstraintSettings)this).GetNumPositionStepsOverride();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetNumPositionStepsOverride(uint)"/>
|
|
public void SetNumPositionStepsOverride(uint value) =>
|
|
((ConstraintSettings)this).SetNumPositionStepsOverride(value);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetDrawConstraintSize()"/>
|
|
public float GetDrawConstraintSize() => ((ConstraintSettings)this).GetDrawConstraintSize();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetDrawConstraintSize(float)"/>
|
|
public void SetDrawConstraintSize(float value) => ((ConstraintSettings)this).SetDrawConstraintSize(value);
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.GetUserData()"/>
|
|
public ulong GetUserData() => ((ConstraintSettings)this).GetUserData();
|
|
|
|
/// <inheritdoc cref="ConstraintSettings.SetUserData(ulong)"/>
|
|
public void SetUserData(ulong value) => ((ConstraintSettings)this).SetUserData(value);
|
|
}
|
|
}
|