Class BoundingFrustum
Defines a viewing frustum for intersection operations.
public class BoundingFrustum : IEquatable<BoundingFrustum>
- Inheritance
-
BoundingFrustum
- Implements
- Inherited Members
Constructors
BoundingFrustum(Matrix)
Constructs the frustum by extracting the view planes from a matrix.
public BoundingFrustum(Matrix value)
Parameters
value
MatrixCombined matrix which usually is (View * Projection).
Fields
CornerCount
The number of corner points in the frustum.
public const int CornerCount = 8
Field Value
PlaneCount
The number of planes in the frustum.
public const int PlaneCount = 6
Field Value
Properties
Bottom
Gets the bottom plane of the frustum.
public Plane Bottom { get; }
Property Value
Far
Gets the far plane of the frustum.
public Plane Far { get; }
Property Value
Left
Gets the left plane of the frustum.
public Plane Left { get; }
Property Value
Matrix
Gets or sets the Matrix of the frustum.
public Matrix Matrix { get; set; }
Property Value
Near
Gets the near plane of the frustum.
public Plane Near { get; }
Property Value
Right
Gets the right plane of the frustum.
public Plane Right { get; }
Property Value
Top
Gets the top plane of the frustum.
public Plane Top { get; }
Property Value
Methods
Contains(BoundingBox)
Containment test between this BoundingFrustum and specified BoundingBox.
public ContainmentType Contains(BoundingBox box)
Parameters
box
BoundingBoxA BoundingBox for testing.
Returns
- ContainmentType
Result of testing for containment between this BoundingFrustum and specified BoundingBox.
Contains(ref BoundingBox, out ContainmentType)
Containment test between this BoundingFrustum and specified BoundingBox.
public void Contains(ref BoundingBox box, out ContainmentType result)
Parameters
box
BoundingBoxA BoundingBox for testing.
result
ContainmentTypeResult of testing for containment between this BoundingFrustum and specified BoundingBox as an output parameter.
Contains(BoundingFrustum)
Containment test between this BoundingFrustum and specified BoundingFrustum.
public ContainmentType Contains(BoundingFrustum frustum)
Parameters
frustum
BoundingFrustumA BoundingFrustum for testing.
Returns
- ContainmentType
Result of testing for containment between this BoundingFrustum and specified BoundingFrustum.
Contains(BoundingSphere)
Containment test between this BoundingFrustum and specified BoundingSphere.
public ContainmentType Contains(BoundingSphere sphere)
Parameters
sphere
BoundingSphereA BoundingSphere for testing.
Returns
- ContainmentType
Result of testing for containment between this BoundingFrustum and specified BoundingSphere.
Contains(ref BoundingSphere, out ContainmentType)
Containment test between this BoundingFrustum and specified BoundingSphere.
public void Contains(ref BoundingSphere sphere, out ContainmentType result)
Parameters
sphere
BoundingSphereA BoundingSphere for testing.
result
ContainmentTypeResult of testing for containment between this BoundingFrustum and specified BoundingSphere as an output parameter.
Contains(Vector3)
Containment test between this BoundingFrustum and specified Vector3.
public ContainmentType Contains(Vector3 point)
Parameters
Returns
- ContainmentType
Result of testing for containment between this BoundingFrustum and specified Vector3.
Contains(ref Vector3, out ContainmentType)
Containment test between this BoundingFrustum and specified Vector3.
public void Contains(ref Vector3 point, out ContainmentType result)
Parameters
point
Vector3A Vector3 for testing.
result
ContainmentTypeResult of testing for containment between this BoundingFrustum and specified Vector3 as an output parameter.
Equals(BoundingFrustum)
Compares whether current instance is equal to specified BoundingFrustum.
public bool Equals(BoundingFrustum other)
Parameters
other
BoundingFrustumThe BoundingFrustum to compare.
Returns
- bool
true
if the instances are equal;false
otherwise.
Equals(object)
Compares whether current instance is equal to specified BoundingFrustum.
public override bool Equals(object obj)
Parameters
Returns
- bool
true
if the instances are equal;false
otherwise.
GetCorners()
Returns a copy of internal corners array.
public Vector3[] GetCorners()
Returns
- Vector3[]
The array of corners.
GetCorners(Vector3[])
Returns a copy of internal corners array.
public void GetCorners(Vector3[] corners)
Parameters
corners
Vector3[]The array which values will be replaced to corner values of this instance. It must have size of CornerCount.
GetHashCode()
Gets the hash code of this BoundingFrustum.
public override int GetHashCode()
Returns
- int
Hash code of this BoundingFrustum.
Intersects(BoundingBox)
Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.
public bool Intersects(BoundingBox box)
Parameters
box
BoundingBoxA BoundingBox for intersection test.
Returns
- bool
true
if specified BoundingBox intersects with this BoundingFrustum;false
otherwise.
Intersects(ref BoundingBox, out bool)
Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.
public void Intersects(ref BoundingBox box, out bool result)
Parameters
box
BoundingBoxA BoundingBox for intersection test.
result
booltrue
if specified BoundingBox intersects with this BoundingFrustum;false
otherwise as an output parameter.
Intersects(BoundingFrustum)
Gets whether or not a specified BoundingFrustum intersects with this BoundingFrustum.
public bool Intersects(BoundingFrustum frustum)
Parameters
frustum
BoundingFrustumAn other BoundingFrustum for intersection test.
Returns
- bool
true
if other BoundingFrustum intersects with this BoundingFrustum;false
otherwise.
Intersects(BoundingSphere)
Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.
public bool Intersects(BoundingSphere sphere)
Parameters
sphere
BoundingSphereA BoundingSphere for intersection test.
Returns
- bool
true
if specified BoundingSphere intersects with this BoundingFrustum;false
otherwise.
Intersects(ref BoundingSphere, out bool)
Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.
public void Intersects(ref BoundingSphere sphere, out bool result)
Parameters
sphere
BoundingSphereA BoundingSphere for intersection test.
result
booltrue
if specified BoundingSphere intersects with this BoundingFrustum;false
otherwise as an output parameter.
Intersects(Plane)
Gets type of intersection between specified Plane and this BoundingFrustum.
public PlaneIntersectionType Intersects(Plane plane)
Parameters
Returns
- PlaneIntersectionType
A plane intersection type.
Intersects(ref Plane, out PlaneIntersectionType)
Gets type of intersection between specified Plane and this BoundingFrustum.
public void Intersects(ref Plane plane, out PlaneIntersectionType result)
Parameters
plane
PlaneA Plane for intersection test.
result
PlaneIntersectionTypeA plane intersection type as an output parameter.
Intersects(Ray)
Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.
public float? Intersects(Ray ray)
Parameters
Returns
- float?
Distance at which ray intersects with this BoundingFrustum or null if no intersection happens.
Intersects(ref Ray, out float?)
Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.
public void Intersects(ref Ray ray, out float? result)
Parameters
ray
RayA Ray for intersection test.
result
float?Distance at which ray intersects with this BoundingFrustum or null if no intersection happens as an output parameter.
ToString()
Returns a string representation of this BoundingFrustum in the format: {Near:[nearPlane] Far:[farPlane] Left:[leftPlane] Right:[rightPlane] Top:[topPlane] Bottom:[bottomPlane]}
public override string ToString()
Returns
- string
string representation of this BoundingFrustum.
Operators
operator ==(BoundingFrustum, BoundingFrustum)
Compares whether two BoundingFrustum instances are equal.
public static bool operator ==(BoundingFrustum a, BoundingFrustum b)
Parameters
a
BoundingFrustumBoundingFrustum instance on the left of the equal sign.
b
BoundingFrustumBoundingFrustum instance on the right of the equal sign.
Returns
- bool
true
if the instances are equal;false
otherwise.
operator !=(BoundingFrustum, BoundingFrustum)
Compares whether two BoundingFrustum instances are not equal.
public static bool operator !=(BoundingFrustum a, BoundingFrustum b)
Parameters
a
BoundingFrustumBoundingFrustum instance on the left of the not equal sign.
b
BoundingFrustumBoundingFrustum instance on the right of the not equal sign.
Returns
- bool
true
if the instances are not equal;false
otherwise.