Defines a frustum. More...
Public Member Functions | |
Frustum () noexcept | |
Frustum (const Frustum &other) noexcept | |
~Frustum () | |
const nkMaths::Vector & | getPlane (unsigned int index) const |
void | setPlane (const nkMaths::Vector &plane, unsigned int index) |
void | buildFrustum (const nkMaths::Matrix &viewMat, const nkMaths::Matrix &projMat) |
Defines a frustum.
A Frustum is a primitive that can for instance describe a camera's view range. Within Nilkins, the planes are in this order : left, right, bottom, top, near, far. Directions should be normalized and pointing inside the frustum's volume.
|
noexcept |
Default constructor.
|
noexcept |
Copy constructor.
other | The frustum to copy. |
nkGraphics::Frustum::~Frustum | ( | ) |
Destructor.
const nkMaths::Vector& nkGraphics::Frustum::getPlane | ( | unsigned int | index | ) | const |
Gives access to the planes forming the frustum.
index | The index of the plane to retrieve. Will be clamped to [0, 8]. |
void nkGraphics::Frustum::setPlane | ( | const nkMaths::Vector & | plane, |
unsigned int | index | ||
) |
Sets a plane.
plane | The new plane to set. |
index | The index of the plane to set. |
void nkGraphics::Frustum::buildFrustum | ( | const nkMaths::Matrix & | viewMat, |
const nkMaths::Matrix & | projMat | ||
) |
Builds the frustum for a given view and projection matrix.