//
// 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
{
///
///
/// An infinite plane described by the formula X . Normal + Constant = 0.
///
///
/// C++:
/// Jolt/Geometry/Plane.h:10
///
/// class Plane
///
///
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct Plane
{
///
///
/// XYZ = normal, W = constant, plane: x . normal + constant = 0
///
///
/// C++:
/// Jolt/Geometry/Plane.h:101
///
/// Vec4 mNormalAndConstant
///
///
[FieldOffset(0)]
public float4 NormalAndConstant;
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Geometry/Plane.h:16
///
/// Plane() = default
///
///
public static Plane Create() => Jolt.PInvoke.Plane_Create();
///
///
/// C++:
/// Jolt/Geometry/Plane.h:17
///
/// explicit Plane(Vec4Arg inNormalAndConstant)
///
///
public static Plane Create(float4 normalAndConstant) => Jolt.PInvoke.Plane_Create_2(normalAndConstant);
///
///
/// C++:
/// Jolt/Geometry/Plane.h:18
///
/// Plane(Vec3Arg inNormal, float inConstant)
///
///
public static Plane Create(float3 normal, float constant) => Jolt.PInvoke.Plane_Create_3(normal, constant);
///
///
/// Create from point and normal
///
///
/// C++:
/// Jolt/Geometry/Plane.h:21
///
/// static Plane sFromPointAndNormal(Vec3Arg inPoint, Vec3Arg inNormal)
///
///
public static Plane FromPointAndNormal(float3 point, float3 normal) =>
Jolt.PInvoke.Plane_FromPointAndNormal(point, normal);
///
///
/// Create from point and normal, double precision version that more accurately calculates the plane
/// constant
///
///
/// C++:
/// Jolt/Geometry/Plane.h:24
///
/// static Plane sFromPointAndNormal(DVec3Arg inPoint, Vec3Arg inNormal)
///
///
public static Plane FromPointAndNormal(double3 point, float3 normal) =>
Jolt.PInvoke.Plane_FromPointAndNormal_2(point, normal);
///
///
/// Create from 3 counter clockwise points
///
///
/// C++:
/// Jolt/Geometry/Plane.h:27
///
/// static Plane sFromPointsCCW(Vec3Arg inV1, Vec3Arg inV2, Vec3Arg inV3)
///
///
public static Plane FromPointsCCW(float3 v1, float3 v2, float3 v3) =>
Jolt.PInvoke.Plane_FromPointsCCW(v1, v2, v3);
///
///
/// Properties
///
///
/// C++:
/// Jolt/Geometry/Plane.h:30
///
/// Vec3 GetNormal() const
///
///
public readonly float3 GetNormal() => Jolt.PInvoke.Plane_GetNormal(ref Unsafe.AsRef(in this));
///
///
/// C++:
/// Jolt/Geometry/Plane.h:31
///
/// void SetNormal(Vec3Arg inNormal)
///
///
public void SetNormal(float3 normal) => Jolt.PInvoke.Plane_SetNormal(ref this, normal);
///
///
/// C++:
/// Jolt/Geometry/Plane.h:32
///
/// float GetConstant() const
///
///
public readonly float GetConstant() => Jolt.PInvoke.Plane_GetConstant(ref Unsafe.AsRef(in this));
///
///
/// C++:
/// Jolt/Geometry/Plane.h:33
///
/// void SetConstant(float inConstant)
///
///
public void SetConstant(float constant) => Jolt.PInvoke.Plane_SetConstant(ref this, constant);
///
///
/// Store as 4 floats
///
///
/// C++:
/// Jolt/Geometry/Plane.h:36
///
/// void StoreFloat4(Float4 *outV) const
///
///
public readonly unsafe void StoreFloat4(Ptr v) =>
Jolt.PInvoke.Plane_StoreFloat4(ref Unsafe.AsRef(in this), v);
///
///
/// Offset the plane (positive value means move it in the direction of the plane normal)
///
///
/// C++:
/// Jolt/Geometry/Plane.h:39
///
/// Plane Offset(float inDistance) const
///
///
public readonly Plane Offset(float distance) => Jolt.PInvoke.Plane_Offset(ref Unsafe.AsRef(in this), distance);
///
///
/// Transform the plane by a matrix
///
///
/// C++:
/// Jolt/Geometry/Plane.h:42
///
/// inline Plane GetTransformed(Mat44Arg inTransform) const
///
///
public readonly Plane GetTransformed(in float4x4 transform) =>
Jolt.PInvoke.Plane_GetTransformed(ref Unsafe.AsRef(in this), in transform);
///
///
/// Scale the plane, can handle non-uniform and negative scaling
///
///
/// C++:
/// Jolt/Geometry/Plane.h:49
///
/// inline Plane Scaled(Vec3Arg inScale) const
///
///
public readonly Plane Scaled(float3 scale) => Jolt.PInvoke.Plane_Scaled(ref Unsafe.AsRef(in this), scale);
///
///
/// Distance point to plane
///
///
/// C++:
/// Jolt/Geometry/Plane.h:57
///
/// float SignedDistance(Vec3Arg inPoint) const
///
///
public readonly float SignedDistance(float3 point) =>
Jolt.PInvoke.Plane_SignedDistance(ref Unsafe.AsRef(in this), point);
///
///
/// Project inPoint onto the plane
///
///
/// C++:
/// Jolt/Geometry/Plane.h:60
///
/// Vec3 ProjectPointOnPlane(Vec3Arg inPoint) const
///
///
public readonly float3 ProjectPointOnPlane(float3 point) =>
Jolt.PInvoke.Plane_ProjectPointOnPlane(ref Unsafe.AsRef(in this), point);
///
///
/// Returns intersection point between 3 planes
///
///
/// C++:
/// Jolt/Geometry/Plane.h:63
///
/// static bool sIntersectPlanes(const Plane &inP1, const Plane &inP2, const Plane &inP3, Vec3 &outPoint)
///
///
public static bool IntersectPlanes(in Plane p1, in Plane p2, in Plane p3, out float3 point) =>
Jolt.PInvoke.Plane_IntersectPlanes(in p1, in p2, in p3, out point);
}
}