//
// 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
{
///
///
/// Axis aligned box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:15
///
/// class AABox
///
///
[StructLayout(LayoutKind.Explicit, Size = 32)]
public partial struct AABox
{
///
///
/// Bounding box min and max
///
///
/// C++:
/// Jolt/Geometry/AABox.h:309
///
/// Vec3 mMin
///
///
[FieldOffset(0)]
public float3 Min;
///
///
/// C++:
/// Jolt/Geometry/AABox.h:310
///
/// Vec3 mMax
///
///
[FieldOffset(16)]
public float3 Max;
///
///
/// Constructor
///
///
/// C++:
/// Jolt/Geometry/AABox.h:21
///
/// AABox()
///
///
public static AABox Create() => Jolt.PInvoke.AABox_Create();
///
///
/// C++:
/// Jolt/Geometry/AABox.h:22
///
/// AABox(Vec3Arg inMin, Vec3Arg inMax)
///
///
public static AABox Create(float3 min, float3 max) => Jolt.PInvoke.AABox_Create_2(min, max);
///
///
/// C++:
/// Jolt/Geometry/AABox.h:23
///
/// AABox(DVec3Arg inMin, DVec3Arg inMax)
///
///
public static AABox Create(double3 min, double3 max) => Jolt.PInvoke.AABox_Create_3(min, max);
///
///
/// C++:
/// Jolt/Geometry/AABox.h:24
///
/// AABox(Vec3Arg inCenter, float inRadius)
///
///
public static AABox Create(float3 center, float radius) => Jolt.PInvoke.AABox_Create_4(center, radius);
///
///
/// Create box from 2 points
///
///
/// C++:
/// Jolt/Geometry/AABox.h:27
///
/// static AABox sFromTwoPoints(Vec3Arg inP1, Vec3Arg inP2)
///
///
public static AABox FromTwoPoints(float3 p1, float3 p2) => Jolt.PInvoke.AABox_FromTwoPoints(p1, p2);
///
///
/// Create box from indexed triangle
///
///
/// C++:
/// Jolt/Geometry/AABox.h:30
///
/// static AABox sFromTriangle(const VertexList &inVertices, const IndexedTriangle &inTriangle)
///
///
///
///
/// vertices is copied into a native container for the call; the span is only read.
///
///
public static unsafe AABox FromTriangle(ReadOnlySpan vertices, in IndexedTriangle triangle)
{
fixed (float3* vertices_fixed = vertices)
{
return Jolt.PInvoke.AABox_FromTriangle(vertices_fixed, (nuint)vertices.Length, in triangle);
}
}
///
///
/// Get bounding box of size FLT_MAX
///
///
/// C++:
/// Jolt/Geometry/AABox.h:38
///
/// static AABox sBiggest()
///
///
public static AABox Biggest() => Jolt.PInvoke.AABox_Biggest();
///
///
/// Reset the bounding box to an empty bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:49
///
/// void SetEmpty()
///
///
public void SetEmpty() => Jolt.PInvoke.AABox_SetEmpty(ref this);
///
///
/// Check if the bounding box is valid (max >= min)
///
///
/// C++:
/// Jolt/Geometry/AABox.h:56
///
/// bool IsValid() const
///
///
public readonly bool IsValid() => Jolt.PInvoke.AABox_IsValid(ref Unsafe.AsRef(in this));
///
///
/// Encapsulate triangle in bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:87
///
/// void Encapsulate(const VertexList &inVertices, const IndexedTriangle &inTriangle)
///
///
///
///
/// vertices is copied into a native container for the call; the span is only read.
///
///
public unsafe void Encapsulate(ReadOnlySpan vertices, in IndexedTriangle triangle)
{
fixed (float3* vertices_fixed = vertices)
{
Jolt.PInvoke.AABox_Encapsulate(ref this, vertices_fixed, (nuint)vertices.Length, in triangle);
}
}
///
///
/// Encapsulate point in bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:62
///
/// void Encapsulate(Vec3Arg inPos)
///
///
public void Encapsulate(float3 pos) => Jolt.PInvoke.AABox_Encapsulate_2(ref this, pos);
///
///
/// Encapsulate bounding box in bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:69
///
/// void Encapsulate(const AABox &inRHS)
///
///
public void Encapsulate(in AABox rhs) => Jolt.PInvoke.AABox_Encapsulate_3(ref this, in rhs);
///
///
/// Encapsulate triangle in bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:76
///
/// void Encapsulate(const Triangle &inRHS)
///
///
public void Encapsulate(in Triangle rhs) => Jolt.PInvoke.AABox_Encapsulate_4(ref this, in rhs);
///
///
/// Intersect this bounding box with inOther, returns the intersection
///
///
/// C++:
/// Jolt/Geometry/AABox.h:94
///
/// AABox Intersect(const AABox &inOther) const
///
///
public readonly AABox Intersect(in AABox other) =>
Jolt.PInvoke.AABox_Intersect(ref Unsafe.AsRef(in this), in other);
///
///
/// Make sure that each edge of the bounding box has a minimal length
///
///
/// C++:
/// Jolt/Geometry/AABox.h:100
///
/// void EnsureMinimalEdgeLength(float inMinEdgeLength)
///
///
public void EnsureMinimalEdgeLength(float minEdgeLength) =>
Jolt.PInvoke.AABox_EnsureMinimalEdgeLength(ref this, minEdgeLength);
///
///
/// Widen the box on both sides by inVector
///
///
/// C++:
/// Jolt/Geometry/AABox.h:107
///
/// void ExpandBy(Vec3Arg inVector)
///
///
public void ExpandBy(float3 vector) => Jolt.PInvoke.AABox_ExpandBy(ref this, vector);
///
///
/// Get center of bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:114
///
/// Vec3 GetCenter() const
///
///
public readonly float3 GetCenter() => Jolt.PInvoke.AABox_GetCenter(ref Unsafe.AsRef(in this));
///
///
/// Get extent of bounding box (half of the size)
///
///
/// C++:
/// Jolt/Geometry/AABox.h:120
///
/// Vec3 GetExtent() const
///
///
public readonly float3 GetExtent() => Jolt.PInvoke.AABox_GetExtent(ref Unsafe.AsRef(in this));
///
///
/// Get size of bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:126
///
/// Vec3 GetSize() const
///
///
public readonly float3 GetSize() => Jolt.PInvoke.AABox_GetSize(ref Unsafe.AsRef(in this));
///
///
/// Get surface area of bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:132
///
/// float GetSurfaceArea() const
///
///
public readonly float GetSurfaceArea() => Jolt.PInvoke.AABox_GetSurfaceArea(ref Unsafe.AsRef(in this));
///
///
/// Get volume of bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:139
///
/// float GetVolume() const
///
///
public readonly float GetVolume() => Jolt.PInvoke.AABox_GetVolume(ref Unsafe.AsRef(in this));
///
///
/// Check if this box contains another box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:146
///
/// bool Contains(const AABox &inOther) const
///
///
public readonly bool Contains(in AABox other) =>
Jolt.PInvoke.AABox_Contains(ref Unsafe.AsRef(in this), in other);
///
///
/// Check if this box contains a point
///
///
/// C++:
/// Jolt/Geometry/AABox.h:152
///
/// bool Contains(Vec3Arg inOther) const
///
///
public readonly bool Contains(float3 other) => Jolt.PInvoke.AABox_Contains_2(ref Unsafe.AsRef(in this), other);
///
///
/// Check if this box contains a point
///
///
/// C++:
/// Jolt/Geometry/AABox.h:158
///
/// bool Contains(DVec3Arg inOther) const
///
///
public readonly bool Contains(double3 other) => Jolt.PInvoke.AABox_Contains_3(ref Unsafe.AsRef(in this), other);
///
///
/// Check if this box overlaps with another box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:164
///
/// bool Overlaps(const AABox &inOther) const
///
///
public readonly bool Overlaps(in AABox other) =>
Jolt.PInvoke.AABox_Overlaps(ref Unsafe.AsRef(in this), in other);
///
///
/// Check if this box overlaps with a plane
///
///
/// C++:
/// Jolt/Geometry/AABox.h:170
///
/// bool Overlaps(const Plane &inPlane) const
///
///
public readonly bool Overlaps(in Plane plane) =>
Jolt.PInvoke.AABox_Overlaps_2(ref Unsafe.AsRef(in this), in plane);
///
///
/// Translate bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:179
///
/// void Translate(Vec3Arg inTranslation)
///
///
public void Translate(float3 translation) => Jolt.PInvoke.AABox_Translate(ref this, translation);
///
///
/// Translate bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:186
///
/// void Translate(DVec3Arg inTranslation)
///
///
public void Translate(double3 translation) => Jolt.PInvoke.AABox_Translate_2(ref this, translation);
///
///
/// Transform bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:193
///
/// AABox Transformed(Mat44Arg inMatrix) const
///
///
public readonly AABox Transformed(in float4x4 matrix) =>
Jolt.PInvoke.AABox_Transformed(ref Unsafe.AsRef(in this), in matrix);
///
///
/// Transform bounding box
///
///
/// C++:
/// Jolt/Geometry/AABox.h:216
///
/// AABox Transformed(DMat44Arg inMatrix) const
///
///
public readonly AABox Transformed(in double4x4 matrix) =>
Jolt.PInvoke.AABox_Transformed_2(ref Unsafe.AsRef(in this), in matrix);
///
///
/// Scale this bounding box, can handle non-uniform and negative scaling
///
///
/// C++:
/// Jolt/Geometry/AABox.h:224
///
/// AABox Scaled(Vec3Arg inScale) const
///
///
public readonly AABox Scaled(float3 scale) => Jolt.PInvoke.AABox_Scaled(ref Unsafe.AsRef(in this), scale);
///
///
/// Calculate the support vector for this convex shape.
///
///
/// C++:
/// Jolt/Geometry/AABox.h:230
///
/// Vec3 GetSupport(Vec3Arg inDirection) const
///
///
public readonly float3 GetSupport(float3 direction) =>
Jolt.PInvoke.AABox_GetSupport(ref Unsafe.AsRef(in this), direction);
///
///
/// Get the closest point on or in this box to inPoint
///
///
/// C++:
/// Jolt/Geometry/AABox.h:297
///
/// Vec3 GetClosestPoint(Vec3Arg inPoint) const
///
///
public readonly float3 GetClosestPoint(float3 point) =>
Jolt.PInvoke.AABox_GetClosestPoint(ref Unsafe.AsRef(in this), point);
///
///
/// Get the squared distance between inPoint and this box (will be 0 if in Point is inside the box)
///
///
/// C++:
/// Jolt/Geometry/AABox.h:303
///
/// inline float GetSqDistanceTo(Vec3Arg inPoint) const
///
///
public readonly float GetSqDistanceTo(float3 point) =>
Jolt.PInvoke.AABox_GetSqDistanceTo(ref Unsafe.AsRef(in this), point);
}
}