Allolib  1.0
C++ Components For Interactive Multimedia
al::Lens Class Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/graphics/al_Lens.hpp>

Public Member Functions

 Lens (double fovy=30, double nearClip=0.1, double farClip=100, double focalLength=6, double eyeSep=0.02)
 
Lensfovy (double v)
 Set vertical field of view, in degrees.
 
Lensfovx (double v, double aspect)
 Set horizontal field of view, in degrees.
 
Lensnear (double v)
 Set frustum near plane distance.
 
Lensfar (double v)
 Set frustum far plane distance.
 
LensfocalLength (double v)
 Set focal length.
 
LenseyeSep (double v)
 Set eye separation.
 
double fovy () const
 Get vertical field of view, in degrees.
 
double near () const
 Get frustum near plane distance.
 
double far () const
 Get frustum far plane distance.
 
double focalLength () const
 Get focal length.
 
double eyeSep () const
 Get eye separation.
 
double eyeSepAuto () const
 Get automatic inter-ocular distance.
 
double heightAtDepth (double depth) const
 Returns half the height of the frustum at a given depth. More...
 
double heightAtNear () const
 Returns half the height of the frustum at the near plane.
 

Static Public Member Functions

static double getFovyForHeight (double height, double depth)
 
static double getFovyForFovX (double fovx, double aspect)
 Calculate required fovy to produce a specific fovx. More...
 

Protected Attributes

double mFovy
 
double mTanFOV
 
double mNear
 
double mFar
 
double mFocalLength
 
double mEyeSep
 

Detailed Description

Stores optics settings important for rendering

Definition at line 60 of file al_Lens.hpp.

Constructor & Destructor Documentation

◆ Lens()

al::Lens::Lens ( double  fovy = 30,
double  nearClip = 0.1,
double  farClip = 100,
double  focalLength = 6,
double  eyeSep = 0.02 
)
Parameters
[in]fovyvertical field of view, in degrees
[in]nearClipfrustum near plane distance
[in]farClipfrustum far plane distance
[in]focalLengthfocal length, distance of zero parallax
[in]eyeSepeye separation amount

Member Function Documentation

◆ getFovyForFovX()

static double al::Lens::getFovyForFovX ( double  fovx,
double  aspect 
)
static

Calculate required fovy to produce a specific fovx.

Parameters
[in]fovxfield-of-view in X axis to recreate
[in]aspectaspect ratio of viewport
Returns
field-of-view in Y axis, usable by Lens::fovy()

◆ getFovyForHeight()

static double al::Lens::getFovyForHeight ( double  height,
double  depth 
)
static

Calculate desired fovy, given the Y height of the border at a specified Z depth:

◆ heightAtDepth()

double al::Lens::heightAtDepth ( double  depth) const
inline

Returns half the height of the frustum at a given depth.

To get the half-width multiply the half-height by the viewport aspect ratio.

Definition at line 106 of file al_Lens.hpp.


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