1 /************************************************************************************
\r
3 Filename : OVR_StereoProjection.h
\r
4 Content : Stereo projection functions
\r
5 Created : November 30, 2013
\r
8 Copyright : Copyright 2014-2016 Oculus VR, LLC All Rights reserved.
\r
10 Licensed under the Oculus VR Rift SDK License Version 3.3 (the "License");
\r
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
\r
12 which is provided at the time of installation or download, or which
\r
13 otherwise accompanies this software in either electronic or hard copy form.
\r
15 You may obtain a copy of the License at
\r
17 http://www.oculusvr.com/licenses/LICENSE-3.3
\r
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
\r
20 distributed under the License is distributed on an "AS IS" BASIS,
\r
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
22 See the License for the specific language governing permissions and
\r
23 limitations under the License.
\r
25 *************************************************************************************/
\r
27 #ifndef OVR_StereoProjection_h
\r
28 #define OVR_StereoProjection_h
\r
30 #include "Extras/OVR_Math.h"
\r
34 //-----------------------------------------------------------------------------------
\r
35 // ***** Stereo Enumerations
\r
37 // StereoEye specifies which eye we are rendering for; it is used to
\r
38 // retrieve StereoEyeParams.
\r
39 enum StereoEye { StereoEye_Left, StereoEye_Right, StereoEye_Center };
\r
41 //-----------------------------------------------------------------------------------
\r
42 // ***** Propjection functions
\r
44 Matrix4f CreateProjection(
\r
49 float zNear = 0.01f,
\r
50 float zFar = 10000.0f,
\r
52 bool farAtInfinity = false);
\r
54 Matrix4f CreateOrthoSubProjection(
\r
61 float distanceFromCamera,
\r
62 float interpupillaryDistance,
\r
63 Matrix4f const& projection,
\r
67 bool farAtInfinity = false);
\r
69 ScaleAndOffset2D CreateNDCScaleAndOffsetFromFov(FovPort fov);
\r
73 #endif // OVR_StereoProjection_h
\r