Struct GorgonBoundingBox
Represents an axis-aligned bounding box in three dimensional space.
Inherited Members
Namespace: Gorgon.Renderers.Data
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonBoundingBox : IGorgonEquatableByRef<GorgonBoundingBox>, IEquatable<GorgonBoundingBox>
Constructors
| Edit this page View SourceGorgonBoundingBox(Vector3, Vector3)
Initializes a new instance of the GorgonBoundingBox struct.
Declaration
public GorgonBoundingBox(Vector3 minimum, Vector3 maximum)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | minimum | The minimum vertex of the bounding box. |
Vector3 | maximum | The maximum vertex of the bounding box. |
GorgonBoundingBox(float, float, float, float, float, float)
Initializes a new instance of the GorgonBoundingBox struct.
Declaration
public GorgonBoundingBox(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Parameters
Type | Name | Description |
---|---|---|
float | minX | The minimum x. |
float | minY | The minimum y. |
float | minZ | The minimum z. |
float | maxX | The maximum x. |
float | maxY | The maximum y. |
float | maxZ | The maximum z. |
Fields
| Edit this page View SourceEmpty
A default, empty, bounding box.
Declaration
public static readonly GorgonBoundingBox Empty
Field Value
Type | Description |
---|---|
GorgonBoundingBox |
Maximum
The maximum point of the box.
Declaration
public readonly Vector3 Maximum
Field Value
Type | Description |
---|---|
Vector3 |
Minimum
The minimum point of the box.
Declaration
public readonly Vector3 Minimum
Field Value
Type | Description |
---|---|
Vector3 |
Properties
| Edit this page View SourceBack
Property to return the back extent.
Declaration
public float Back { get; }
Property Value
Type | Description |
---|---|
float |
Bottom
Property to return the bottom extent.
Declaration
public float Bottom { get; }
Property Value
Type | Description |
---|---|
float |
BottomLeftBack
Property to return the bottom left point at the rear of the AABB.
Declaration
public Vector3 BottomLeftBack { get; }
Property Value
Type | Description |
---|---|
Vector3 |
BottomLeftFront
Property to return the bottom left point at the front of the AABB.
Declaration
public Vector3 BottomLeftFront { get; }
Property Value
Type | Description |
---|---|
Vector3 |
BottomRightBack
Property to return the bottom right point at the rear of the AABB.
Declaration
public Vector3 BottomRightBack { get; }
Property Value
Type | Description |
---|---|
Vector3 |
BottomRightFront
Property to return the bottom right point at the front of the AABB.
Declaration
public Vector3 BottomRightFront { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Center
Returns the size of the bounding box
Declaration
public Vector3 Center { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Depth
Returns the height of the bounding box
Declaration
public float Depth { get; }
Property Value
Type | Description |
---|---|
float |
Front
Property to return the front extent.
Declaration
public float Front { get; }
Property Value
Type | Description |
---|---|
float |
Height
Returns the height of the bounding box
Declaration
public float Height { get; }
Property Value
Type | Description |
---|---|
float |
IsEmpty
Property to return whether the AABB is empty or not.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
this[int]
Property to return each of the 8 corners for the AABB.
Declaration
public Vector3 this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index |
Property Value
Type | Description |
---|---|
Vector3 |
Left
Property to return the left extent.
Declaration
public float Left { get; }
Property Value
Type | Description |
---|---|
float |
Right
Property to return the right extent.
Declaration
public float Right { get; }
Property Value
Type | Description |
---|---|
float |
Size
Returns the size of the bounding box
Declaration
public Vector3 Size { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Top
Property to return the top extent.
Declaration
public float Top { get; }
Property Value
Type | Description |
---|---|
float |
TopLeftBack
Property to return the top left point at the rear of the AABB.
Declaration
public Vector3 TopLeftBack { get; }
Property Value
Type | Description |
---|---|
Vector3 |
TopLeftFront
Property to return the top left point at the front of the AABB.
Declaration
public Vector3 TopLeftFront { get; }
Property Value
Type | Description |
---|---|
Vector3 |
TopRightBack
Property to return the top right point at the rear of the AABB.
Declaration
public Vector3 TopRightBack { get; }
Property Value
Type | Description |
---|---|
Vector3 |
TopRightFront
Property to return the top right point at the front of the AABB.
Declaration
public Vector3 TopRightFront { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Width
Returns the width of the bounding box
Declaration
public float Width { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceEquals(GorgonBoundingBox)
Determines whether the specified Vector4 is equal to this instance.
Declaration
public bool Equals(GorgonBoundingBox value)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | value | The Vector4 to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Equals(in GorgonBoundingBox)
Function to compare this instance with another.
Declaration
public bool Equals(in GorgonBoundingBox other)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
| Edit this page View SourceFromPoints(Span<Vector3>, out GorgonBoundingBox)
Constructs a GorgonBoundingBox that fully contains the given points.
Declaration
public static void FromPoints(Span<Vector3> points, out GorgonBoundingBox result)
Parameters
Type | Name | Description |
---|---|---|
Span<Vector3> | points | The points that will be contained by the box. |
GorgonBoundingBox | result | When the method completes, contains the newly constructed bounding box. |
FromSphere(in GorgonBoundingSphere, out GorgonBoundingBox)
Constructs a GorgonBoundingBox from a given sphere.
Declaration
public static void FromSphere(in GorgonBoundingSphere sphere, out GorgonBoundingBox result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingSphere | sphere | The sphere that will designate the extents of the box. |
GorgonBoundingBox | result | When the method completes, contains the newly constructed bounding box. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Edit this page View SourceIntersect(in GorgonBoundingBox, in GorgonBoundingBox, out GorgonBoundingBox)
Function to intersect two Axis Aligned Bounding Boxes.
Declaration
public static void Intersect(in GorgonBoundingBox aabb1, in GorgonBoundingBox aabb2, out GorgonBoundingBox result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | aabb1 | The first axis aligned bounding box. |
GorgonBoundingBox | aabb2 | The second axis aligned bounding box. |
GorgonBoundingBox | result | The intersection of both bounding boxes. |
Merge(in GorgonBoundingBox, in GorgonBoundingBox, out GorgonBoundingBox)
Constructs a GorgonBoundingBox that is as large as the total combined area of the two specified boxes.
Declaration
public static void Merge(in GorgonBoundingBox value1, in GorgonBoundingBox value2, out GorgonBoundingBox result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | value1 | The first box to merge. |
GorgonBoundingBox | value2 | The second box to merge. |
GorgonBoundingBox | result | When the method completes, contains the newly constructed bounding box. |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
| Edit this page View SourceTransform(in GorgonBoundingBox, in Matrix4x4, out GorgonBoundingBox)
Function to transform an AABB by a world matrix.
Declaration
public static void Transform(in GorgonBoundingBox aabb, in Matrix4x4 worldMatrix, out GorgonBoundingBox result)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | aabb | The axis aligned bounding box to transform. |
Matrix4x4 | worldMatrix | The world matrix to multiply by. |
GorgonBoundingBox | result | The new transformed axis aligned bounding box. |
Operators
| Edit this page View Sourceoperator ==(in GorgonBoundingBox, in GorgonBoundingBox)
Tests for equality between two objects.
Declaration
public static bool operator ==(in GorgonBoundingBox left, in GorgonBoundingBox right)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | left | The first value to compare. |
GorgonBoundingBox | right | The second value to compare. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(in GorgonBoundingBox, in GorgonBoundingBox)
Tests for inequality between two objects.
Declaration
public static bool operator !=(in GorgonBoundingBox left, in GorgonBoundingBox right)
Parameters
Type | Name | Description |
---|---|---|
GorgonBoundingBox | left | The first value to compare. |
GorgonBoundingBox | right | The second value to compare. |
Returns
Type | Description |
---|---|
bool |
|