scg3  0.6
StereoCamera.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright 2014 Volker Ahlers
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 
25 #ifndef STEREOCAMERA_H_
26 #define STEREOCAMERA_H_
27 
28 #include "../src/scg_glew.h"
29 #include "../src/Camera.h"
30 #include "../src/scg_glm.h"
31 #include "scg_ext_internals.h"
32 
33 namespace scg {
34 
35 
50 class StereoCamera: public Camera {
51 
52 public:
53 
57  StereoCamera();
58 
62  virtual ~StereoCamera();
63 
67  static StereoCameraSP create();
68 
79  void init(GLfloat near, GLfloat far, GLfloat screenDist, GLfloat screenHeight,
80  GLfloat interOcularDist);
81 
95  void initBourke(GLfloat fovyDeg, GLfloat near, GLfloat far, GLfloat screenDist,
96  GLfloat interOcularFactor);
97 
101  virtual const glm::mat4& getProjection();
102 
106  virtual const glm::mat4& getViewTransform(RenderState* renderState);
107 
112  virtual void updateProjection();
113 
118  virtual void render(RenderState* renderState);
119 
120 protected:
121 
122  GLint eyeFactor_;
123  GLfloat near_;
124  GLfloat far_;
125  GLfloat screenDist_;
129 
130 };
131 
132 
133 } /* namespace scg */
134 
135 #endif /* STEREOCAMERA_H_ */
Base class for all cameras (composite node, abstract).
Definition: Camera.h:51
virtual void updateProjection()
A perspective stereo camera (composite node).
Definition: StereoCamera.h:50
virtual const glm::mat4 & getProjection()
static StereoCameraSP create()
GLfloat screenHalfWidth_
Definition: StereoCamera.h:126
GLfloat interOcularHalfDist_
Definition: StereoCamera.h:128
void initBourke(GLfloat fovyDeg, GLfloat near, GLfloat far, GLfloat screenDist, GLfloat interOcularFactor)
GLfloat screenHalfHeight_
Definition: StereoCamera.h:127
virtual const glm::mat4 & getViewTransform(RenderState *renderState)
virtual ~StereoCamera()
void init(GLfloat near, GLfloat far, GLfloat screenDist, GLfloat screenHeight, GLfloat interOcularDist)
Internal definitions required by most classes.
The central render state that collects information about the current shader, transformations,...
Definition: RenderState.h:107
virtual void render(RenderState *renderState)
Definition: Animation.h:28