Ocean
|
This class implements a viewing frustum. More...
Public Types | |
enum | PlaneIds : unsigned int { PI_FRONT = 0u , PI_BACK = 1u , PI_LEFT = 2u , PI_RIGHT = 3u , PI_TOP = 4u , PI_BOTTOM = 5u , PI_END = 6u } |
Definition of ids for the individual planes of the frustum. More... | |
typedef T | Type |
Definition of the used data type. More... | |
Public Member Functions | |
FrustumT ()=default | |
Default constructor creating an invalid frustum. More... | |
FrustumT (const T width, const T height, const T focalLengthX, const T focalLengthY, const T principalPointX, const T principalPointY, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum, pointing towards the negative z-space with y-axis up. More... | |
FrustumT (const PinholeCamera &pinholeCamera, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum from a camera, pointing towards the negative z-space with y-axis up. More... | |
FrustumT (const AnyCameraT< T > &pinholeCamera, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum from a camera, pointing towards the negative z-space with y-axis up. More... | |
FrustumT (const HomogenousMatrixT4< T > &world_T_camera, const T width, const T height, const T focalLengthX, const T focalLengthY, const T principalPointX, const T principalPointY, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum located anywhere in space. More... | |
FrustumT (const HomogenousMatrixT4< T > &world_T_camera, const PinholeCamera &pinholeCamera, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum from a camera located anywhere in space. More... | |
FrustumT (const HomogenousMatrixT4< T > &world_T_camera, const AnyCamera &pinholeCamera, const T nearDistance, const T farDistance) | |
Creates a new viewing frustum from a camera located anywhere in space. More... | |
const PlaneT3< T > * | planes () const |
Returns the six planes of the frustum, with order as defined in PlaneIds. More... | |
bool | isInside (const VectorT3< T > &objectPoint) const |
Returns whether a 3D object point is inside this frustum. More... | |
bool | isInside (const SphereT3< T > &sphere) const |
Returns whether a 3D sphere is located entirely inside this frustum. More... | |
bool | isInside (const Box3 &box) const |
Returns whether a 3D box is located entirely inside this frustum. More... | |
bool | isInside (const Vector3 *vertices, const size_t size) const |
Returns whether a 3D object is located entirely inside this frustum. More... | |
bool | hasIntersection (const SphereT3< T > &sphere) const |
Returns whether a 3D sphere has an interaction with this frustum or is entirely inside this frustum. More... | |
bool | hasIntersection (const Box3 &box) const |
Returns whether a 3D box has an interaction with this frustum or is entirely inside this frustum. More... | |
bool | hasIntersection (const Vector3 *vertices, const size_t size) const |
Returns whether a 3D object has an interaction with this frustum or is entirely inside this frustum. More... | |
bool | isValid () const |
Returns whether this frustum object is valid. More... | |
bool | isEqual (const FrustumT< T > &frustum, const T eps=NumericT< T >::eps()) const |
Returns whether two frustum objects are equal up to a small epsilon. More... | |
bool | operator== (const FrustumT< T > &frustum) const |
Returns whether two frustum objects are identical. More... | |
bool | operator!= (const FrustumT< T > &frustum) const |
Returns whether two frustum objects are not identical. More... | |
Protected Attributes | |
PlaneT3< T > | planes_ [PI_END] |
The six planes of the frustum. More... | |
This class implements a viewing frustum.
The viewing frustum points towards the negative z-space with x-axis pointing towards the right plane of the frustum, and y-axis pointing towards the top plane of the frustum.
T | Data type of the frustum elements. |
typedef T Ocean::FrustumT< T >::Type |
Definition of the used data type.
enum Ocean::FrustumT::PlaneIds : unsigned int |
Definition of ids for the individual planes of the frustum.
|
default |
Default constructor creating an invalid frustum.
Ocean::FrustumT< T >::FrustumT | ( | const T | width, |
const T | height, | ||
const T | focalLengthX, | ||
const T | focalLengthY, | ||
const T | principalPointX, | ||
const T | principalPointY, | ||
const T | nearDistance, | ||
const T | farDistance | ||
) |
Creates a new viewing frustum, pointing towards the negative z-space with y-axis up.
width | The width of the camera image, in pixel, with range (0, infinity) |
height | The height of the camera image, in pixel, with range (0, infinity) |
focalLengthX | The focal length of the camera in horizontal direction, in pixel domain, with range (0, infinity) |
focalLengthY | The focal length of the camera in vertical direction, in pixel domain, with range (0, infinity) |
principalPointX | The horizontal location of the camera's principal point, in pixel, with range (0, width) |
principalPointY | The vertical location of the camera's principal point, in pixel, with range (0, height) |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
|
inline |
Creates a new viewing frustum from a camera, pointing towards the negative z-space with y-axis up.
pinholeCamera | The pinhole camera profile for which the frustum will be created, must be valid |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
|
inline |
Creates a new viewing frustum from a camera, pointing towards the negative z-space with y-axis up.
pinholeCamera | The pinhole camera profile for which the frustum will be created, must be a pinhole camera, must be valid |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
Ocean::FrustumT< T >::FrustumT | ( | const HomogenousMatrixT4< T > & | world_T_camera, |
const T | width, | ||
const T | height, | ||
const T | focalLengthX, | ||
const T | focalLengthY, | ||
const T | principalPointX, | ||
const T | principalPointY, | ||
const T | nearDistance, | ||
const T | farDistance | ||
) |
Creates a new viewing frustum located anywhere in space.
world_T_camera | The transformation transforming the camera (pointing towards negative z-space with y-axis up) to world, must be valid |
width | The width of the camera image, in pixel, with range (0, infinity) |
height | The height of the camera image, in pixel, with range (0, infinity) |
focalLengthX | The focal length of the camera in horizontal direction, in pixel domain, with range (0, infinity) |
focalLengthY | The focal length of the camera in vertical direction, in pixel domain, with range (0, infinity) |
principalPointX | The horizontal location of the camera's principal point, in pixel, with range (0, width) |
principalPointY | The vertical location of the camera's principal point, in pixel, with range (0, height) |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
|
inline |
Creates a new viewing frustum from a camera located anywhere in space.
world_T_camera | The transformation transforming the camera (pointing towards negative z-space with y-axis up) to world, must be valid |
pinholeCamera | The pinhole camera profile for which the frustum will be created, must be valid |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
|
inline |
Creates a new viewing frustum from a camera located anywhere in space.
world_T_camera | The transformation transforming the camera (pointing towards negative z-space with y-axis up) to world, must be valid |
pinholeCamera | The pinhole camera profile for which the frustum will be created, must be a pinhole camera, must be valid |
nearDistance | The distance to the frustum's front plane, with range [0, infinity) |
farDistance | The distance to the frustum's back plane, with range (nearDistance, infinity) |
bool Ocean::FrustumT< T >::hasIntersection | ( | const Box3 & | box | ) | const |
Returns whether a 3D box has an interaction with this frustum or is entirely inside this frustum.
box | The box to check, must be valid |
bool Ocean::FrustumT< T >::hasIntersection | ( | const SphereT3< T > & | sphere | ) | const |
Returns whether a 3D sphere has an interaction with this frustum or is entirely inside this frustum.
sphere | The sphere to check, must be valid |
bool Ocean::FrustumT< T >::hasIntersection | ( | const Vector3 * | vertices, |
const size_t | size | ||
) | const |
Returns whether a 3D object has an interaction with this frustum or is entirely inside this frustum.
vertices | The 3D vertices of the object to check, must be valid |
size | The number of vertices, with range [1, infinity) |
bool Ocean::FrustumT< T >::isEqual | ( | const FrustumT< T > & | frustum, |
const T | eps = NumericT<T>::eps() |
||
) | const |
Returns whether two frustum objects are equal up to a small epsilon.
frustum | The second frustum to check |
eps | The epsilon to be used, with range [0, infinity) |
bool Ocean::FrustumT< T >::isInside | ( | const Box3 & | box | ) | const |
Returns whether a 3D box is located entirely inside this frustum.
box | The box to check, must be valid |
bool Ocean::FrustumT< T >::isInside | ( | const SphereT3< T > & | sphere | ) | const |
Returns whether a 3D sphere is located entirely inside this frustum.
sphere | The sphere to check, must be valid |
bool Ocean::FrustumT< T >::isInside | ( | const Vector3 * | vertices, |
const size_t | size | ||
) | const |
Returns whether a 3D object is located entirely inside this frustum.
vertices | The 3D vertices of the object to check, must be valid |
size | The number of vertices, with range [1, infinity) |
|
inline |
Returns whether a 3D object point is inside this frustum.
objectPoint | The 3D object point to check |
|
inline |
Returns whether this frustum object is valid.
|
inline |
Returns whether two frustum objects are not identical.
frustum | The second frustum to check |
|
inline |
Returns whether two frustum objects are identical.
frustum | The second frustum to check |
|
inline |
Returns the six planes of the frustum, with order as defined in PlaneIds.
|
protected |
The six planes of the frustum.