JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
EyeParameter.java
Go to the documentation of this file.
1/**
2 * Copyright 2014-2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.util.stereo;
29
30import com.jogamp.math.FovHVHalves;
31import com.jogamp.math.Vec3f;
32
33/**
34 * Constant single eye parameter of the viewer, relative to its {@link ViewerPose}.
35 */
36public final class EyeParameter {
37 /** Eye number, <code>0</code> for the left eye and <code>1</code> for the right eye. */
38 public final int number;
39
40 /** eye position vector used to define eye height in meter relative to <i>actor</i>. */
41 public final Vec3f positionOffset;
42
43 /** Field of view in both directions, may not be centered, either {@link FovHVHalves#inTangents} or radians. */
44 public final FovHVHalves fovhv;
45
46 /** IPD related horizontal distance from nose to pupil in meter. */
47 public final float distNoseToPupilX;
48
49 /** Vertical distance from middle-line to pupil in meter. */
50 public final float distMiddleToPupilY;
51
52 /** Z-axis eye relief in meter. */
53 public final float eyeReliefZ;
54
55 public EyeParameter(final int number, final Vec3f positionOffset, final FovHVHalves fovhv,
56 final float distNoseToPupil, final float verticalDelta, final float eyeRelief) {
57 this.number = number;
58 this.positionOffset = new Vec3f(positionOffset);
59 this.fovhv = fovhv;
60 this.distNoseToPupilX = distNoseToPupil;
61 this.distMiddleToPupilY = verticalDelta;
62 this.eyeReliefZ = eyeRelief;
63 }
64 @Override
65 public final String toString() {
66 return "EyeParam[num "+number+", posOff["+positionOffset+"], "+fovhv+
67 ", distPupil[noseX "+distNoseToPupilX+", middleY "+distMiddleToPupilY+", reliefZ "+eyeReliefZ+"]]";
68 }
69}
Horizontal and vertical field of view (FOV) halves, allowing a non-centered projection.
3D Vector based upon three float components.
Definition: Vec3f.java:37
Constant single eye parameter of the viewer, relative to its ViewerPose.
final float distNoseToPupilX
IPD related horizontal distance from nose to pupil in meter.
EyeParameter(final int number, final Vec3f positionOffset, final FovHVHalves fovhv, final float distNoseToPupil, final float verticalDelta, final float eyeRelief)
final FovHVHalves fovhv
Field of view in both directions, may not be centered, either FovHVHalves#inTangents or radians.
final int number
Eye number, 0 for the left eye and 1 for the right eye.
final float distMiddleToPupilY
Vertical distance from middle-line to pupil in meter.
final Vec3f positionOffset
eye position vector used to define eye height in meter relative to actor.
final float eyeReliefZ
Z-axis eye relief in meter.