Nebula
Loading...
Searching...
No Matches
Nebula.BoundingFrustum Class Reference

Detailed Description

Defines a viewing frustum for intersection operations.

Inherits IEquatable.

Public Member Functions

 BoundingFrustum (Matrix value)
 Constructs the frustum by extracting the view planes from a matrix.
ContainmentType Contains (BoundingBox box)
 Containment test between this BoundingFrustum and specified BoundingBox.
void Contains (ref BoundingBox box, out ContainmentType result)
 Containment test between this BoundingFrustum and specified BoundingBox.
ContainmentType Contains (BoundingFrustum frustum)
 Containment test between this BoundingFrustum and specified BoundingFrustum.
ContainmentType Contains (BoundingSphere sphere)
 Containment test between this BoundingFrustum and specified BoundingSphere.
void Contains (ref BoundingSphere sphere, out ContainmentType result)
 Containment test between this BoundingFrustum and specified BoundingSphere.
ContainmentType Contains (Vector3 point)
 Containment test between this BoundingFrustum and specified Vector3.
void Contains (ref Vector3 point, out ContainmentType result)
 Containment test between this BoundingFrustum and specified Vector3.
bool Equals (BoundingFrustum other)
 Compares whether current instance is equal to specified BoundingFrustum.
override bool Equals (object obj)
 Compares whether current instance is equal to specified BoundingFrustum.
Vector3[] GetCorners ()
 Returns a copy of internal corners array.
void GetCorners (Vector3[] corners)
 Returns a copy of internal corners array.
override int GetHashCode ()
 Gets the hash code of this BoundingFrustum.
bool Intersects (BoundingBox box)
 Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.
void Intersects (ref BoundingBox box, out bool result)
 Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.
bool Intersects (BoundingFrustum frustum)
 Gets whether or not a specified BoundingFrustum intersects with this BoundingFrustum.
bool Intersects (BoundingSphere sphere)
 Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.
void Intersects (ref BoundingSphere sphere, out bool result)
 Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.
PlaneIntersectionType Intersects (Plane plane)
 Gets type of intersection between specified Plane and this BoundingFrustum.
void Intersects (ref Plane plane, out PlaneIntersectionType result)
 Gets type of intersection between specified Plane and this BoundingFrustum.
float? Intersects (Ray ray)
 Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.
void Intersects (ref Ray ray, out float? result)
 Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.
override string ToString ()
 Returns a String representation of this BoundingFrustum in the format: {Near:[nearPlane] Far:[farPlane] Left:[leftPlane] Right:[rightPlane] Top:[topPlane] Bottom:[bottomPlane]}.

Static Public Member Functions

static bool operator== (BoundingFrustum a, BoundingFrustum b)
 Compares whether two BoundingFrustum instances are equal.
static bool operator!= (BoundingFrustum a, BoundingFrustum b)
 Compares whether two BoundingFrustum instances are not equal.

Static Public Attributes

const int PlaneCount = 6
 The number of planes in the frustum.
const int CornerCount = 8
 The number of corner points in the frustum.

Properties

Matrix Matrix [get, set]
 Gets or sets the Matrix of the frustum.
Plane Near [get]
 Gets the near plane of the frustum.
Plane Far [get]
 Gets the far plane of the frustum.
Plane Left [get]
 Gets the left plane of the frustum.
Plane Right [get]
 Gets the right plane of the frustum.
Plane Top [get]
 Gets the top plane of the frustum.
Plane Bottom [get]
 Gets the bottom plane of the frustum.
string DebugDisplayString [get]

Private Member Functions

void CreateCorners ()
void CreatePlanes ()
void NormalizePlane (ref Plane p)

Static Private Member Functions

static void IntersectionPoint (ref Plane a, ref Plane b, ref Plane c, out Vector3 result)

Private Attributes

Matrix _matrix
readonly Vector3[] _corners = new Vector3[CornerCount]
readonly Plane[] _planes = new Plane[PlaneCount]

Constructor & Destructor Documentation

◆ BoundingFrustum()

Nebula.BoundingFrustum.BoundingFrustum ( Matrix value)
inline

Constructs the frustum by extracting the view planes from a matrix.

Parameters
valueCombined matrix which usually is (View * Projection).

Member Function Documentation

◆ Contains() [1/7]

ContainmentType Nebula.BoundingFrustum.Contains ( BoundingBox box)
inline

Containment test between this BoundingFrustum and specified BoundingBox.

Parameters
boxA BoundingBox for testing.
Returns
Result of testing for containment between this BoundingFrustum and specified BoundingBox.

◆ Contains() [2/7]

ContainmentType Nebula.BoundingFrustum.Contains ( BoundingFrustum frustum)
inline

Containment test between this BoundingFrustum and specified BoundingFrustum.

Parameters
frustumA BoundingFrustum for testing.
Returns
Result of testing for containment between this BoundingFrustum and specified BoundingFrustum.

◆ Contains() [3/7]

ContainmentType Nebula.BoundingFrustum.Contains ( BoundingSphere sphere)
inline

Containment test between this BoundingFrustum and specified BoundingSphere.

Parameters
sphereA BoundingSphere for testing.
Returns
Result of testing for containment between this BoundingFrustum and specified BoundingSphere.

◆ Contains() [4/7]

void Nebula.BoundingFrustum.Contains ( ref BoundingBox box,
out ContainmentType result )
inline

Containment test between this BoundingFrustum and specified BoundingBox.

Parameters
boxA BoundingBox for testing.
resultResult of testing for containment between this BoundingFrustum and specified BoundingBox as an output parameter.

◆ Contains() [5/7]

void Nebula.BoundingFrustum.Contains ( ref BoundingSphere sphere,
out ContainmentType result )
inline

Containment test between this BoundingFrustum and specified BoundingSphere.

Parameters
sphereA BoundingSphere for testing.
resultResult of testing for containment between this BoundingFrustum and specified BoundingSphere as an output parameter.

◆ Contains() [6/7]

void Nebula.BoundingFrustum.Contains ( ref Vector3 point,
out ContainmentType result )
inline

Containment test between this BoundingFrustum and specified Vector3.

Parameters
pointA Vector3 for testing.
resultResult of testing for containment between this BoundingFrustum and specified Vector3 as an output parameter.

◆ Contains() [7/7]

ContainmentType Nebula.BoundingFrustum.Contains ( Vector3 point)
inline

Containment test between this BoundingFrustum and specified Vector3.

Parameters
pointA Vector3 for testing.
Returns
Result of testing for containment between this BoundingFrustum and specified Vector3.

◆ CreateCorners()

void Nebula.BoundingFrustum.CreateCorners ( )
inlineprivate

◆ CreatePlanes()

void Nebula.BoundingFrustum.CreatePlanes ( )
inlineprivate

◆ Equals() [1/2]

bool Nebula.BoundingFrustum.Equals ( BoundingFrustum other)
inline

Compares whether current instance is equal to specified BoundingFrustum.

Parameters
otherThe BoundingFrustum to compare.
Returns
true if the instances are equal; false otherwise.

◆ Equals() [2/2]

override bool Nebula.BoundingFrustum.Equals ( object obj)
inline

Compares whether current instance is equal to specified BoundingFrustum.

Parameters
objThe Object to compare.
Returns
true if the instances are equal; false otherwise.

◆ GetCorners() [1/2]

Vector3[] Nebula.BoundingFrustum.GetCorners ( )
inline

Returns a copy of internal corners array.

Returns
The array of corners.

◆ GetCorners() [2/2]

void Nebula.BoundingFrustum.GetCorners ( Vector3[] corners)
inline

Returns a copy of internal corners array.

Parameters
cornersThe array which values will be replaced to corner values of this instance. It must have size of BoundingFrustum.CornerCount.

◆ GetHashCode()

override int Nebula.BoundingFrustum.GetHashCode ( )
inline

Gets the hash code of this BoundingFrustum.

Returns
Hash code of this BoundingFrustum.

◆ IntersectionPoint()

void Nebula.BoundingFrustum.IntersectionPoint ( ref Plane a,
ref Plane b,
ref Plane c,
out Vector3 result )
inlinestaticprivate

◆ Intersects() [1/9]

bool Nebula.BoundingFrustum.Intersects ( BoundingBox box)
inline

Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.

Parameters
boxA BoundingBox for intersection test.
Returns
true if specified BoundingBox intersects with this BoundingFrustum; false otherwise.

◆ Intersects() [2/9]

bool Nebula.BoundingFrustum.Intersects ( BoundingFrustum frustum)
inline

Gets whether or not a specified BoundingFrustum intersects with this BoundingFrustum.

Parameters
frustumAn other BoundingFrustum for intersection test.
Returns
true if other BoundingFrustum intersects with this BoundingFrustum; false otherwise.

◆ Intersects() [3/9]

bool Nebula.BoundingFrustum.Intersects ( BoundingSphere sphere)
inline

Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.

Parameters
sphereA BoundingSphere for intersection test.
Returns
true if specified BoundingSphere intersects with this BoundingFrustum; false otherwise.

◆ Intersects() [4/9]

PlaneIntersectionType Nebula.BoundingFrustum.Intersects ( Plane plane)
inline

Gets type of intersection between specified Plane and this BoundingFrustum.

Parameters
planeA Plane for intersection test.
Returns
A plane intersection type.

◆ Intersects() [5/9]

float? Nebula.BoundingFrustum.Intersects ( Ray ray)
inline

Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.

Parameters
rayA Ray for intersection test.
Returns
Distance at which ray intersects with this BoundingFrustum or null if no intersection happens.

◆ Intersects() [6/9]

void Nebula.BoundingFrustum.Intersects ( ref BoundingBox box,
out bool result )
inline

Gets whether or not a specified BoundingBox intersects with this BoundingFrustum.

Parameters
boxA BoundingBox for intersection test.
resulttrue if specified BoundingBox intersects with this BoundingFrustum; false otherwise as an output parameter.

◆ Intersects() [7/9]

void Nebula.BoundingFrustum.Intersects ( ref BoundingSphere sphere,
out bool result )
inline

Gets whether or not a specified BoundingSphere intersects with this BoundingFrustum.

Parameters
sphereA BoundingSphere for intersection test.
resulttrue if specified BoundingSphere intersects with this BoundingFrustum; false otherwise as an output parameter.

◆ Intersects() [8/9]

void Nebula.BoundingFrustum.Intersects ( ref Plane plane,
out PlaneIntersectionType result )
inline

Gets type of intersection between specified Plane and this BoundingFrustum.

Parameters
planeA Plane for intersection test.
resultA plane intersection type as an output parameter.

◆ Intersects() [9/9]

void Nebula.BoundingFrustum.Intersects ( ref Ray ray,
out float? result )
inline

Gets the distance of intersection of Ray and this BoundingFrustum or null if no intersection happens.

Parameters
rayA Ray for intersection test.
resultDistance at which ray intersects with this BoundingFrustum or null if no intersection happens as an output parameter.

◆ NormalizePlane()

void Nebula.BoundingFrustum.NormalizePlane ( ref Plane p)
inlineprivate

◆ operator!=()

bool Nebula.BoundingFrustum.operator!= ( BoundingFrustum a,
BoundingFrustum b )
inlinestatic

Compares whether two BoundingFrustum instances are not equal.

Parameters
aBoundingFrustum instance on the left of the not equal sign.
bBoundingFrustum instance on the right of the not equal sign.
Returns
true if the instances are not equal; false otherwise.

◆ operator==()

bool Nebula.BoundingFrustum.operator== ( BoundingFrustum a,
BoundingFrustum b )
inlinestatic

Compares whether two BoundingFrustum instances are equal.

Parameters
aBoundingFrustum instance on the left of the equal sign.
bBoundingFrustum instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

◆ ToString()

override string Nebula.BoundingFrustum.ToString ( )
inline

Returns a String representation of this BoundingFrustum in the format: {Near:[nearPlane] Far:[farPlane] Left:[leftPlane] Right:[rightPlane] Top:[topPlane] Bottom:[bottomPlane]}.

Returns
String representation of this BoundingFrustum.

Member Data Documentation

◆ _corners

readonly Vector3 [] Nebula.BoundingFrustum._corners = new Vector3[CornerCount]
private

◆ _matrix

Matrix Nebula.BoundingFrustum._matrix
private

◆ _planes

readonly Plane [] Nebula.BoundingFrustum._planes = new Plane[PlaneCount]
private

◆ CornerCount

const int Nebula.BoundingFrustum.CornerCount = 8
static

The number of corner points in the frustum.

◆ PlaneCount

const int Nebula.BoundingFrustum.PlaneCount = 6
static

The number of planes in the frustum.

Property Documentation

◆ Bottom

Plane Nebula.BoundingFrustum.Bottom
get

Gets the bottom plane of the frustum.

◆ DebugDisplayString

string Nebula.BoundingFrustum.DebugDisplayString
getpackage

◆ Far

Plane Nebula.BoundingFrustum.Far
get

Gets the far plane of the frustum.

◆ Left

Plane Nebula.BoundingFrustum.Left
get

Gets the left plane of the frustum.

◆ Matrix

Matrix Nebula.BoundingFrustum.Matrix
getset

Gets or sets the Matrix of the frustum.

◆ Near

Plane Nebula.BoundingFrustum.Near
get

Gets the near plane of the frustum.

◆ Right

Plane Nebula.BoundingFrustum.Right
get

Gets the right plane of the frustum.

◆ Top

Plane Nebula.BoundingFrustum.Top
get

Gets the top plane of the frustum.


The documentation for this class was generated from the following file: