Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | List of all members
castor3d::Frustum Class Reference

#include <Frustum.hpp>

Public Types

using Planes = castor::Array< castor::PlaneEquation, size_t( FrustumPlane::eCount ) >
 

Public Member Functions

C3D_API Frustum (Viewport &viewport)
 Constructor.
 
C3D_API void update (castor::Matrix4x4f const &view)
 Updates the frustum planes.
 
C3D_API void update (castor::Matrix4x4f const &projection, castor::Matrix4x4f const &view)
 Updates the frustum planes.
 
C3D_API bool isVisible (castor::BoundingBox const &box, castor::Matrix4x4f const &transformations) const
 Checks if given BoundingBox is in the view frustum.
 
C3D_API bool isVisible (castor::BoundingSphere const &sphere, castor::Matrix4x4f const &transformations, castor::Point3f const &scale) const
 Checks if given BoundingSphere is in the view frustum.
 
C3D_API bool isVisible (castor::Point3f const &point) const
 Checks if given point is in the view frustum.
 
castor::Array< InterleavedVertex, 8u > const & getPoints () const noexcept
 
Planes const & getPlanes () const noexcept
 
castor::BoundingBox const & getBoundingBox () const noexcept
 

Member Typedef Documentation

◆ Planes

Constructor & Destructor Documentation

◆ Frustum()

C3D_API castor3d::Frustum::Frustum ( Viewport & viewport)
explicit

Constructor.

Parameters
[in]viewportThe viewport.

Member Function Documentation

◆ getBoundingBox()

castor::BoundingBox const & castor3d::Frustum::getBoundingBox ( ) const
inlinenoexcept

◆ getPlanes()

Planes const & castor3d::Frustum::getPlanes ( ) const
inlinenoexcept

◆ getPoints()

castor::Array< InterleavedVertex, 8u > const & castor3d::Frustum::getPoints ( ) const
inlinenoexcept

◆ isVisible() [1/3]

C3D_API bool castor3d::Frustum::isVisible ( castor::BoundingBox const & box,
castor::Matrix4x4f const & transformations ) const

Checks if given BoundingBox is in the view frustum.

Parameters
[in]boxThe BoundingBox.
[in]transformationsThe BoundingBox transformations matrix.
Returns
false if the BoundingBox is completely out of the view frustum.

Referenced by castor3d::Camera::isVisible(), castor3d::Camera::isVisible(), and castor3d::Camera::isVisible().

Here is the caller graph for this function:

◆ isVisible() [2/3]

C3D_API bool castor3d::Frustum::isVisible ( castor::BoundingSphere const & sphere,
castor::Matrix4x4f const & transformations,
castor::Point3f const & scale ) const

Checks if given BoundingSphere is in the view frustum.

Parameters
[in]sphereThe BoundingSphere.
[in]transformationsThe BoundingSphere transformations matrix.
[in]scaleThe scale for the BoundingSphere.
Returns
false if the BoundingSphere is completely out of the view frustum.

◆ isVisible() [3/3]

C3D_API bool castor3d::Frustum::isVisible ( castor::Point3f const & point) const

Checks if given point is in the view frustum.

Parameters
[in]pointThe point.
Returns
false if the point out of the view frustum.

◆ update() [1/2]

C3D_API void castor3d::Frustum::update ( castor::Matrix4x4f const & projection,
castor::Matrix4x4f const & view )

Updates the frustum planes.

Parameters
[in]projectionThe projection matrix.
[in]viewThe view matrix.

◆ update() [2/2]

C3D_API void castor3d::Frustum::update ( castor::Matrix4x4f const & view)

Updates the frustum planes.

Parameters
[in]viewThe view matrix.

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