mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
175 lines
6.8 KiB
C#
175 lines
6.8 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>
|
|
/// Result of a shape cast test
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L116">Jolt/Physics/Collision/ShapeCast.h:116</see>
|
|
/// <br/>
|
|
/// <c>class ShapeCastResult : public CollideShapeResult</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[StructLayout(LayoutKind.Explicit, Size = 1136)]
|
|
public partial struct ShapeCastResult
|
|
{
|
|
[FieldOffset(0)]
|
|
public float3 ContactPointOn1;
|
|
|
|
[FieldOffset(16)]
|
|
public float3 ContactPointOn2;
|
|
|
|
[FieldOffset(32)]
|
|
public float3 PenetrationAxis;
|
|
|
|
[FieldOffset(48)]
|
|
public float PenetrationDepth;
|
|
|
|
[FieldOffset(52)]
|
|
public uint SubShapeID1;
|
|
|
|
[FieldOffset(56)]
|
|
public uint SubShapeID2;
|
|
|
|
[FieldOffset(60)]
|
|
public uint BodyID2;
|
|
|
|
[FieldOffset(64)]
|
|
public StaticArrayVec3_32 Shape1Face;
|
|
|
|
[FieldOffset(592)]
|
|
public StaticArrayVec3_32 Shape2Face;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// This is the fraction where the shape hit the other shape: CenterOfMassOnHit = Start + value * (End -
|
|
/// Start)
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L172">Jolt/Physics/Collision/ShapeCast.h:172</see>
|
|
/// <br/>
|
|
/// <c>float mFraction</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(1120)]
|
|
public float Fraction;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// True if the shape was hit from the back side
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L173">Jolt/Physics/Collision/ShapeCast.h:173</see>
|
|
/// <br/>
|
|
/// <c>bool mIsBackFaceHit</c>
|
|
/// </para>
|
|
/// </summary>
|
|
[FieldOffset(1124)]
|
|
public Brutal.Bool8 IsBackFaceHit;
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Default constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L122">Jolt/Physics/Collision/ShapeCast.h:122</see>
|
|
/// <br/>
|
|
/// <c>ShapeCastResult() = default</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public static ShapeCastResult Create() => Jolt.PInvoke.ShapeCastResult_Create();
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Constructor
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L133">Jolt/Physics/Collision/ShapeCast.h:133</see>
|
|
/// <br/>
|
|
/// <c>ShapeCastResult(float inFraction, Vec3Arg inContactPoint1, Vec3Arg inContactPoint2, Vec3Arg inContactNormalOrPenetrationDepth, bool inBackFaceHit, const SubShapeID &inSubShapeID1, const SubShapeID &inSubShapeID2, const BodyID &inBodyID2)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Constructor
|
|
/// @param inFraction Fraction at which the cast hit
|
|
/// @param inContactPoint1 Contact point on shape 1
|
|
/// @param inContactPoint2 Contact point on shape 2
|
|
/// @param inContactNormalOrPenetrationDepth Contact normal pointing from shape 1 to 2 or penetration depth vector when the objects are penetrating (also from 1 to 2)
|
|
/// @param inBackFaceHit If this hit was a back face hit
|
|
/// @param inSubShapeID1 Sub shape id for shape 1
|
|
/// @param inSubShapeID2 Sub shape id for shape 2
|
|
/// @param inBodyID2 BodyID that was hit
|
|
/// </code>
|
|
/// </remarks>
|
|
public static ShapeCastResult Create(
|
|
float fraction,
|
|
float3 contactPoint1,
|
|
float3 contactPoint2,
|
|
float3 contactNormalOrPenetrationDepth,
|
|
bool backFaceHit,
|
|
uint subShapeID1,
|
|
uint subShapeID2,
|
|
uint bodyID2
|
|
) =>
|
|
Jolt.PInvoke.ShapeCastResult_Create_2(
|
|
fraction,
|
|
contactPoint1,
|
|
contactPoint2,
|
|
contactNormalOrPenetrationDepth,
|
|
backFaceHit,
|
|
subShapeID1,
|
|
subShapeID2,
|
|
bodyID2
|
|
);
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'. For
|
|
/// rays/cast shapes we can just use the collision fraction. The fraction and penetration depth are combined
|
|
/// in such a way that deeper hits at fraction 0 go first.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L141">Jolt/Physics/Collision/ShapeCast.h:141</see>
|
|
/// <br/>
|
|
/// <c>inline float GetEarlyOutFraction() const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
public readonly float GetEarlyOutFraction() =>
|
|
Jolt.PInvoke.ShapeCastResult_GetEarlyOutFraction(ref Unsafe.AsRef(in this));
|
|
|
|
/// <summary>
|
|
/// <para>
|
|
/// Reverses the hit result, swapping contact point 1 with contact point 2 etc.
|
|
/// </para>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/e77f175595e64cb44218cc9d9d56fc365ad0e36a/Jolt/Physics/Collision/ShapeCast.h#L145">Jolt/Physics/Collision/ShapeCast.h:145</see>
|
|
/// <br/>
|
|
/// <c>ShapeCastResult Reversed(Vec3Arg inWorldSpaceCastDirection) const</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <code>
|
|
/// Reverses the hit result, swapping contact point 1 with contact point 2 etc.
|
|
/// @param inWorldSpaceCastDirection Direction of the shape cast in world space
|
|
/// </code>
|
|
/// </remarks>
|
|
public readonly ShapeCastResult Reversed(float3 worldSpaceCastDirection) =>
|
|
Jolt.PInvoke.ShapeCastResult_Reversed(ref Unsafe.AsRef(in this), worldSpaceCastDirection);
|
|
}
|
|
}
|