Horizontal and vertical field of view (FOV) halves, allowing a non-centered projection.
More...
#include <fov_hv_halves.hpp>
|
static FovHVHalves | byFovyRadianAndAspect (const float verticalFov, const float aspect) noexcept |
| Returns a symmetrical centered FovHVHalves instance in inTangents , using: More...
|
|
static FovHVHalves | byFovyRadianAndAspect (const float verticalFov, const float vertCenterFromTop, const float aspect, const float horizCenterFromLeft) noexcept |
| Returns a custom symmetry FovHVHalves instance inTangents , via computing the horizontalFov using: More...
|
|
static FovHVHalves | byRadians (const float horizontalFov, const float horizCenterFromLeft, const float verticalFov, const float vertCenterFromTop) noexcept |
| Returns a custom symmetry FovHVHalves instance inTangents , using: More...
|
|
static FovHVHalves | byRadians (const float horizontalFov, const float verticalFov) noexcept |
| Returns a symmetrical centered FovHVHalves instance in inTangents , using: More...
|
|
Horizontal and vertical field of view (FOV) halves, allowing a non-centered projection.
The values might be either in tangent or radians.
Definition at line 49 of file fov_hv_halves.hpp.
◆ FovHVHalves() [1/3]
constexpr jau::math::FovHVHalves::FovHVHalves |
( |
const float |
left_, |
|
|
const float |
right_, |
|
|
const float |
top_, |
|
|
const float |
bottom_, |
|
|
const bool |
inTangents_ |
|
) |
| |
|
inlineconstexprnoexcept |
Constructor for one FovHVHalves
instance.
It is recommended to pass and store values in tangent if used for perspective FOV calculations, since it will avoid conversion to tangent later on.
- Parameters
-
left_ | half horizontal FOV, left side, in tangent or radians |
right_ | half horizontal FOV, right side, in tangent or radians |
top_ | half vertical FOV, top side, in tangent or radians |
bottom_ | half vertical FOV, bottom side, in tangent or radians |
inTangents_ | if true, values are in tangent, otherwise radians |
Definition at line 74 of file fov_hv_halves.hpp.
◆ FovHVHalves() [2/3]
constexpr jau::math::FovHVHalves::FovHVHalves |
( |
const FovHVHalves & |
o | ) |
|
|
constexprdefaultnoexcept |
◆ FovHVHalves() [3/3]
constexpr jau::math::FovHVHalves::FovHVHalves |
( |
FovHVHalves && |
o | ) |
|
|
constexprdefaultnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ byRadians() [1/2]
static FovHVHalves jau::math::FovHVHalves::byRadians |
( |
const float |
horizontalFov, |
|
|
const float |
verticalFov |
|
) |
| |
|
inlinestaticnoexcept |
Returns a symmetrical centered FovHVHalves
instance in inTangents
, using:
halfHorizFovTan = tan( horizontalFov / 2f );
halfVertFovTan = tan( verticalFov / 2f );
- Parameters
-
horizontalFov | whole horizontal FOV in radians |
verticalFov | whole vertical FOV in radians |
Definition at line 91 of file fov_hv_halves.hpp.
◆ byFovyRadianAndAspect() [1/2]
static FovHVHalves jau::math::FovHVHalves::byFovyRadianAndAspect |
( |
const float |
verticalFov, |
|
|
const float |
aspect |
|
) |
| |
|
inlinestaticnoexcept |
Returns a symmetrical centered FovHVHalves
instance in inTangents
, using:
top = bottom = tan( verticalFov / 2f );
left = right = aspect * top;
- Parameters
-
verticalFov | vertical FOV in radians |
aspect | aspect ration width / height |
Definition at line 107 of file fov_hv_halves.hpp.
◆ byRadians() [2/2]
static FovHVHalves jau::math::FovHVHalves::byRadians |
( |
const float |
horizontalFov, |
|
|
const float |
horizCenterFromLeft, |
|
|
const float |
verticalFov, |
|
|
const float |
vertCenterFromTop |
|
) |
| |
|
inlinestaticnoexcept |
Returns a custom symmetry FovHVHalves
instance inTangents
, using:
left = tan( horizontalFov * horizCenterFromLeft )
right = tan( horizontalFov * ( 1f - horizCenterFromLeft ) )
top = tan( verticalFov * vertCenterFromTop )
bottom = tan( verticalFov * (1f - vertCenterFromTop ) )
- Parameters
-
horizontalFov | whole horizontal FOV in radians |
horizCenterFromLeft | horizontal center from left in [0..1] |
verticalFov | whole vertical FOV in radians |
vertCenterFromTop | vertical center from top in [0..1] |
Definition at line 127 of file fov_hv_halves.hpp.
◆ byFovyRadianAndAspect() [2/2]
static FovHVHalves jau::math::FovHVHalves::byFovyRadianAndAspect |
( |
const float |
verticalFov, |
|
|
const float |
vertCenterFromTop, |
|
|
const float |
aspect, |
|
|
const float |
horizCenterFromLeft |
|
) |
| |
|
inlinestaticnoexcept |
Returns a custom symmetry FovHVHalves
instance inTangents
, via computing the horizontalFov
using:
halfVertFovTan = tan( verticalFov / 2f );
halfHorizFovTan = aspect * halfVertFovTan;
horizontalFov = atan( halfHorizFovTan ) * 2f;
return byRadians
(horizontalFov, horizCenterFromLeft, verticalFov, vertCenterFromTop)
- Parameters
-
verticalFov | whole vertical FOV in radians |
vertCenterFromTop | vertical center from top in [0..1] |
aspect | aspect ration width / height |
horizCenterFromLeft | horizontal center from left in [0..1] |
Definition at line 150 of file fov_hv_halves.hpp.
◆ toTangents()
FovHVHalves jau::math::FovHVHalves::toTangents |
( |
| ) |
const |
|
inlinenoexcept |
Returns this instance in tangent values.
If this instance is inTangents
already, method returns a copy of this instance, otherwise a newly created instance w/ converted values to tangent.
Definition at line 165 of file fov_hv_halves.hpp.
◆ horzFov()
float jau::math::FovHVHalves::horzFov |
( |
| ) |
const |
|
inlinenoexcept |
◆ vertFov()
float jau::math::FovHVHalves::vertFov |
( |
| ) |
const |
|
inlinenoexcept |
◆ toString()
std::string jau::math::FovHVHalves::toString |
( |
| ) |
const |
|
inlinenoexcept |
◆ toStringInDegrees()
std::string jau::math::FovHVHalves::toStringInDegrees |
( |
| ) |
const |
|
inlinenoexcept |
◆ left
float jau::math::FovHVHalves::left |
◆ right
float jau::math::FovHVHalves::right |
◆ top
float jau::math::FovHVHalves::top |
◆ bottom
float jau::math::FovHVHalves::bottom |
◆ inTangents
bool jau::math::FovHVHalves::inTangents |
If true, values are in tangent, otherwise radians.
Definition at line 60 of file fov_hv_halves.hpp.
The documentation for this class was generated from the following file: