JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.math.FovHVHalves Class Reference

Horizontal and vertical field of view (FOV) halves, allowing a non-centered projection. More...

Collaboration diagram for com.jogamp.math.FovHVHalves:

Public Member Functions

 FovHVHalves (final float left, final float right, final float top, final float bottom, final boolean inTangents)
 Constructor for one FovHVHalves instance. More...
 
final FovHVHalves toTangents ()
 Returns this instance in tangent values. More...
 
final float horzFov ()
 Returns the full horizontal FOV, i.e. More...
 
final float vertFov ()
 Returns the full vertical FOV, i.e. More...
 
final String toString ()
 
final String toStringInDegrees ()
 

Static Public Member Functions

static FovHVHalves byRadians (final float horizontalFov, final float verticalFov)
 Returns a symmetrical centered FovHVHalves instance in inTangents, using: More...
 
static FovHVHalves byFovyRadianAndAspect (final float verticalFov, final float aspect)
 Returns a symmetrical centered FovHVHalves instance in inTangents, using: More...
 
static FovHVHalves byRadians (final float horizontalFov, final float horizCenterFromLeft, final float verticalFov, final float vertCenterFromTop)
 Returns a custom symmetry FovHVHalves instance inTangents, using: More...
 
static FovHVHalves byFovyRadianAndAspect (final float verticalFov, final float vertCenterFromTop, final float aspect, final float horizCenterFromLeft)
 Returns a custom symmetry FovHVHalves instance inTangents, via computing the horizontalFov using: More...
 

Public Attributes

final float left
 Half horizontal FOV from center to left, either in inTangents or radians. More...
 
final float right
 Half horizontal FOV from center to right, either in inTangents or radians. More...
 
final float top
 Half vertical FOV from center to top, either in inTangents or radians. More...
 
final float bottom
 Half vertical FOV from center to bottom, either in inTangents or radians. More...
 
final boolean inTangents
 If true, values are in tangent, otherwise radians. More...
 

Detailed Description

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 37 of file FovHVHalves.java.

Constructor & Destructor Documentation

◆ FovHVHalves()

com.jogamp.math.FovHVHalves.FovHVHalves ( final float  left,
final float  right,
final float  top,
final float  bottom,
final boolean  inTangents 
)

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
lefthalf horizontal FOV, left side, in tangent or radians
righthalf horizontal FOV, right side, in tangent or radians
tophalf vertical FOV, top side, in tangent or radians
bottomhalf vertical FOV, bottom side, in tangent or radians
inTangentsif true, values are in tangent, otherwise radians

Definition at line 61 of file FovHVHalves.java.

Here is the caller graph for this function:

Member Function Documentation

◆ byFovyRadianAndAspect() [1/2]

static FovHVHalves com.jogamp.math.FovHVHalves.byFovyRadianAndAspect ( final float  verticalFov,
final float  aspect 
)
static

Returns a symmetrical centered FovHVHalves instance in inTangents, using:

 top  = bottom = tan( verticalFov / 2f );
 left =  right = aspect * top;
Parameters
verticalFovvertical FOV in radians
aspectaspect ration width / height

Definition at line 94 of file FovHVHalves.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ byFovyRadianAndAspect() [2/2]

static FovHVHalves com.jogamp.math.FovHVHalves.byFovyRadianAndAspect ( final float  verticalFov,
final float  vertCenterFromTop,
final float  aspect,
final float  horizCenterFromLeft 
)
static

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
verticalFovwhole vertical FOV in radians
vertCenterFromTopvertical center from top in [0..1]
aspectaspect ration width / height
horizCenterFromLefthorizontal center from left in [0..1]

Definition at line 137 of file FovHVHalves.java.

Here is the call graph for this function:

◆ byRadians() [1/2]

static FovHVHalves com.jogamp.math.FovHVHalves.byRadians ( final float  horizontalFov,
final float  horizCenterFromLeft,
final float  verticalFov,
final float  vertCenterFromTop 
)
static

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
horizontalFovwhole horizontal FOV in radians
horizCenterFromLefthorizontal center from left in [0..1]
verticalFovwhole vertical FOV in radians
vertCenterFromTopvertical center from top in [0..1]

Definition at line 114 of file FovHVHalves.java.

Here is the call graph for this function:

◆ byRadians() [2/2]

static FovHVHalves com.jogamp.math.FovHVHalves.byRadians ( final float  horizontalFov,
final float  verticalFov 
)
static

Returns a symmetrical centered FovHVHalves instance in inTangents, using:

 halfHorizFovTan = tan( horizontalFov / 2f );
 halfVertFovTan  = tan( verticalFov / 2f );
Parameters
horizontalFovwhole horizontal FOV in radians
verticalFovwhole vertical FOV in radians

Definition at line 78 of file FovHVHalves.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ horzFov()

final float com.jogamp.math.FovHVHalves.horzFov ( )

Returns the full horizontal FOV, i.e.

left + right, either in inTangents or radians.

Definition at line 161 of file FovHVHalves.java.

◆ toString()

final String com.jogamp.math.FovHVHalves.toString ( )

Definition at line 166 of file FovHVHalves.java.

◆ toStringInDegrees()

final String com.jogamp.math.FovHVHalves.toStringInDegrees ( )

Definition at line 169 of file FovHVHalves.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toTangents()

final FovHVHalves com.jogamp.math.FovHVHalves.toTangents ( )

Returns this instance in tangent values.

If this instance is inTangents already, method returns this instance, otherwise a newly created instance w/ converted values to tangent.

Definition at line 152 of file FovHVHalves.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertFov()

final float com.jogamp.math.FovHVHalves.vertFov ( )

Returns the full vertical FOV, i.e.

top + bottom, either in inTangents or radians.

Definition at line 164 of file FovHVHalves.java.

Member Data Documentation

◆ bottom

final float com.jogamp.math.FovHVHalves.bottom

Half vertical FOV from center to bottom, either in inTangents or radians.

Definition at line 45 of file FovHVHalves.java.

◆ inTangents

final boolean com.jogamp.math.FovHVHalves.inTangents

If true, values are in tangent, otherwise radians.

Definition at line 47 of file FovHVHalves.java.

◆ left

final float com.jogamp.math.FovHVHalves.left

Half horizontal FOV from center to left, either in inTangents or radians.

Definition at line 39 of file FovHVHalves.java.

◆ right

final float com.jogamp.math.FovHVHalves.right

Half horizontal FOV from center to right, either in inTangents or radians.

Definition at line 41 of file FovHVHalves.java.

◆ top

final float com.jogamp.math.FovHVHalves.top

Half vertical FOV from center to top, either in inTangents or radians.

Definition at line 43 of file FovHVHalves.java.


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