//
// 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
{
///
///
/// Wheel object specifically for TrackedVehicleController
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:32
///
/// class WheelTV : public Wheel
///
///
[InteropHandle]
public readonly partial struct WheelTV : IDisposable
{
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:38
///
/// explicit WheelTV(const WheelSettingsTV &inWheel)
///
///
public static WheelTV Create(WheelSettingsTV wheel) => Jolt.PInvoke.WheelTV_Create(wheel);
///
///
/// Override GetSettings and cast to the correct class
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:41
///
/// const WheelSettingsTV * GetSettings() const
///
///
///
///
/// The returned handle carries its own reference; Dispose it once when you're done.
///
///
public WheelSettingsTV GetSettings() => Jolt.PInvoke.WheelTV_GetSettings(this);
///
///
/// Update the angular velocity of the wheel based on the angular velocity of the track
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:44
///
/// void CalculateAngularVelocity(const VehicleConstraint &inConstraint)
///
///
public void CalculateAngularVelocity(VehicleConstraint constraint) =>
Jolt.PInvoke.WheelTV_CalculateAngularVelocity(this, constraint);
///
///
/// Update the wheel rotation based on the current angular velocity
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:47
///
/// void Update(uint inWheelIndex, float inDeltaTime, const VehicleConstraint &inConstraint)
///
///
public void Update(uint wheelIndex, float deltaTime, VehicleConstraint constraint)
{
Jolt.PInvoke.WheelTV_Update(this, wheelIndex, deltaTime, constraint, out var _inRange);
if (_inRange == 0)
throw new ArgumentOutOfRangeException(
nameof(wheelIndex),
wheelIndex,
"Expected an index below the number of wheels."
);
}
///
///
/// Index in mTracks to which this wheel is attached (calculated on initialization)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:49
///
/// int mTrackIndex = -1
///
///
public int GetTrackIndex() => Jolt.PInvoke.WheelTV_GetTrackIndex(this);
///
///
/// Index in mTracks to which this wheel is attached (calculated on initialization)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:49
///
/// int mTrackIndex = -1
///
///
public void SetTrackIndex(int value) => Jolt.PInvoke.WheelTV_SetTrackIndex(this, value);
///
///
/// Combined friction coefficient in longitudinal direction (combines terrain and track)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:50
///
/// float mCombinedLongitudinalFriction = 0.0f
///
///
public float GetCombinedLongitudinalFriction() => Jolt.PInvoke.WheelTV_GetCombinedLongitudinalFriction(this);
///
///
/// Combined friction coefficient in longitudinal direction (combines terrain and track)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:50
///
/// float mCombinedLongitudinalFriction = 0.0f
///
///
public void SetCombinedLongitudinalFriction(float value) =>
Jolt.PInvoke.WheelTV_SetCombinedLongitudinalFriction(this, value);
///
///
/// Combined friction coefficient in lateral direction (combines terrain and track)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:51
///
/// float mCombinedLateralFriction = 0.0f
///
///
public float GetCombinedLateralFriction() => Jolt.PInvoke.WheelTV_GetCombinedLateralFriction(this);
///
///
/// Combined friction coefficient in lateral direction (combines terrain and track)
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:51
///
/// float mCombinedLateralFriction = 0.0f
///
///
public void SetCombinedLateralFriction(float value) =>
Jolt.PInvoke.WheelTV_SetCombinedLateralFriction(this, value);
///
///
/// Amount of impulse that the brakes can apply to the floor (excluding friction), spread out from brake
/// impulse applied on track
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:52
///
/// float mBrakeImpulse = 0.0f
///
///
public float GetBrakeImpulse() => Jolt.PInvoke.WheelTV_GetBrakeImpulse(this);
///
///
/// Amount of impulse that the brakes can apply to the floor (excluding friction), spread out from brake
/// impulse applied on track
///
///
/// C++:
/// Jolt/Physics/Vehicle/TrackedVehicleController.h:52
///
/// float mBrakeImpulse = 0.0f
///
///
public void SetBrakeImpulse(float value) => Jolt.PInvoke.WheelTV_SetBrakeImpulse(this, value);
public static implicit operator Wheel(WheelTV value) => Unsafe.BitCast(value);
public void Dispose() => Jolt.PInvoke.WheelTV_Destroy(this);
///
public float GetAngularVelocity() => ((Wheel)this).GetAngularVelocity();
///
public void SetAngularVelocity(float vel) => ((Wheel)this).SetAngularVelocity(vel);
///
public float GetRotationAngle() => ((Wheel)this).GetRotationAngle();
///
public void SetRotationAngle(float angle) => ((Wheel)this).SetRotationAngle(angle);
///
public float GetSteerAngle() => ((Wheel)this).GetSteerAngle();
///
public void SetSteerAngle(float angle) => ((Wheel)this).SetSteerAngle(angle);
///
public bool HasContact() => ((Wheel)this).HasContact();
///
public uint GetContactBodyID() => ((Wheel)this).GetContactBodyID();
///
public uint GetContactSubShapeID() => ((Wheel)this).GetContactSubShapeID();
///
public float3 GetContactPosition() => ((Wheel)this).GetContactPosition();
///
public float3 GetContactPointVelocity() => ((Wheel)this).GetContactPointVelocity();
///
public float3 GetContactNormal() => ((Wheel)this).GetContactNormal();
///
public float3 GetContactLongitudinal() => ((Wheel)this).GetContactLongitudinal();
///
public float3 GetContactLateral() => ((Wheel)this).GetContactLateral();
///
public float GetSuspensionLength() => ((Wheel)this).GetSuspensionLength();
///
public bool HasHitHardPoint() => ((Wheel)this).HasHitHardPoint();
///
public float GetSuspensionLambda() => ((Wheel)this).GetSuspensionLambda();
///
public float GetLongitudinalLambda() => ((Wheel)this).GetLongitudinalLambda();
///
public float GetLateralLambda() => ((Wheel)this).GetLateralLambda();
///
public bool SolveLongitudinalConstraintPart(VehicleConstraint constraint, float minImpulse, float maxImpulse) =>
((Wheel)this).SolveLongitudinalConstraintPart(constraint, minImpulse, maxImpulse);
///
public bool SolveLateralConstraintPart(VehicleConstraint constraint, float minImpulse, float maxImpulse) =>
((Wheel)this).SolveLateralConstraintPart(constraint, minImpulse, maxImpulse);
}
}