Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
Math class that represents a frustum in the three dimensional vector space. More...
Public Member Functions | |
template<typename U > | |
Frustum (const Frustum< U > &frustum) | |
Constructs a Frustum object from another type of Frustum. More... | |
Frustum (const Frustum &frustum)=default | |
Frustum & | Build (T angle, T ratio, T zNear, T zFar, const Vector3< T > &eye, const Vector3< T > &target, const Vector3< T > &up=Vector3< T >::Up()) |
Builds the frustum object. More... | |
bool | Contains (const BoundingVolume< T > &volume) const |
Checks whether or not a bounding volume is contained in the frustum. More... | |
bool | Contains (const Box< T > &box) const |
Checks whether or not a box is contained in the frustum. More... | |
bool | Contains (const OrientedBox< T > &orientedBox) const |
Checks whether or not an oriented box is contained in the frustum. More... | |
bool | Contains (const Sphere< T > &sphere) const |
Checks whether or not a sphere is contained in the frustum. More... | |
bool | Contains (const Vector3< T > &point) const |
Checks whether or not a Vector3 is contained in the frustum. More... | |
bool | Contains (const Vector3< T > *points, unsigned int pointCount) const |
Checks whether or not a set of Vector3 is contained in the frustum. More... | |
Frustum & | Extract (const Matrix4< T > &clipMatrix) |
Constructs the frustum from a Matrix4. More... | |
Frustum & | Extract (const Matrix4< T > &view, const Matrix4< T > &projection) |
Constructs the frustum from the view matrix and the projection matrix. More... | |
const Vector3< T > & | GetCorner (BoxCorner corner) const |
Gets the Vector3 for the corner. More... | |
const Plane< T > & | GetPlane (FrustumPlane plane) const |
Gets the Plane for the face. More... | |
IntersectionSide | Intersect (const BoundingVolume< T > &volume) const |
Checks whether or not a bounding volume intersects with the frustum. More... | |
IntersectionSide | Intersect (const Box< T > &box) const |
Checks whether or not a box intersects with the frustum. More... | |
IntersectionSide | Intersect (const OrientedBox< T > &orientedBox) const |
Checks whether or not an oriented box intersects with the frustum. More... | |
IntersectionSide | Intersect (const Sphere< T > &sphere) const |
Checks whether or not a sphere intersects with the frustum. More... | |
IntersectionSide | Intersect (const Vector3< T > *points, unsigned int pointCount) const |
Checks whether or not a set of Vector3 intersects with the frustum. More... | |
Frustum & | operator= (const Frustum &other)=default |
Frustum & | Set (const Frustum &frustum) |
Sets the components of the frustum from another frustum. More... | |
template<typename U > | |
Frustum & | Set (const Frustum< U > &frustum) |
String | ToString () const |
Gives a string representation. More... | |
template<typename U > | |
Frustum< T > & | Set (const Frustum< U > &frustum) |
Sets the components of the frustum from another type of Frustum. More... | |
Friends | |
template<typename U > | |
bool | Serialize (SerializationContext &context, const Frustum< U > &frustum) |
template<typename U > | |
bool | Unserialize (SerializationContext &context, Frustum< U > *frustum) |
Math class that represents a frustum in the three dimensional vector space.
Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process
|
explicit |
Frustum< T > & Nz::Frustum< T >::Build | ( | T | angle, |
T | ratio, | ||
T | zNear, | ||
T | zFar, | ||
const Vector3< T > & | eye, | ||
const Vector3< T > & | target, | ||
const Vector3< T > & | up = Vector3<T>::Up() |
||
) |
Builds the frustum object.
angle | Unit depends on NAZARA_MATH_ANGLE_RADIAN |
ratio | Rendering ratio (typically 16/9 or 4/3) |
zNear | Distance where 'vision' begins |
zFar | Distance where 'vision' ends |
eye | Position of the camera |
target | Position of the target of the camera |
up | Direction of up vector according to the orientation of camera |
bool Nz::Frustum< T >::Contains | ( | const BoundingVolume< T > & | volume | ) | const |
Checks whether or not a bounding volume is contained in the frustum.
volume | Volume to check |
bool Nz::Frustum< T >::Contains | ( | const Box< T > & | box | ) | const |
Checks whether or not a box is contained in the frustum.
box | Box to check |
bool Nz::Frustum< T >::Contains | ( | const OrientedBox< T > & | orientedbox | ) | const |
Checks whether or not an oriented box is contained in the frustum.
orientedbox | Oriented box to check |
bool Nz::Frustum< T >::Contains | ( | const Sphere< T > & | sphere | ) | const |
Checks whether or not a sphere is contained in the frustum.
sphere | Sphere to check |
bool Nz::Frustum< T >::Contains | ( | const Vector3< T > & | point | ) | const |
bool Nz::Frustum< T >::Contains | ( | const Vector3< T > * | points, |
unsigned int | pointCount | ||
) | const |
Frustum< T > & Nz::Frustum< T >::Extract | ( | const Matrix4< T > & | clipMatrix | ) |
Constructs the frustum from a Matrix4.
clipMatrix | Matrix which represents the transformation of the frustum |
Frustum< T > & Nz::Frustum< T >::Extract | ( | const Matrix4< T > & | view, |
const Matrix4< T > & | projection | ||
) |
Constructs the frustum from the view matrix and the projection matrix.
view | Matrix which represents the view |
projection | Matrix which represents the projection (the perspective) |
const Vector3< T > & Nz::Frustum< T >::GetCorner | ( | BoxCorner | corner | ) | const |
const Plane< T > & Nz::Frustum< T >::GetPlane | ( | FrustumPlane | plane | ) | const |
IntersectionSide Nz::Frustum< T >::Intersect | ( | const BoundingVolume< T > & | volume | ) | const |
Checks whether or not a bounding volume intersects with the frustum.
volume | Volume to check |
IntersectionSide Nz::Frustum< T >::Intersect | ( | const Box< T > & | box | ) | const |
Checks whether or not a box intersects with the frustum.
box | Box to check |
IntersectionSide Nz::Frustum< T >::Intersect | ( | const OrientedBox< T > & | orientedbox | ) | const |
Checks whether or not an oriented box intersects with the frustum.
oriented | box OrientedBox to check |
IntersectionSide Nz::Frustum< T >::Intersect | ( | const Sphere< T > & | sphere | ) | const |
Checks whether or not a sphere intersects with the frustum.
sphere | Sphere to check |
IntersectionSide Nz::Frustum< T >::Intersect | ( | const Vector3< T > * | points, |
unsigned int | pointCount | ||
) | const |
Frustum< T > & Nz::Frustum< T >::Set | ( | const Frustum< T > & | frustum | ) |
Sets the components of the frustum from another frustum.
frustum | The other frustum |
Frustum<T>& Nz::Frustum< T >::Set | ( | const Frustum< U > & | frustum | ) |
String Nz::Frustum< T >::ToString | ( | ) | const |
Gives a string representation.