Struct BoundingBox
Represents a bounding box.
Implements
Inherited Members
Namespace: Evergine.Mathematics
Assembly: Evergine.Mathematics.dll
Syntax
public struct BoundingBox : IEquatable<BoundingBox>
Constructors
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 min. |
Vector3 | max | The max. |
Fields
CornerCount
Number of corners.
Declaration
public const int CornerCount = 8
Field Value
Type | Description |
---|---|
int |
Max
Bounding box maximum.
Declaration
public Vector3 Max
Field Value
Type | Description |
---|---|
Vector3 |
Min
Bounding box minimum.
Declaration
public Vector3 Min
Field Value
Type | Description |
---|---|
Vector3 |
Properties
Center
Gets the center of the bouding 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 [contains] [the specified box].
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 [contains] [the specified frustum].
Declaration
public ContainmentType Contains(BoundingFrustum frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | frustum | The frustum. |
Returns
Type | Description |
---|---|
ContainmentType | The result. |
Contains(BoundingSphere)
Determines whether [contains] [the specified sphere].
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 [contains] [the specified sphere].
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 [contains] [the specified point].
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 [contains] [the specified point].
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 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 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.
Declaration
public static BoundingBox CreateMerged(BoundingBox original, BoundingBox additional)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | original | The original. |
BoundingBox | additional | The additional. |
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)
Equalses 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 like a hash table. |
Overrides
Intersects(BoundingBox)
Intersectses 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)
Intersectses the specified box.
Declaration
public bool Intersects(ref BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The box. |
Returns
Type | Description |
---|---|
bool | True if both boxes overlap. |
Intersects(BoundingFrustum)
Intersectses 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)
Intersectses 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)
Intersectses 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)
Intersectses 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)
Intersectses 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)
Intersectses 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?)
Intersectses 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)
Transform a bounding box.
Declaration
public static BoundingBox Transform(BoundingBox boundingBox, Matrix4x4 m)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | boundingBox | The bounding box. |
Matrix4x4 | m | The transform. |
Returns
Type | Description |
---|---|
BoundingBox | The transformed bounding box. |
Transform(Matrix4x4)
Transform a bounding box.
Declaration
public void Transform(Matrix4x4 m)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | m | The transform. |
Transform(ref Matrix4x4)
Transform a bounding box.
Declaration
public void Transform(ref Matrix4x4 m)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | m | The transform. |
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 | The 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 | First bounding box. |
BoundingBox | b | Second bounding box. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |