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
valueMatrixCombined 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
boxBoundingBoxA 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
boxBoundingBoxA BoundingBox for testing.
resultContainmentTypeResult 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
frustumBoundingFrustumA 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
sphereBoundingSphereA 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
sphereBoundingSphereA BoundingSphere for testing.
resultContainmentTypeResult 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
pointVector3A Vector3 for testing.
resultContainmentTypeResult 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
otherBoundingFrustumThe BoundingFrustum to compare.
Returns
- bool
trueif the instances are equal;falseotherwise.
Equals(object)
Compares whether current instance is equal to specified BoundingFrustum.
public override bool Equals(object obj)
Parameters
Returns
- bool
trueif the instances are equal;falseotherwise.
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
cornersVector3[]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
boxBoundingBoxA BoundingBox for intersection test.
Returns
- bool
trueif specified BoundingBox intersects with this BoundingFrustum;falseotherwise.
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
boxBoundingBoxA BoundingBox for intersection test.
resultbooltrueif specified BoundingBox intersects with this BoundingFrustum;falseotherwise as an output parameter.
Intersects(BoundingFrustum)
Gets whether or not a specified BoundingFrustum intersects with this BoundingFrustum.
public bool Intersects(BoundingFrustum frustum)
Parameters
frustumBoundingFrustumAn other BoundingFrustum for intersection test.
Returns
- bool
trueif other BoundingFrustum intersects with this BoundingFrustum;falseotherwise.
Intersects(BoundingSphere)
Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.
public bool Intersects(BoundingSphere sphere)
Parameters
sphereBoundingSphereA BoundingSphere for intersection test.
Returns
- bool
trueif specified BoundingSphere intersects with this BoundingFrustum;falseotherwise.
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
sphereBoundingSphereA BoundingSphere for intersection test.
resultbooltrueif specified BoundingSphere intersects with this BoundingFrustum;falseotherwise 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
planePlaneA Plane for intersection test.
resultPlaneIntersectionTypeA 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
rayRayA Ray for intersection test.
resultfloat?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
aBoundingFrustumBoundingFrustum instance on the left of the equal sign.
bBoundingFrustumBoundingFrustum instance on the right of the equal sign.
Returns
- bool
trueif the instances are equal;falseotherwise.
operator !=(BoundingFrustum, BoundingFrustum)
Compares whether two BoundingFrustum instances are not equal.
public static bool operator !=(BoundingFrustum a, BoundingFrustum b)
Parameters
aBoundingFrustumBoundingFrustum instance on the left of the not equal sign.
bBoundingFrustumBoundingFrustum instance on the right of the not equal sign.
Returns
- bool
trueif the instances are not equal;falseotherwise.