00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_OPENGL_STEREORENDERER_H
00019 #define VRS_OPENGL_STEREORENDERER_H
00020
00021 #include <vrs/sg/multiscenerenderer.h>
00022
00023 namespace VRS {
00024
00025 class Stereo;
00026 class Engine;
00027
00029 class VRS_CORE_API StereoRendererGL :
00030 public MultiSceneRenderer
00031 {
00032 public:
00033 enum ColorMode {
00034 CM_HardwareStereo,
00035 CM_RedCyan
00036 };
00037 VRS_SERIALIZABLE_CLASS_ENUM(ColorMode);
00038
00039 StereoRendererGL(
00040 double eyeDistance = 0.3,
00041 ColorMode colorMode = CM_HardwareStereo,
00042 const Vector& eyeDirection = Vector(1.0, 0.0, 0.0)
00043 );
00045
00054 void setEyeDistance(double eyeDistance);
00055 double getEyeDistance() const;
00058 void setEyeDirection(const Vector& eyeDirection);
00059 Vector getEyeDirection() const;
00063 void setColorMode(ColorMode colorMode);
00064 ColorMode getColorMode() const;
00068 virtual void start(Engine*);
00070 virtual void stop(Engine*);
00072
00073 virtual bool needSceneEvaluation(Engine*);
00075 virtual void preEvaluateScene(Engine*);
00077 virtual void postEvaluateScene(Engine*);
00079
00080 VRS_TYPEINFO(StereoRendererGL, MultiSceneRenderer);
00081 VRS_SERIALIZABLE(StereoRendererGL);
00082
00083 private:
00084 SO<Stereo> m_stereoAttribute;
00085 int m_haveStereo;
00086 unsigned int m_pass;
00087 ColorMode m_colorMode;
00088 };
00089
00090 }
00091
00092 #endif // VRS_OPENGL_STEREORENDERER_H