public final class FovHVHalves extends Object
The values might be either in tangent or radians.
Modifier and Type | Field and Description |
---|---|
float |
bottom
Half vertical FOV from center to bottom.
|
boolean |
inTangents
If true, values are in tangent, otherwise radians.
|
float |
left
Half horizontal FOV from center to left.
|
float |
right
Half horizontal FOV from center to right.
|
float |
top
Half vertical FOV from center to top.
|
Constructor and Description |
---|
FovHVHalves(float left,
float right,
float top,
float bottom,
boolean inTangents)
Constructor for one
FovHVHalves instance. |
Modifier and Type | Method and Description |
---|---|
static FovHVHalves |
createByRadians(float horizontalFov,
float verticalFov)
Returns a symmetrical centered
FovHVHalves instance in tangents, using: |
FovHVHalves |
getInTangents()
Returns this instance values in tangent values.
|
float |
horzFov()
Returns the full horizontal FOV, i.e.
|
String |
toString() |
String |
toStringInDegrees() |
float |
vertFov()
Returns the full vertical FOV, i.e.
|
public final float left
public final float right
public final float top
public final float bottom
public final boolean inTangents
public FovHVHalves(float left, float right, float top, float bottom, boolean inTangents)
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.
left
- half horizontal FOV, left side, in tangent or radiansright
- half horizontal FOV, right side, in tangent or radianstop
- half vertical FOV, top side, in tangent or radiansbottom
- half vertical FOV, bottom side, in tangent or radiansinTangents
- if true, values are in tangent, otherwise radianspublic static FovHVHalves createByRadians(float horizontalFov, float verticalFov)
FovHVHalves
instance in tangents, using:
final float halfHorizFovTan = (float)Math.tan(horizontalFov/2f); final float halfVertFovTan = (float)Math.tan(verticalFov/2f);
horizontalFov
- whole horizontal FOV in radiansverticalFov
- whole vertical FOV in radianspublic final FovHVHalves getInTangents()
If this instance is inTangents
already, method returns this instance,
otherwise a newly created instance w/ converted values to tangent.
public final float horzFov()
public final float vertFov()
public final String toStringInDegrees()
Copyright 2010 JogAmp Community.