mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
325 lines
15 KiB
C#
325 lines
15 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 controller class
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L89">Jolt/Physics/Vehicle/WheeledVehicleController.h:89</see>
|
|
/// <br/>
|
|
/// <c>class WheeledVehicleController : public VehicleController</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[InteropHandle]
|
|
public readonly partial struct WheeledVehicleController : IDisposable
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L95">Jolt/Physics/Vehicle/WheeledVehicleController.h:95</see>
|
|
/// <br/>
|
|
/// <c>WheeledVehicleController(const WheeledVehicleControllerSettings &inSettings, VehicleConstraint &inConstraint)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static WheeledVehicleController Create(
|
|
WheeledVehicleControllerSettings settings,
|
|
VehicleConstraint constraint
|
|
) => Jolt.PInvoke.WheeledVehicleController_Create(settings, constraint);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Set input from driver
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L105">Jolt/Physics/Vehicle/WheeledVehicleController.h:105</see>
|
|
/// <br/>
|
|
/// <c>void SetDriverInput(float inForward, float inRight, float inBrake, float inHandBrake)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Set input from driver
|
|
/// @param inForward Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving direction and amount the gas pedal is pressed
|
|
/// @param inRight Value between -1 and 1 indicating desired steering angle (1 = right)
|
|
/// @param inBrake Value between 0 and 1 indicating how strong the brake pedal is pressed
|
|
/// @param inHandBrake Value between 0 and 1 indicating how strong the hand brake is pulled
|
|
/// </code>
|
|
/// </remarks>
|
|
public void SetDriverInput(float forward, float right, float brake, float handBrake) =>
|
|
Jolt.PInvoke.WheeledVehicleController_SetDriverInput(this, forward, right, brake, handBrake);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving
|
|
/// direction and amount the gas pedal is pressed
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L108">Jolt/Physics/Vehicle/WheeledVehicleController.h:108</see>
|
|
/// <br/>
|
|
/// <c>void SetForwardInput(float inForward)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetForwardInput(float forward) =>
|
|
Jolt.PInvoke.WheeledVehicleController_SetForwardInput(this, forward);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L109">Jolt/Physics/Vehicle/WheeledVehicleController.h:109</see>
|
|
/// <br/>
|
|
/// <c>float GetForwardInput() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetForwardInput() => Jolt.PInvoke.WheeledVehicleController_GetForwardInput(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Value between -1 and 1 indicating desired steering angle (1 = right)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L112">Jolt/Physics/Vehicle/WheeledVehicleController.h:112</see>
|
|
/// <br/>
|
|
/// <c>void SetRightInput(float inRight)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetRightInput(float right) => Jolt.PInvoke.WheeledVehicleController_SetRightInput(this, right);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L113">Jolt/Physics/Vehicle/WheeledVehicleController.h:113</see>
|
|
/// <br/>
|
|
/// <c>float GetRightInput() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetRightInput() => Jolt.PInvoke.WheeledVehicleController_GetRightInput(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Value between 0 and 1 indicating how strong the brake pedal is pressed
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L116">Jolt/Physics/Vehicle/WheeledVehicleController.h:116</see>
|
|
/// <br/>
|
|
/// <c>void SetBrakeInput(float inBrake)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetBrakeInput(float brake) => Jolt.PInvoke.WheeledVehicleController_SetBrakeInput(this, brake);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L117">Jolt/Physics/Vehicle/WheeledVehicleController.h:117</see>
|
|
/// <br/>
|
|
/// <c>float GetBrakeInput() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetBrakeInput() => Jolt.PInvoke.WheeledVehicleController_GetBrakeInput(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Value between 0 and 1 indicating how strong the hand brake is pulled
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L120">Jolt/Physics/Vehicle/WheeledVehicleController.h:120</see>
|
|
/// <br/>
|
|
/// <c>void SetHandBrakeInput(float inHandBrake)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetHandBrakeInput(float handBrake) =>
|
|
Jolt.PInvoke.WheeledVehicleController_SetHandBrakeInput(this, handBrake);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L121">Jolt/Physics/Vehicle/WheeledVehicleController.h:121</see>
|
|
/// <br/>
|
|
/// <c>float GetHandBrakeInput() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetHandBrakeInput() => Jolt.PInvoke.WheeledVehicleController_GetHandBrakeInput(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get current engine state
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L124">Jolt/Physics/Vehicle/WheeledVehicleController.h:124</see>
|
|
/// <br/>
|
|
/// <c>const VehicleEngine & GetEngine() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public VehicleEngine GetEngine() => Jolt.PInvoke.WheeledVehicleController_GetEngine(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get current transmission state
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L130">Jolt/Physics/Vehicle/WheeledVehicleController.h:130</see>
|
|
/// <br/>
|
|
/// <c>const VehicleTransmission & GetTransmission() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public VehicleTransmission GetTransmission() => Jolt.PInvoke.WheeledVehicleController_GetTransmission(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the differentials this vehicle has (writable interface, allows you to make changes to the
|
|
/// configuration which will take effect the next time step)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L139">Jolt/Physics/Vehicle/WheeledVehicleController.h:139</see>
|
|
/// <br/>
|
|
/// <c>Differentials & GetDifferentials()</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<VehicleDifferentialSettings> GetDifferentials()
|
|
{
|
|
Jolt.PInvoke.WheeledVehicleController_GetDifferentials(this, out var _outResult);
|
|
return new Span<VehicleDifferentialSettings>((void*)_outResult.Data, checked((int)_outResult.Count));
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Ratio max / min average wheel speed of each differential (measured at the clutch).
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L142">Jolt/Physics/Vehicle/WheeledVehicleController.h:142</see>
|
|
/// <br/>
|
|
/// <c>float GetDifferentialLimitedSlipRatio() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetDifferentialLimitedSlipRatio() =>
|
|
Jolt.PInvoke.WheeledVehicleController_GetDifferentialLimitedSlipRatio(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L143">Jolt/Physics/Vehicle/WheeledVehicleController.h:143</see>
|
|
/// <br/>
|
|
/// <c>void SetDifferentialLimitedSlipRatio(float inV)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetDifferentialLimitedSlipRatio(float v) =>
|
|
Jolt.PInvoke.WheeledVehicleController_SetDifferentialLimitedSlipRatio(this, v);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Get the average wheel speed of all driven wheels (measured at the clutch)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L146">Jolt/Physics/Vehicle/WheeledVehicleController.h:146</see>
|
|
/// <br/>
|
|
/// <c>float GetWheelSpeedAtClutch() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public float GetWheelSpeedAtClutch() => Jolt.PInvoke.WheeledVehicleController_GetWheelSpeedAtClutch(this);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L151">Jolt/Physics/Vehicle/WheeledVehicleController.h:151</see>
|
|
/// <br/>
|
|
/// <c>void SetTireMaxImpulseCallback(const TireMaxImpulseCallback &inTireMaxImpulseCallback)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// tireMaxImpulseCallback: The callback is invoked from native code: it must be a static method marked
|
|
/// [UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])], and userData is passed back to it verbatim.
|
|
/// Jolt calls it without a null check, so null is rejected. The callback and userData are retained by the
|
|
/// native object until they are replaced or the owner is destroyed - keep whatever userData points at (a
|
|
/// GCHandle, an allocation) alive for at least that long, and don't free it at the end of the call.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe void SetTireMaxImpulseCallback(
|
|
delegate* unmanaged[Cdecl]<
|
|
uint,
|
|
float*,
|
|
float*,
|
|
float,
|
|
float,
|
|
float,
|
|
float,
|
|
float,
|
|
float,
|
|
nint,
|
|
void> tireMaxImpulseCallback,
|
|
nint tireMaxImpulseCallbackUserData
|
|
)
|
|
{
|
|
if (tireMaxImpulseCallback == null)
|
|
throw new ArgumentNullException(nameof(tireMaxImpulseCallback));
|
|
Jolt.PInvoke.WheeledVehicleController_SetTireMaxImpulseCallback(
|
|
this,
|
|
tireMaxImpulseCallback,
|
|
tireMaxImpulseCallbackUserData
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Debug drawing of RPM meter
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/WheeledVehicleController.h#L155">Jolt/Physics/Vehicle/WheeledVehicleController.h:155</see>
|
|
/// <br/>
|
|
/// <c>void SetRPMMeter(Vec3Arg inPosition, float inSize)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void SetRPMMeter(float3 position, float size) =>
|
|
Jolt.PInvoke.WheeledVehicleController_SetRPMMeter(this, position, size);
|
|
|
|
/// <inheritdoc cref="VehicleController.GetSettings()"/>
|
|
public VehicleControllerSettings GetSettings() => ((VehicleController)this).GetSettings();
|
|
|
|
public static implicit operator VehicleController(WheeledVehicleController value) =>
|
|
Unsafe.BitCast<WheeledVehicleController, VehicleController>(value);
|
|
|
|
public void Dispose() => Jolt.PInvoke.WheeledVehicleController_Destroy(this);
|
|
|
|
/// <inheritdoc cref="VehicleController.GetConstraint()"/>
|
|
public VehicleConstraint GetConstraint() => ((VehicleController)this).GetConstraint();
|
|
}
|
|
}
|