Mathematical representation of a frustum and related functions. This is also known as a view frustum. More...
#include <Frustum.hh>
Public Types | |
enum | FrustumPlane { FRUSTUM_PLANE_NEAR = 0 , FRUSTUM_PLANE_FAR = 1 , FRUSTUM_PLANE_LEFT = 2 , FRUSTUM_PLANE_RIGHT = 3 , FRUSTUM_PLANE_TOP = 4 , FRUSTUM_PLANE_BOTTOM = 5 } |
Planes that define the boundaries of the frustum. More... | |
Public Member Functions | |
Frustum () | |
Default constructor. With the following default values: | |
Frustum (double _near, double _far, const math::Angle &_fov, double _aspectRatio, const math::Pose3d &_pose=math::Pose3d::Zero) | |
Constructor. | |
double | AspectRatio () const |
Get the aspect ratio, which is the width divided by height of the near or far planes. | |
bool | Contains (const AxisAlignedBox &_b) const |
Check if a box lies inside the pyramid frustum. | |
bool | Contains (const Vector3d &_p) const |
Check if a point lies inside the pyramid frustum. | |
double | Far () const |
Get the far distance. This is the distance from the frustum's vertex to the farthest plane. | |
math::Angle | FOV () const |
Get the horizontal field of view. The field of view is the angle between the frustum's vertex and the edges of the near or far plane. This value represents the horizontal angle. | |
double | Near () const |
Get the near distance. This is the distance from the frustum's vertex to the closest plane. | |
Planed | Plane (const FrustumPlane _plane) const |
Get a plane of the frustum. | |
Pose3d | Pose () const |
Get the pose of the frustum. | |
void | SetAspectRatio (double _aspectRatio) |
Set the aspect ratio, which is the width divided by height of the near or far planes. | |
void | SetFar (double _far) |
Set the far distance. This is the distance from the frustum's vertex to the farthest plane. | |
void | SetFOV (const math::Angle &_fov) |
Set the horizontal field of view. The field of view is the angle between the frustum's vertex and the edges of the near or far plane. This value represents the horizontal angle. | |
void | SetNear (double _near) |
Set the near distance. This is the distance from the frustum's vertex to the closest plane. | |
void | SetPose (const Pose3d &_pose) |
Set the pose of the frustum. | |
Detailed Description
Mathematical representation of a frustum and related functions. This is also known as a view frustum.
Member Enumeration Documentation
◆ FrustumPlane
Constructor & Destructor Documentation
◆ Frustum() [1/2]
Frustum | ( | ) |
Default constructor. With the following default values:
- near: 0.0
- far: 1.0
- fov: 0.78539 radians (45 degrees)
- aspect ratio: 1.0
- pose: Pose3d::Zero
◆ Frustum() [2/2]
Frustum | ( | double | _near, |
double | _far, | ||
const math::Angle & | _fov, | ||
double | _aspectRatio, | ||
const math::Pose3d & | _pose = math::Pose3d::Zero |
||
) |
Constructor.
- Parameters
-
[in] _near Near plane distance. This is the distance from the frustum's vertex to the closest plane [in] _far Far plane distance. This is the distance from the frustum's vertex to the farthest plane. [in] _fov Field of view. The field of view is the angle between the frustum's vertex and the edges of the near or far plane. This value represents the horizontal angle. [in] _aspectRatio The aspect ratio, which is the width divided by height of the near or far planes. [in] _pose Pose of the frustum, which is the vertex (top of the pyramid).
Member Function Documentation
◆ AspectRatio()
double AspectRatio | ( | ) | const |
Get the aspect ratio, which is the width divided by height of the near or far planes.
- Returns
- The frustum's aspect ratio.
- See also
- SetAspectRatio
◆ Contains() [1/2]
bool Contains | ( | const AxisAlignedBox & | _b | ) | const |
Check if a box lies inside the pyramid frustum.
- Parameters
-
[in] _b Box to check.
- Returns
- True if the box is inside the pyramid frustum.
◆ Contains() [2/2]
Check if a point lies inside the pyramid frustum.
- Parameters
-
[in] _p Point to check.
- Returns
- True if the point is inside the pyramid frustum.
◆ Far()
double Far | ( | ) | const |
Get the far distance. This is the distance from the frustum's vertex to the farthest plane.
- Returns
- Far distance.
- See also
- SetFar
◆ FOV()
math::Angle FOV | ( | ) | const |
Get the horizontal field of view. The field of view is the angle between the frustum's vertex and the edges of the near or far plane. This value represents the horizontal angle.
- Returns
- The field of view.
- See also
- SetFOV
◆ Near()
double Near | ( | ) | const |
Get the near distance. This is the distance from the frustum's vertex to the closest plane.
- Returns
- Near distance.
- See also
- SetNear
◆ Plane()
Planed Plane | ( | const FrustumPlane | _plane | ) | const |
◆ Pose()
◆ SetAspectRatio()
Set the aspect ratio, which is the width divided by height of the near or far planes.
- Parameters
-
[in] _aspectRatio The frustum's aspect ratio.
- See also
- AspectRatio
◆ SetFar()
Set the far distance. This is the distance from the frustum's vertex to the farthest plane.
- Parameters
-
[in] _far Far distance.
- See also
- Far
◆ SetFOV()
void SetFOV | ( | const math::Angle & | _fov | ) |
Set the horizontal field of view. The field of view is the angle between the frustum's vertex and the edges of the near or far plane. This value represents the horizontal angle.
- Parameters
-
[in] _fov The field of view.
- See also
- FOV
◆ SetNear()
Set the near distance. This is the distance from the frustum's vertex to the closest plane.
- Parameters
-
[in] _near Near distance.
- See also
- Near
◆ SetPose()
The documentation for this class was generated from the following file: