utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::graphic::FieldOfView< Type > Class Template Reference

Field of view representation in radians for up, down, left, and right directions. More...

#include <headers/utility/graphic/field_of_view.hpp>

Public Member Functions

 FieldOfView (void)
 Default constructor initializing all FOV angles to 0 radians.
 
 FieldOfView (Type up, Type down, Type left, Type right)
 Constructor to initialize field of view angles in radians.
 
 FieldOfView (const FieldOfView &other)=default
 Copy constructor.
 
 FieldOfView (FieldOfView &&other) noexcept=default
 Move constructor.
 
FieldOfViewoperator= (const FieldOfView &other)=default
 Copy assignment operator.
 
FieldOfViewoperator= (FieldOfView &&other) noexcept=default
 Move assignment operator.
 
 ~FieldOfView (void)=default
 Default destructor for FieldOfView.
 
FieldOfViewsetUp (const Type up)
 Set up field-of-view in radians.
 
Type getUp (void) const noexcept
 Get up field-of-view in radians.
 
FieldOfViewsetDown (const Type down)
 Set down field-of-view in radians.
 
Type getDown (void) const noexcept
 Get down field-of-view in radians.
 
FieldOfViewsetLeft (const Type left)
 Set left field-of-view in radians.
 
Type getLeft (void) const noexcept
 Get left field-of-view in radians.
 
FieldOfViewsetRight (const Type right)
 Set right field-of-view in radians.
 
Type getRight (void) const noexcept
 Get right field-of-view in radians.
 
bool isSymmetric (Type epsilon=Type { 1e-6 }) const noexcept
 Check if this FOV is symmetric around vertical and horizontal axes.
 

Detailed Description

template<CanBeFieldOfViewComponent Type>
class utility::graphic::FieldOfView< Type >

Field of view representation in radians for up, down, left, and right directions.

Template Parameters
TypeFloating-point component type used for stored angles.
Note
We store in radians internally for efficient calculations, but the interface uses radians for ease of use.

Definition at line 49 of file field_of_view.hpp.

Constructor & Destructor Documentation

◆ FieldOfView() [1/4]

template<CanBeFieldOfViewComponent Type>
utility::graphic::FieldOfView< Type >::FieldOfView ( void  )
inline

Default constructor initializing all FOV angles to 0 radians.

Definition at line 61 of file field_of_view.hpp.

◆ FieldOfView() [2/4]

template<CanBeFieldOfViewComponent Type>
utility::graphic::FieldOfView< Type >::FieldOfView ( Type  up,
Type  down,
Type  left,
Type  right 
)
inline

Constructor to initialize field of view angles in radians.

Parameters
upVertical FOV above the forward direction in radians.
downVertical FOV below the forward direction in radians.
leftHorizontal FOV to the left of the forward direction in radians.
rightHorizontal FOV to the right of the forward direction in radians.

Definition at line 75 of file field_of_view.hpp.

◆ FieldOfView() [3/4]

template<CanBeFieldOfViewComponent Type>
utility::graphic::FieldOfView< Type >::FieldOfView ( const FieldOfView< Type > &  other)
default

Copy constructor.

Parameters
otherThe FieldOfView object to copy from.

◆ FieldOfView() [4/4]

template<CanBeFieldOfViewComponent Type>
utility::graphic::FieldOfView< Type >::FieldOfView ( FieldOfView< Type > &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe FieldOfView object to move from.

Member Function Documentation

◆ getDown()

template<CanBeFieldOfViewComponent Type>
Type utility::graphic::FieldOfView< Type >::getDown ( void  ) const
inlinenoexcept

Get down field-of-view in radians.

Returns
Down angle in radians.

Definition at line 149 of file field_of_view.hpp.

Here is the caller graph for this function:

◆ getLeft()

template<CanBeFieldOfViewComponent Type>
Type utility::graphic::FieldOfView< Type >::getLeft ( void  ) const
inlinenoexcept

Get left field-of-view in radians.

Returns
Left angle in radians.

Definition at line 169 of file field_of_view.hpp.

Here is the caller graph for this function:

◆ getRight()

template<CanBeFieldOfViewComponent Type>
Type utility::graphic::FieldOfView< Type >::getRight ( void  ) const
inlinenoexcept

Get right field-of-view in radians.

Returns
Right angle in radians.

Definition at line 189 of file field_of_view.hpp.

Here is the caller graph for this function:

◆ getUp()

template<CanBeFieldOfViewComponent Type>
Type utility::graphic::FieldOfView< Type >::getUp ( void  ) const
inlinenoexcept

Get up field-of-view in radians.

Returns
Up angle in radians.

Definition at line 129 of file field_of_view.hpp.

Here is the caller graph for this function:

◆ isSymmetric()

template<CanBeFieldOfViewComponent Type>
bool utility::graphic::FieldOfView< Type >::isSymmetric ( Type  epsilon = Type { 1e-6 }) const
inlinenoexcept

Check if this FOV is symmetric around vertical and horizontal axes.

Parameters
epsilonAbsolute tolerance used for comparison.
Returns
True if up~=down and left~=right.

Definition at line 200 of file field_of_view.hpp.

◆ operator=() [1/2]

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::operator= ( const FieldOfView< Type > &  other)
default

Copy assignment operator.

Parameters
otherThe FieldOfView object to copy from.
Returns
A reference to this FieldOfView object.

◆ operator=() [2/2]

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::operator= ( FieldOfView< Type > &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe FieldOfView object to move from.
Returns
A reference to this FieldOfView object.

◆ setDown()

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::setDown ( const Type  down)
inline

Set down field-of-view in radians.

Parameters
downDown angle in radians.
Returns
Reference to this FieldOfView.

Definition at line 139 of file field_of_view.hpp.

◆ setLeft()

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::setLeft ( const Type  left)
inline

Set left field-of-view in radians.

Parameters
leftLeft angle in radians.
Returns
Reference to this FieldOfView.

Definition at line 159 of file field_of_view.hpp.

◆ setRight()

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::setRight ( const Type  right)
inline

Set right field-of-view in radians.

Parameters
rightRight angle in radians.
Returns
Reference to this FieldOfView.

Definition at line 179 of file field_of_view.hpp.

◆ setUp()

template<CanBeFieldOfViewComponent Type>
FieldOfView & utility::graphic::FieldOfView< Type >::setUp ( const Type  up)
inline

Set up field-of-view in radians.

Parameters
upUp angle in radians.
Returns
Reference to this FieldOfView.

Definition at line 119 of file field_of_view.hpp.


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