// // 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 { /// /// /// Class that contains all information of two colliding shapes /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:18 ///
/// class CollideShapeResult ///
///
[StructLayout(LayoutKind.Explicit, Size = 1120)] public partial struct CollideShapeResult { /// /// /// Contact point on the surface of shape 1 (in world space or relative to base offset) /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:59 ///
/// Vec3 mContactPointOn1 ///
///
[FieldOffset(0)] public float3 ContactPointOn1; /// /// /// Contact point on the surface of shape 2 (in world space or relative to base offset). If the penetration /// depth is 0, this will be the same as mContactPointOn1. /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:60 ///
/// Vec3 mContactPointOn2 ///
///
[FieldOffset(16)] public float3 ContactPointOn2; /// /// /// Direction to move shape 2 out of collision along the shortest path (magnitude is meaningless, in world /// space). You can use -mPenetrationAxis.Normalized() as contact normal. /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:61 ///
/// Vec3 mPenetrationAxis ///
///
[FieldOffset(32)] public float3 PenetrationAxis; /// /// /// Penetration depth (move shape 2 by this distance to resolve the collision). If /// CollideShapeSettings::mMaxSeparationDistance > 0 this number can be negative to indicate that the /// objects are separated by -mPenetrationDepth. The contact points are the closest points in that case. /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:62 ///
/// float mPenetrationDepth ///
///
[FieldOffset(48)] public float PenetrationDepth; /// /// /// Sub shape ID that identifies the face on shape 1 /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:63 ///
/// SubShapeID mSubShapeID1 ///
///
[FieldOffset(52)] public uint SubShapeID1; /// /// /// Sub shape ID that identifies the face on shape 2 /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:64 ///
/// SubShapeID mSubShapeID2 ///
///
[FieldOffset(56)] public uint SubShapeID2; /// /// /// BodyID to which shape 2 belongs to /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:65 ///
/// BodyID mBodyID2 ///
///
[FieldOffset(60)] public uint BodyID2; /// /// /// Colliding face on shape 1 (optional result, in world space or relative to base offset) /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:66 ///
/// Face mShape1Face ///
///
[FieldOffset(64)] public StaticArrayVec3_32 Shape1Face; /// /// /// Colliding face on shape 2 (optional result, in world space or relative to base offset) /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:67 ///
/// Face mShape2Face ///
///
[FieldOffset(592)] public StaticArrayVec3_32 Shape2Face; /// /// /// Default constructor /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:24 ///
/// CollideShapeResult() = default ///
///
public static CollideShapeResult Create() => Jolt.PInvoke.CollideShapeResult_Create(); /// /// /// Constructor /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:27 ///
/// CollideShapeResult(Vec3Arg inContactPointOn1, Vec3Arg inContactPointOn2, Vec3Arg inPenetrationAxis, float inPenetrationDepth, const SubShapeID &inSubShapeID1, const SubShapeID &inSubShapeID2, const BodyID &inBodyID2) ///
///
public static CollideShapeResult Create( float3 contactPointOn1, float3 contactPointOn2, float3 penetrationAxis, float penetrationDepth, uint subShapeID1, uint subShapeID2, uint bodyID2 ) => Jolt.PInvoke.CollideShapeResult_Create_2( contactPointOn1, contactPointOn2, penetrationAxis, penetrationDepth, subShapeID1, subShapeID2, bodyID2 ); /// /// /// Function required by the CollisionCollector. A smaller fraction is considered to be a 'better hit'. We /// use -penetration depth to get the hit with the biggest penetration depth /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:39 ///
/// inline float GetEarlyOutFraction() const ///
///
public readonly float GetEarlyOutFraction() => Jolt.PInvoke.CollideShapeResult_GetEarlyOutFraction(ref Unsafe.AsRef(in this)); /// /// /// Reverses the hit result, swapping contact point 1 with contact point 2 etc. /// /// /// C++: /// Jolt/Physics/Collision/CollideShape.h:42 ///
/// inline CollideShapeResult Reversed() const ///
///
public readonly CollideShapeResult Reversed() => Jolt.PInvoke.CollideShapeResult_Reversed(ref Unsafe.AsRef(in this)); } }