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

#include <Frustum.hpp>

Public Types

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

Public Member Functions

C3D_API Frustum (Viewport &viewport)
 Constructor. More...
 
C3D_API Planes update (castor::Matrix4x4f const &projection, castor::Matrix4x4f const &view)
 Updates the frustum planes. More...
 
C3D_API Planes update (castor::Point3f const &position, castor::Point3f const &right, castor::Point3f const &up, castor::Point3f const &front)
 Updates the frustum planes. More...
 
C3D_API Planes update (castor::Point3f const &eye, castor::Point3f const &target, castor::Point3f const &up)
 Updates the frustum planes. More...
 
C3D_API bool isVisible (castor::BoundingBox const &box, castor::Matrix4x4f const &transformations) const
 Checks if given BoundingBox is in the view frustum. More...
 
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. More...
 
C3D_API bool isVisible (castor::Point3f const &point) const
 Checks if given point is in the view frustum. More...
 
std::array< InterleavedVertex, 6u *4u > const & getPoints () const
 

Member Typedef Documentation

◆ Planes

using castor3d::Frustum::Planes = std::array< castor::PlaneEquation, size_t( FrustumPlane::eCount ) >

Constructor & Destructor Documentation

◆ Frustum()

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

Constructor.

Parameters
[in]viewportThe viewport.

Member Function Documentation

◆ getPoints()

std::array< InterleavedVertex, 6u *4u > const & castor3d::Frustum::getPoints ( ) const
inline

◆ 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().

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/3]

C3D_API Planes 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/3]

C3D_API Planes castor3d::Frustum::update ( castor::Point3f const &  eye,
castor::Point3f const &  target,
castor::Point3f const &  up 
)

Updates the frustum planes.

Parameters
[in]eyeThe view position.
[in]targetThe view target vector.
[in]upThe direction of the up vector according to the orientation of the view.

◆ update() [3/3]

C3D_API Planes castor3d::Frustum::update ( castor::Point3f const &  position,
castor::Point3f const &  right,
castor::Point3f const &  up,
castor::Point3f const &  front 
)

Updates the frustum planes.

Parameters
[in]positionThe view position.
[in]rightThe X vector.
[in]upThe Y vector.
[in]frontThe Z vector.

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