Struct BoundingBox
Represents a bounding box.
Namespace: Evergine.Mathematics
Assembly: Evergine.Mathematics.dll
Syntax
public struct BoundingBoxConstructors
BoundingBox(Vector3, Vector3)
Initializes a new instance of the BoundingBox struct.
Declaration
public BoundingBox(Vector3 min, Vector3 max)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3 | min | The minimum value. | 
| Vector3 | max | The maximum value. | 
Fields
CornerCount
The number of corners.
Declaration
public const int CornerCount = 8Field Value
| Type | Description | 
|---|---|
| int | 
Max
Bounding box maximum.
Declaration
public Vector3 MaxField Value
| Type | Description | 
|---|---|
| Vector3 | 
Min
Bounding box minimum.
Declaration
public Vector3 MinField Value
| Type | Description | 
|---|---|
| Vector3 | 
Properties
Center
Gets the center of the bounding box.
Declaration
public Vector3 Center { get; }Property Value
| Type | Description | 
|---|---|
| Vector3 | 
HalfExtent
Gets the bounding box half extents.
Declaration
public Vector3 HalfExtent { get; }Property Value
| Type | Description | 
|---|---|
| Vector3 | 
Methods
Contains(BoundingBox)
Determines whether [contains] [the specified box].
Declaration
public ContainmentType Contains(BoundingBox box)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box. | 
Returns
| Type | Description | 
|---|---|
| ContainmentType | The result. | 
Contains(ref BoundingBox, out ContainmentType)
Determines whether the specified box is contained.
Declaration
public void Contains(ref BoundingBox box, out ContainmentType result)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box. | 
| ContainmentType | result | The result. | 
Contains(BoundingFrustum)
Determines whether the specified frustum is contained.
Declaration
public ContainmentType Contains(BoundingFrustum frustum)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingFrustum | frustum | The frustum. | 
Returns
| Type | Description | 
|---|---|
| ContainmentType | The result. | 
Contains(BoundingSphere)
Determines whether the specified sphere is contained.
Declaration
public ContainmentType Contains(BoundingSphere sphere)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
Returns
| Type | Description | 
|---|---|
| ContainmentType | The result. | 
Contains(ref BoundingSphere, out ContainmentType)
Determines whether the specified sphere is contained.
Declaration
public void Contains(ref BoundingSphere sphere, out ContainmentType result)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
| ContainmentType | result | The result. | 
Contains(Vector3)
Determines whether the specified point is contained.
Declaration
public ContainmentType Contains(Vector3 point)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3 | point | The point. | 
Returns
| Type | Description | 
|---|---|
| ContainmentType | The result. | 
Contains(ref Vector3, out ContainmentType)
Determines whether the specified point is contained.
Declaration
public void Contains(ref Vector3 point, out ContainmentType result)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3 | point | The point. | 
| ContainmentType | result | The result. | 
CreateFromPoints(IEnumerable<Vector3>)
Creates from points.
Declaration
public static BoundingBox CreateFromPoints(IEnumerable<Vector3> points)Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<Vector3> | points | The points. | 
Returns
| Type | Description | 
|---|---|
| BoundingBox | The result. | 
CreateFromSphere(BoundingSphere)
Creates from a sphere.
Declaration
public static BoundingBox CreateFromSphere(BoundingSphere sphere)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
Returns
| Type | Description | 
|---|---|
| BoundingBox | The result. | 
CreateFromSphere(ref BoundingSphere, out BoundingBox)
Creates from a sphere.
Declaration
public static void CreateFromSphere(ref BoundingSphere sphere, out BoundingBox result)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
| BoundingBox | result | The result. | 
CreateMerged(BoundingBox, BoundingBox)
Creates the merged result.
Declaration
public static BoundingBox CreateMerged(BoundingBox original, BoundingBox additional)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | original | The original value. | 
| BoundingBox | additional | The additional value. | 
Returns
| Type | Description | 
|---|---|
| BoundingBox | The result. | 
CreateMerged(ref BoundingBox, ref BoundingBox, out BoundingBox)
Creates the merged.
Declaration
public static void CreateMerged(ref BoundingBox original, ref BoundingBox additional, out BoundingBox result)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | original | The original. | 
| BoundingBox | additional | The additional. | 
| BoundingBox | result | The result. | 
Equals(BoundingBox)
Equals the specified other.
Declaration
public bool Equals(BoundingBox other)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | other | The other. | 
Returns
| Type | Description | 
|---|---|
| bool | The result. | 
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| object | obj | The object to compare with this instance. | 
Returns
| Type | Description | 
|---|---|
| bool | 
 | 
Overrides
GetCorners()
Gets the corners.
Declaration
public Vector3[] GetCorners()Returns
| Type | Description | 
|---|---|
| Vector3[] | The result. | 
GetCorners(Vector3[])
Gets the corners.
Declaration
public void GetCorners(Vector3[] corners)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3[] | corners | The corners. | 
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 such as a hash table. | 
Overrides
Intersects(BoundingBox)
Intersects the specified box.
Declaration
public bool Intersects(BoundingBox box)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box. | 
Returns
| Type | Description | 
|---|---|
| bool | The result. | 
Intersects(ref BoundingBox)
Intersects the specified box.
Declaration
public bool Intersects(ref BoundingBox box)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | box | The box. | 
Returns
| Type | Description | 
|---|---|
| bool | True if the boxes overlap. | 
Intersects(BoundingFrustum)
Intersects the specified frustum.
Declaration
public bool Intersects(BoundingFrustum frustum)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingFrustum | frustum | The frustum. | 
Returns
| Type | Description | 
|---|---|
| bool | The result. | 
Intersects(BoundingSphere)
Intersects the specified sphere.
Declaration
public bool Intersects(BoundingSphere sphere)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
Returns
| Type | Description | 
|---|---|
| bool | The result. | 
Intersects(ref BoundingSphere, out bool)
Intersects the specified sphere.
Declaration
public void Intersects(ref BoundingSphere sphere, out bool result)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingSphere | sphere | The sphere. | 
| bool | result | If set to  | 
Intersects(Plane)
Intersects the specified plane.
Declaration
public PlaneIntersectionType Intersects(Plane plane)Parameters
| Type | Name | Description | 
|---|---|---|
| Plane | plane | The plane. | 
Returns
| Type | Description | 
|---|---|
| PlaneIntersectionType | The result. | 
Intersects(ref Plane, out PlaneIntersectionType)
Intersects the specified plane.
Declaration
public void Intersects(ref Plane plane, out PlaneIntersectionType result)Parameters
| Type | Name | Description | 
|---|---|---|
| Plane | plane | The plane. | 
| PlaneIntersectionType | result | The result. | 
Intersects(Ray)
Intersects the specified ray.
Declaration
public float? Intersects(Ray ray)Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | ray | The ray. | 
Returns
| Type | Description | 
|---|---|
| float? | The result. | 
Intersects(ref Ray, out float?)
Intersects the specified ray.
Declaration
public void Intersects(ref Ray ray, out float? result)Parameters
| Type | Name | Description | 
|---|---|---|
| Ray | ray | The ray. | 
| float? | result | The result. | 
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()Returns
| Type | Description | 
|---|---|
| string | A string that represents this instance. | 
Overrides
Transform(BoundingBox, Matrix4x4)
Transforms a bounding box.
Declaration
public static BoundingBox Transform(BoundingBox boundingBox, Matrix4x4 m)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | boundingBox | The bounding box. | 
| Matrix4x4 | m | The matrix transform. | 
Returns
| Type | Description | 
|---|---|
| BoundingBox | The transformed bounding box. | 
Transform(Matrix4x4)
Transforms a bounding box.
Declaration
public void Transform(Matrix4x4 m)Parameters
| Type | Name | Description | 
|---|---|---|
| Matrix4x4 | m | The transformation. | 
Transform(ref Matrix4x4)
Transforms a bounding box.
Declaration
public void Transform(ref Matrix4x4 m)Parameters
| Type | Name | Description | 
|---|---|---|
| Matrix4x4 | m | The transform. | 
WithMergedPoint(Vector3)
Create new BoundingBox that encloses the provided point as well.
Declaration
public BoundingBox WithMergedPoint(Vector3 point)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector3 | point | The point. | 
Returns
| Type | Description | 
|---|---|
| BoundingBox | Read summary. | 
Operators
operator ==(BoundingBox, BoundingBox)
Implements the operator ==.
Declaration
public static bool operator ==(BoundingBox a, BoundingBox b)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | a | First bounding box. | 
| BoundingBox | b | Second bounding box. | 
Returns
| Type | Description | 
|---|---|
| bool | Result of the operator. | 
operator !=(BoundingBox, BoundingBox)
Implements the operator !=.
Declaration
public static bool operator !=(BoundingBox a, BoundingBox b)Parameters
| Type | Name | Description | 
|---|---|---|
| BoundingBox | a | The first bounding box. | 
| BoundingBox | b | The second bounding box. | 
Returns
| Type | Description | 
|---|---|
| bool | The result of the operator. |