// // Generated by Brutal.Jolt.Generate; do not edit by hand. #nullable enable using Brutal.Interop; using Brutal.Numerics; namespace Brutal.JoltApi { /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:113 ///
/// class ShapeCastResult : public CollideShapeResult ///
///
/// /// /// Result of a shape cast test /// /// [InteropHandle] public readonly partial struct ShapeCastResult : IDisposable { /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:119 ///
/// ShapeCastResult() = default ///
///
/// /// /// Default constructor /// /// public static ShapeCastResult Create() => Jolt.PInvoke.ShapeCastResult_Create(); /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:130 ///
/// ShapeCastResult(float inFraction, Vec3Arg inContactPoint1, Vec3Arg inContactPoint2, Vec3Arg inContactNormalOrPenetrationDepth, bool inBackFaceHit, const SubShapeID &inSubShapeID1, const SubShapeID &inSubShapeID2, const BodyID &inBodyID2) ///
///
/// /// /// 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 /// /// 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); /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:138 ///
/// inline float GetEarlyOutFraction() const ///
///
/// /// /// 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. /// /// public float GetEarlyOutFraction() => Jolt.PInvoke.ShapeCastResult_GetEarlyOutFraction(this); /// /// /// This is the fraction where the shape hit the other shape: CenterOfMassOnHit = Start + value * (End - /// Start) /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:169 ///
/// float mFraction ///
///
public float GetFraction() => Jolt.PInvoke.ShapeCastResult_GetFraction(this); /// /// /// This is the fraction where the shape hit the other shape: CenterOfMassOnHit = Start + value * (End - /// Start) /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:169 ///
/// float mFraction ///
///
public void SetFraction(float value) => Jolt.PInvoke.ShapeCastResult_SetFraction(this, value); /// /// /// True if the shape was hit from the back side /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:170 ///
/// bool mIsBackFaceHit ///
///
public bool GetIsBackFaceHit() => Jolt.PInvoke.ShapeCastResult_GetIsBackFaceHit(this); /// /// /// True if the shape was hit from the back side /// /// /// C++: /// Jolt/Physics/Collision/ShapeCast.h:170 ///
/// bool mIsBackFaceHit ///
///
public void SetIsBackFaceHit(bool value) => Jolt.PInvoke.ShapeCastResult_SetIsBackFaceHit(this, value); public static implicit operator CollideShapeResult(ShapeCastResult value) => Jolt.PInvoke.ShapeCastResult_AsCollideShapeResult(value); public void Dispose() => Jolt.PInvoke.ShapeCastResult_Destroy(this); } }