Loading...
Searching...
No Matches
ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum Class Reference

Mathematical representation of a frustum and related functions. 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.
 
 Frustum (const double _near, const double _far, const math::Angle &_fov, const double _aspectRatio, const math::Pose3d &_pose=math::Pose3d::Zero)
 Constructor.
 
 Frustum (const Frustum &_p)
 Copy Constructor.
 
virtual ~Frustum ()
 Destructor.
 
double AspectRatio () const
 Get the aspect ratio, which is the width divided by height of the near or far planes.
 
bool Contains (const Box &_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.
 
math::Angle FOV () const
 Get the horizontal field of view.
 
double Near () const
 Get the near distance.
 
Frustumoperator= (const Frustum &_f)
 Assignment operator.
 
Planed Plane (const FrustumPlane _plane) const
 Get a plane of the frustum.
 
Pose3d Pose () const
 Get the pose of the frustum.
 
void SetAspectRatio (const double _aspectRatio)
 Set the aspect ratio, which is the width divided by height of the near or far planes.
 
void SetFar (const double _far)
 Set the far distance.
 
void SetFOV (const math::Angle &_fov)
 Set the horizontal field of view.
 
void SetNear (const double _near)
 Set the near distance.
 
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

Planes that define the boundaries of the frustum.

Enumerator
FRUSTUM_PLANE_NEAR 

Near plane.

FRUSTUM_PLANE_FAR 

Far plane.

FRUSTUM_PLANE_LEFT 

Left plane.

FRUSTUM_PLANE_RIGHT 

Right plane.

FRUSTUM_PLANE_TOP 

Top plane.

FRUSTUM_PLANE_BOTTOM 

Bottom plane.

Constructor & Destructor Documentation

◆ Frustum() [1/3]

ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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/3]

ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Frustum ( const double _near,
const double _far,
const math::Angle & _fov,
const double _aspectRatio,
const math::Pose3d & _pose = math::Pose3d::Zero )

Constructor.

Parameters
[in]_nearNear plane distance. This is the distance from the frustum's vertex to the closest plane
[in]_farFar plane distance. This is the distance from the frustum's vertex to the farthest plane.
[in]_fovField 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]_aspectRatioThe aspect ratio, which is the width divided by height of the near or far planes.
[in]_posePose of the frustum, which is the vertex (top of the pyramid).

◆ Frustum() [3/3]

ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Frustum ( const Frustum & _p)

Copy Constructor.

Parameters
[in]_pFrustum to copy.

◆ ~Frustum()

virtual ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::~Frustum ( )
virtual

Destructor.

Member Function Documentation

◆ AspectRatio()

double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Contains ( const Box & _b) const

Check if a box lies inside the pyramid frustum.

Parameters
[in]_bBox to check.
Returns
True if the box is inside the pyramid frustum.

◆ Contains() [2/2]

bool ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Contains ( const Vector3d & _p) const

Check if a point lies inside the pyramid frustum.

Parameters
[in]_pPoint to check.
Returns
True if the point is inside the pyramid frustum.

◆ Far()

double ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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 ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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

◆ operator=()

Frustum & ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::operator= ( const Frustum & _f)

Assignment operator.

Set this frustum to the parameter.

Parameters
[in]_bFrustum to copy
Returns
The new frustum.

◆ Plane()

Planed ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Plane ( const FrustumPlane _plane) const

Get a plane of the frustum.

Parameters
[in]_planeThe plane to return.
Returns
Plane of the frustum.

◆ Pose()

Pose3d ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::Pose ( ) const

Get the pose of the frustum.

Returns
Pose of the frustum
See also
SetPose

◆ SetAspectRatio()

void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::SetAspectRatio ( const double _aspectRatio)

Set the aspect ratio, which is the width divided by height of the near or far planes.

Parameters
[in]_aspectRatioThe frustum's aspect ratio.
See also
AspectRatio

◆ SetFar()

void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::SetFar ( const double _far)

Set the far distance.

This is the distance from the frustum's vertex to the farthest plane.

Parameters
[in]_farFar distance.
See also
Far

◆ SetFOV()

void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::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]_fovThe field of view.
See also
FOV

◆ SetNear()

void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::SetNear ( const double _near)

Set the near distance.

This is the distance from the frustum's vertex to the closest plane.

Parameters
[in]_nearNear distance.
See also
Near

◆ SetPose()

void ignition::math::IGNITION_MATH_VERSION_NAMESPACE::Frustum::SetPose ( const Pose3d & _pose)

Set the pose of the frustum.

Parameters
[in]_posePose of the frustum, top vertex.
See also
Pose

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