3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Math::ViewingFrustum Class Reference

Represents a viewing frustum. More...

#include <ViewingFrustum.hpp>

Public Member Functions

 ViewingFrustum (const Matrix4x4 &view, const Matrix4x4 &projection)
 Constructs an viewing frustum from the given view and projection matrices.
BoundingPlane Top ()
 Returns the plane representing the top of the frustum.
BoundingPlane Bottom ()
 Returns the plane representing the bottom of the frustum.
BoundingPlane Left ()
 Returns the plane representing the left side of the frustum.
BoundingPlane Right ()
 Returns the plane representing the right side of the frustum.
BoundingPlane Near ()
 Returns the plane representing the near side of the frustum.
BoundingPlane Far ()
 Returns the plane representing the far side of the frustum.
std::array< Vector3, 8 > Corners ()
 Returns the corners of the frustum in world space.
bool Contains (const Vector3 &point)
 Does this frustum contain the given point?
bool Contains (const BoundingSphere &sphere)
 Does this frustum contain the given bounding sphere?
bool Contains (const BoundingBox &box)
 Does this frustum contain the given bounding box?
bool Contains (const BoundingPlane &plane)
 Does this frustum contain the given bounding plane?
bool Contains (const ViewingFrustum &frustum)
 Does this frustum contain the given frustum?
float Intersects (const Ray &ray)
 Does this frustum intersect with the given ray?

Detailed Description

Represents a viewing frustum.

Constructor & Destructor Documentation

◆ ViewingFrustum()

Engine3DRadSpace.Math::ViewingFrustum::ViewingFrustum ( const Matrix4x4 & view,
const Matrix4x4 & projection )

Constructs an viewing frustum from the given view and projection matrices.

Parameters
viewView matrix.
projectionProjection matrix.

Member Function Documentation

◆ Bottom()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Bottom ( )

Returns the plane representing the bottom of the frustum.

Returns
The bottom plane of the frustum.

◆ Contains() [1/5]

bool Engine3DRadSpace.Math::ViewingFrustum::Contains ( const BoundingBox & box)

Does this frustum contain the given bounding box?

Parameters
boxThe bounding box to test.
Returns
True if the frustum contains the bounding box, false otherwise.

◆ Contains() [2/5]

bool Engine3DRadSpace.Math::ViewingFrustum::Contains ( const BoundingPlane & plane)

Does this frustum contain the given bounding plane?

Parameters
planeThe bounding plane to test.
Returns
True if the frustum contains the bounding plane, false otherwise.

◆ Contains() [3/5]

bool Engine3DRadSpace.Math::ViewingFrustum::Contains ( const BoundingSphere & sphere)

Does this frustum contain the given bounding sphere?

Parameters
sphereThe bounding sphere to test.
Returns
True if the frustum contains the bounding sphere, false otherwise.

◆ Contains() [4/5]

bool Engine3DRadSpace.Math::ViewingFrustum::Contains ( const Vector3 & point)

Does this frustum contain the given point?

Parameters
pointThe point to test.
Returns
True if the frustum contains the point, false otherwise.

◆ Contains() [5/5]

bool Engine3DRadSpace.Math::ViewingFrustum::Contains ( const ViewingFrustum & frustum)

Does this frustum contain the given frustum?

Parameters
frustumThe frustum to test.
Returns
True if the frustum contains the other frustum, false otherwise.

◆ Corners()

std::array< Vector3, 8 > Engine3DRadSpace.Math::ViewingFrustum::Corners ( )

Returns the corners of the frustum in world space.

Returns
An array containing the eight corners of the frustum.

◆ Far()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Far ( )

Returns the plane representing the far side of the frustum.

Returns
The far plane of the frustum.

◆ Intersects()

float Engine3DRadSpace.Math::ViewingFrustum::Intersects ( const Ray & ray)

Does this frustum intersect with the given ray?

Parameters
rayThe ray to test.
Returns
The distance at which the ray intersects the frustum, or a negative value if there is no intersection.

◆ Left()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Left ( )

Returns the plane representing the left side of the frustum.

Returns
The left plane of the frustum.

◆ Near()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Near ( )

Returns the plane representing the near side of the frustum.

Returns
The near plane of the frustum.

◆ Right()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Right ( )

Returns the plane representing the right side of the frustum.

Returns
The right plane of the frustum.

◆ Top()

BoundingPlane Engine3DRadSpace.Math::ViewingFrustum::Top ( )

Returns the plane representing the top of the frustum.

Returns
The top plane of the frustum.

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