Class BoundingFrustum
Defines a frustum and helps determine whether forms intersect with it.
Inheritance
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public class BoundingFrustum : Object, IEquatable<BoundingFrustum>
Constructors
BoundingFrustum()
Declaration
public BoundingFrustum()
BoundingFrustum(Matrix)
Creates a new instance of BoundingFrustum.
Declaration
public BoundingFrustum(Matrix value)
Parameters
Type | Name | Description |
---|---|---|
Matrix | value | Combined matrix that usually takes view × projection matrix. |
Fields
CornerCount
Specifies the total number of corners (8) in the BoundingFrustum.
Declaration
public const int CornerCount = 8
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Bottom
Gets the bottom plane of the BoundingFrustum.
Declaration
public Plane Bottom { get; }
Property Value
Type | Description |
---|---|
Plane |
Far
Gets the far plane of the BoundingFrustum.
Declaration
public Plane Far { get; }
Property Value
Type | Description |
---|---|
Plane |
Item[Int32]
Declaration
public Plane this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
Plane |
Left
Gets the left plane of the BoundingFrustum.
Declaration
public Plane Left { get; }
Property Value
Type | Description |
---|---|
Plane |
Matrix
Gets or sets the Matrix that describes this bounding frustum.
Declaration
public Matrix Matrix { get; set; }
Property Value
Type | Description |
---|---|
Matrix |
Near
Gets the near plane of the BoundingFrustum.
Declaration
public Plane Near { get; }
Property Value
Type | Description |
---|---|
Plane |
Planes
Declaration
public Plane[] Planes { get; }
Property Value
Type | Description |
---|---|
Plane[] |
Right
Gets the right plane of the BoundingFrustum.
Declaration
public Plane Right { get; }
Property Value
Type | Description |
---|---|
Plane |
Top
Gets the top plane of the BoundingFrustum.
Declaration
public Plane Top { get; }
Property Value
Type | Description |
---|---|
Plane |
Methods
Contains(ref BoundingBox)
Checks whether the current BoundingFrustum contains the specified BoundingBox.
Declaration
public ContainmentType Contains(ref BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to check against the current BoundingFrustum. |
Returns
Type | Description |
---|---|
ContainmentType |
Contains(ref BoundingBox, out ContainmentType)
Checks whether the current BoundingFrustum contains the specified BoundingBox.
Declaration
public void Contains(ref BoundingBox box, out ContainmentType result)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to test for overlap. |
ContainmentType | result | [OutAttribute] Enumeration indicating the extent of overlap. |
Contains(BoundingFrustum)
Checks whether the current BoundingFrustum contains the specified BoundingFrustum.
Declaration
public ContainmentType Contains(BoundingFrustum frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | frustum | The BoundingFrustum to check against the current BoundingFrustum. |
Returns
Type | Description |
---|---|
ContainmentType |
Contains(BoundingSphere)
Checks whether the current BoundingFrustum contains the specified BoundingSphere.
Declaration
public ContainmentType Contains(BoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sphere | The BoundingSphere to check against the current BoundingFrustum. |
Returns
Type | Description |
---|---|
ContainmentType |
Contains(ref BoundingSphere, out ContainmentType)
Checks whether the current BoundingFrustum contains the specified BoundingSphere.
Declaration
public void Contains(ref BoundingSphere sphere, out ContainmentType result)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sphere | The BoundingSphere to test for overlap. |
ContainmentType | result | [OutAttribute] Enumeration indicating the extent of overlap. |
Contains(Vector3)
Checks whether the current BoundingFrustum contains the specified point.
Declaration
public ContainmentType Contains(Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The point to check against the current BoundingFrustum. |
Returns
Type | Description |
---|---|
ContainmentType |
Contains(ref Vector3, out ContainmentType)
Checks whether the current BoundingFrustum contains the specified point.
Declaration
public void Contains(ref Vector3 point, out ContainmentType result)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The point to test for overlap. |
ContainmentType | result | [OutAttribute] Enumeration indicating the extent of overlap. |
Equals(Object)
Determines whether the specified Object is equal to the BoundingFrustum.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The Object to compare with the current BoundingFrustum. |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(BoundingFrustum)
Determines whether the specified BoundingFrustum is equal to the current BoundingFrustum.
Declaration
public bool Equals(BoundingFrustum other)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | other | The BoundingFrustum to compare with the current BoundingFrustum. |
Returns
Type | Description |
---|---|
System.Boolean |
GetCorners()
Gets an array of points that make up the corners of the BoundingFrustum. ALLOCATION!
Declaration
public Vector3[] GetCorners()
Returns
Type | Description |
---|---|
Vector3[] |
GetCorners(Vector3[])
Gets an array of points that make up the corners of the BoundingFrustum.
Declaration
public void GetCorners(Vector3[] corners)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | corners | An existing array of at least 8 Vector3 points where the corners of the BoundingFrustum are written. |
GetCornersUnsafe(Vector3*)
Gets the array of points that make up the corners of the BoundingBox.
Declaration
public void GetCornersUnsafe(Vector3*corners)
Parameters
Type | Name | Description |
---|---|---|
Vector3* | corners | An existing array of at least 8 Vector3 points where the corners of the BoundingBox are written. |
GetHashCode()
Gets the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Intersects(BoundingBox)
Checks whether the current BoundingFrustum intersects the specified BoundingBox.
Declaration
public bool Intersects(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to check for intersection. |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(ref BoundingBox, out Boolean)
Checks whether the current BoundingFrustum intersects a BoundingBox.
Declaration
public void Intersects(ref BoundingBox box, out bool result)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The BoundingBox to check for intersection with. |
System.Boolean | result | [OutAttribute] true if the BoundingFrustum and BoundingBox intersect; false otherwise. |
Intersects(BoundingFrustum)
Checks whether the current BoundingFrustum intersects the specified BoundingFrustum.
Declaration
public bool Intersects(BoundingFrustum frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | frustum | The BoundingFrustum to check for intersection. |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(BoundingSphere)
Checks whether the current BoundingFrustum intersects the specified BoundingSphere.
Declaration
public bool Intersects(BoundingSphere sphere)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sphere | The BoundingSphere to check for intersection. |
Returns
Type | Description |
---|---|
System.Boolean |
Intersects(ref BoundingSphere, out Boolean)
Checks whether the current BoundingFrustum intersects a BoundingSphere.
Declaration
public void Intersects(ref BoundingSphere sphere, out bool result)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphere | sphere | The BoundingSphere to check for intersection with. |
System.Boolean | result | [OutAttribute] true if the BoundingFrustum and BoundingSphere intersect; false otherwise. |
Intersects(Plane)
Checks whether the current BoundingFrustum intersects the specified Plane.
Declaration
public PlaneIntersectionType Intersects(Plane plane)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The Plane to check for intersection. |
Returns
Type | Description |
---|---|
PlaneIntersectionType |
Intersects(ref Plane, out PlaneIntersectionType)
Checks whether the current BoundingFrustum intersects a Plane.
Declaration
public void Intersects(ref Plane plane, out PlaneIntersectionType result)
Parameters
Type | Name | Description |
---|---|---|
Plane | plane | The Plane to check for intersection with. |
PlaneIntersectionType | result | [OutAttribute] An enumeration indicating whether the BoundingFrustum intersects the Plane. |
Intersects(Ray)
Checks whether the current BoundingFrustum intersects the specified Ray.
Declaration
public Nullable<float> Intersects(Ray ray)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | The Ray to check for intersection. |
Returns
Type | Description |
---|---|
System.Nullable<System.Single> |
Intersects(ref Ray, out Nullable<Single>)
Checks whether the current BoundingFrustum intersects a Ray.
Declaration
public void Intersects(ref Ray ray, out Nullable<float> result)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | The Ray to check for intersection with. |
System.Nullable<System.Single> | result | [OutAttribute] Distance at which the ray intersects the BoundingFrustum or null if there is no intersection. |
ToString()
Returns a String that represents the current BoundingFrustum.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Operators
Equality(BoundingFrustum, BoundingFrustum)
Determines whether two instances of BoundingFrustum are equal.
Declaration
public static bool operator ==(BoundingFrustum a, BoundingFrustum b)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | a | The BoundingFrustum to the left of the equality operator. |
BoundingFrustum | b | The BoundingFrustum to the right of the equality operator. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(BoundingFrustum, BoundingFrustum)
Determines whether two instances of BoundingFrustum are not equal.
Declaration
public static bool operator !=(BoundingFrustum a, BoundingFrustum b)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustum | a | The BoundingFrustum to the left of the inequality operator. |
BoundingFrustum | b | The BoundingFrustum to the right of the inequality operator. |
Returns
Type | Description |
---|---|
System.Boolean |