brutal/Brutal.Jolt/Generated/Classes/VehicleCollisionTester.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

282 lines
13 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>
/// Class that does collision detection between wheels and ground
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L19">Jolt/Physics/Vehicle/VehicleCollisionTester.h:19</see>
/// <br/>
/// <c>class VehicleCollisionTester : public RefTarget&lt;VehicleCollisionTester&gt;, public NonCopyable</c>
/// </para>
/// </summary>
[InteropHandle]
public readonly partial struct VehicleCollisionTester : IDisposable
{
/// <summary>
/// <para>
/// Object layer to use for collision detection, this is used when the filters are not overridden
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L32">Jolt/Physics/Vehicle/VehicleCollisionTester.h:32</see>
/// <br/>
/// <c>ObjectLayer GetObjectLayer() const</c>
/// </para>
/// </summary>
public ushort GetObjectLayer() => Jolt.PInvoke.VehicleCollisionTester_GetObjectLayer(this);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L33">Jolt/Physics/Vehicle/VehicleCollisionTester.h:33</see>
/// <br/>
/// <c>void SetObjectLayer(ObjectLayer inObjectLayer)</c>
/// </para>
/// </summary>
public void SetObjectLayer(ushort objectLayer) =>
Jolt.PInvoke.VehicleCollisionTester_SetObjectLayer(this, objectLayer);
/// <summary>
/// <para>
/// Access to the broad phase layer filter, when set this overrides the object layer supplied in the
/// constructor
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L36">Jolt/Physics/Vehicle/VehicleCollisionTester.h:36</see>
/// <br/>
/// <c>void SetBroadPhaseLayerFilter(const BroadPhaseLayerFilter *inFilter)</c>
/// </para>
/// </summary>
public void SetBroadPhaseLayerFilter(BroadPhaseLayerFilter filter) =>
Jolt.PInvoke.VehicleCollisionTester_SetBroadPhaseLayerFilter(this, filter);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L37">Jolt/Physics/Vehicle/VehicleCollisionTester.h:37</see>
/// <br/>
/// <c>const BroadPhaseLayerFilter * GetBroadPhaseLayerFilter() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// The returned handle is borrowed from its owner; don't Dispose it.
/// </para>
/// </remarks>
public BroadPhaseLayerFilter GetBroadPhaseLayerFilter() =>
Jolt.PInvoke.VehicleCollisionTester_GetBroadPhaseLayerFilter(this);
/// <summary>
/// <para>
/// Access to the object layer filter, when set this overrides the object layer supplied in the constructor
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L40">Jolt/Physics/Vehicle/VehicleCollisionTester.h:40</see>
/// <br/>
/// <c>void SetObjectLayerFilter(const ObjectLayerFilter *inFilter)</c>
/// </para>
/// </summary>
public void SetObjectLayerFilter(ObjectLayerFilter filter) =>
Jolt.PInvoke.VehicleCollisionTester_SetObjectLayerFilter(this, filter);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L41">Jolt/Physics/Vehicle/VehicleCollisionTester.h:41</see>
/// <br/>
/// <c>const ObjectLayerFilter * GetObjectLayerFilter() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// The returned handle is borrowed from its owner; don't Dispose it.
/// </para>
/// </remarks>
public ObjectLayerFilter GetObjectLayerFilter() =>
Jolt.PInvoke.VehicleCollisionTester_GetObjectLayerFilter(this);
/// <summary>
/// <para>
/// Access to the body filter, when set this overrides the default filter that filters out the vehicle body
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L44">Jolt/Physics/Vehicle/VehicleCollisionTester.h:44</see>
/// <br/>
/// <c>void SetBodyFilter(const BodyFilter *inFilter)</c>
/// </para>
/// </summary>
public void SetBodyFilter(BodyFilter filter) => Jolt.PInvoke.VehicleCollisionTester_SetBodyFilter(this, filter);
/// <summary>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L45">Jolt/Physics/Vehicle/VehicleCollisionTester.h:45</see>
/// <br/>
/// <c>const BodyFilter * GetBodyFilter() const</c>
/// </para>
/// </summary>
/// <remarks>
/// <para>
/// The returned handle is borrowed from its owner; don't Dispose it.
/// </para>
/// </remarks>
public BodyFilter GetBodyFilter() => Jolt.PInvoke.VehicleCollisionTester_GetBodyFilter(this);
/// <summary>
/// <para>
/// Do a collision test with the world
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L60">Jolt/Physics/Vehicle/VehicleCollisionTester.h:60</see>
/// <br/>
/// <c>virtual bool Collide(PhysicsSystem &amp;inPhysicsSystem, const VehicleConstraint &amp;inVehicleConstraint, uint inWheelIndex, RVec3Arg inOrigin, Vec3Arg inDirection, const BodyID &amp;inVehicleBodyID, Body *&amp;outBody, SubShapeID &amp;outSubShapeID, RVec3 &amp;outContactPosition, Vec3 &amp;outContactNormal, float &amp;outSuspensionLength) const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Do a collision test with the world
/// @param inPhysicsSystem The physics system that should be tested against
/// @param inVehicleConstraint The vehicle constraint
/// @param inWheelIndex Index of the wheel that we're testing collision for
/// @param inOrigin Origin for the test, corresponds to the world space position for the suspension attachment point
/// @param inDirection Direction for the test (unit vector, world space)
/// @param inVehicleBodyID This body should be filtered out during collision detection to avoid self collisions
/// @param outBody Body that the wheel collided with
/// @param outSubShapeID Sub shape ID that the wheel collided with
/// @param outContactPosition Contact point between wheel and floor, in world space
/// @param outContactNormal Contact normal between wheel and floor, pointing away from the floor
/// @param outSuspensionLength New length of the suspension [0, inSuspensionMaxLength]
/// @return True when collision found, false if not
/// </code>
/// </remarks>
public bool Collide(
PhysicsSystem physicsSystem,
VehicleConstraint vehicleConstraint,
uint wheelIndex,
float3 origin,
float3 direction,
uint vehicleBodyID,
out Body body,
out uint subShapeID,
out float3 contactPosition,
out float3 contactNormal,
out float suspensionLength
)
{
var _result = Jolt.PInvoke.VehicleCollisionTester_Collide(
this,
physicsSystem,
vehicleConstraint,
wheelIndex,
origin,
direction,
vehicleBodyID,
out body,
out subShapeID,
out contactPosition,
out contactNormal,
out suspensionLength,
out var _inRange
);
if (_inRange == 0)
throw new ArgumentOutOfRangeException(
nameof(wheelIndex),
wheelIndex,
"Expected an index below the number of wheels."
);
return _result;
}
/// <summary>
/// <para>
/// Do a cheap contact properties prediction based on the contact properties from the last collision test
/// (provided as input parameters)
/// </para>
/// <para>
/// C++:
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Vehicle/VehicleCollisionTester.h#L74">Jolt/Physics/Vehicle/VehicleCollisionTester.h:74</see>
/// <br/>
/// <c>virtual void PredictContactProperties(PhysicsSystem &amp;inPhysicsSystem, const VehicleConstraint &amp;inVehicleConstraint, uint inWheelIndex, RVec3Arg inOrigin, Vec3Arg inDirection, const BodyID &amp;inVehicleBodyID, Body *&amp;ioBody, SubShapeID &amp;ioSubShapeID, RVec3 &amp;ioContactPosition, Vec3 &amp;ioContactNormal, float &amp;ioSuspensionLength) const = 0</c>
/// </para>
/// </summary>
/// <remarks>
/// <code>
/// Do a cheap contact properties prediction based on the contact properties from the last collision test (provided as input parameters)
/// @param inPhysicsSystem The physics system that should be tested against
/// @param inVehicleConstraint The vehicle constraint
/// @param inWheelIndex Index of the wheel that we're testing collision for
/// @param inOrigin Origin for the test, corresponds to the world space position for the suspension attachment point
/// @param inDirection Direction for the test (unit vector, world space)
/// @param inVehicleBodyID The body ID for the vehicle itself
/// @param ioBody Body that the wheel previously collided with
/// @param ioSubShapeID Sub shape ID that the wheel collided with during the last check
/// @param ioContactPosition Contact point between wheel and floor during the last check, in world space
/// @param ioContactNormal Contact normal between wheel and floor during the last check, pointing away from the floor
/// @param ioSuspensionLength New length of the suspension [0, inSuspensionMaxLength]
/// </code>
/// </remarks>
public void PredictContactProperties(
PhysicsSystem physicsSystem,
VehicleConstraint vehicleConstraint,
uint wheelIndex,
float3 origin,
float3 direction,
uint vehicleBodyID,
ref Body body,
ref uint subShapeID,
ref float3 contactPosition,
ref float3 contactNormal,
ref float suspensionLength
)
{
Jolt.PInvoke.VehicleCollisionTester_PredictContactProperties(
this,
physicsSystem,
vehicleConstraint,
wheelIndex,
origin,
direction,
vehicleBodyID,
ref body,
ref subShapeID,
ref contactPosition,
ref contactNormal,
ref suspensionLength,
out var _inRange
);
if (_inRange == 0)
throw new ArgumentOutOfRangeException(
nameof(wheelIndex),
wheelIndex,
"Expected an index below the number of wheels."
);
}
public void AddRef() => Jolt.PInvoke.VehicleCollisionTester_AddRef(this);
public void Release() => Jolt.PInvoke.VehicleCollisionTester_Release(this);
public uint GetRefCount() => Jolt.PInvoke.VehicleCollisionTester_GetRefCount(this);
public void Dispose()
{
if (IsNull())
return;
Release();
}
}
}