mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
172 lines
7.5 KiB
C#
172 lines
7.5 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>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L13">Jolt/Physics/Vehicle/VehicleDifferential.h:13</see>
|
|
/// <br/>
|
|
/// <c>class VehicleDifferentialSettings</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 24)]
|
|
public partial struct VehicleDifferentialSettings
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// Index (in mWheels) that represents the left wheel of this differential (can be -1 to indicate no wheel)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L31">Jolt/Physics/Vehicle/VehicleDifferential.h:31</see>
|
|
/// <br/>
|
|
/// <c>int mLeftWheel = -1</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(0)]
|
|
public int LeftWheel;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Index (in mWheels) that represents the right wheel of this differential (can be -1 to indicate no wheel)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L32">Jolt/Physics/Vehicle/VehicleDifferential.h:32</see>
|
|
/// <br/>
|
|
/// <c>int mRightWheel = -1</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(4)]
|
|
public int RightWheel;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Ratio between rotation speed of gear box and wheels
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L33">Jolt/Physics/Vehicle/VehicleDifferential.h:33</see>
|
|
/// <br/>
|
|
/// <c>float mDifferentialRatio = 3.42f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(8)]
|
|
public float DifferentialRatio;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Defines how the engine torque is split across the left and right wheel (0 = left, 0.5 = center, 1 =
|
|
/// right)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L34">Jolt/Physics/Vehicle/VehicleDifferential.h:34</see>
|
|
/// <br/>
|
|
/// <c>float mLeftRightSplit = 0.5f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(12)]
|
|
public float LeftRightSplit;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Ratio max / min wheel speed. When this ratio is exceeded, all torque gets distributed to the slowest
|
|
/// moving wheel. This allows implementing a limited slip differential. Set to FLT_MAX for an open
|
|
/// differential. Value should be > 1.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L35">Jolt/Physics/Vehicle/VehicleDifferential.h:35</see>
|
|
/// <br/>
|
|
/// <c>float mLimitedSlipRatio = 1.4f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(16)]
|
|
public float LimitedSlipRatio;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// How much of the engines torque is applied to this differential (0 = none, 1 = full), make sure the sum
|
|
/// of all differentials is 1.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L36">Jolt/Physics/Vehicle/VehicleDifferential.h:36</see>
|
|
/// <br/>
|
|
/// <c>float mEngineTorqueRatio = 1.0f</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(20)]
|
|
public float EngineTorqueRatio;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Saves the contents in binary form to inStream.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L19">Jolt/Physics/Vehicle/VehicleDifferential.h:19</see>
|
|
/// <br/>
|
|
/// <c>void SaveBinaryState(StreamOut &inStream) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public readonly void SaveBinaryState(StreamOut stream) =>
|
|
Jolt.PInvoke.VehicleDifferentialSettings_SaveBinaryState(ref Unsafe.AsRef(in this), stream);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Restores the contents in binary form to inStream.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L22">Jolt/Physics/Vehicle/VehicleDifferential.h:22</see>
|
|
/// <br/>
|
|
/// <c>void RestoreBinaryState(StreamIn &inStream)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public void RestoreBinaryState(StreamIn stream) =>
|
|
Jolt.PInvoke.VehicleDifferentialSettings_RestoreBinaryState(ref this, stream);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Calculate the torque ratio between left and right wheel
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleDifferential.h#L29">Jolt/Physics/Vehicle/VehicleDifferential.h:29</see>
|
|
/// <br/>
|
|
/// <c>void CalculateTorqueRatio(float inLeftAngularVelocity, float inRightAngularVelocity, float &outLeftTorqueFraction, float &outRightTorqueFraction) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Calculate the torque ratio between left and right wheel
|
|
/// @param inLeftAngularVelocity Angular velocity of left wheel (rad / s)
|
|
/// @param inRightAngularVelocity Angular velocity of right wheel (rad / s)
|
|
/// @param outLeftTorqueFraction Fraction of torque that should go to the left wheel
|
|
/// @param outRightTorqueFraction Fraction of torque that should go to the right wheel
|
|
/// </code>
|
|
/// </remarks>
|
|
public readonly void CalculateTorqueRatio(
|
|
float leftAngularVelocity,
|
|
float rightAngularVelocity,
|
|
out float leftTorqueFraction,
|
|
out float rightTorqueFraction
|
|
) =>
|
|
Jolt.PInvoke.VehicleDifferentialSettings_CalculateTorqueRatio(
|
|
ref Unsafe.AsRef(in this),
|
|
leftAngularVelocity,
|
|
rightAngularVelocity,
|
|
out leftTorqueFraction,
|
|
out rightTorqueFraction
|
|
);
|
|
}
|
|
}
|