Preperation for adding stereo support direclty into osgViewer.

This commit is contained in:
Robert Osfield
2013-04-15 14:21:32 +00:00
parent bc288d23dc
commit 34a6b38983
7 changed files with 239 additions and 131 deletions

View File

@@ -15,6 +15,7 @@
#define OSG_DisplaySettings 1
#include <osg/Referenced>
#include <osg/Matrixd>
#include <osg/ref_ptr>
#include <string>
@@ -184,6 +185,11 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
void setSerializeDrawDispatch(bool serializeDrawDispatch) { _serializeDrawDispatch = serializeDrawDispatch; }
bool getSerializeDrawDispatch() const { return _serializeDrawDispatch; }
void setUseSceneViewForStereoHint(bool hint) { _useSceneViewForStereoHint = hint; }
bool getUseSceneViewForStereoHint() const { return _useSceneViewForStereoHint; }
/** Set the hint for the total number of threads in the DatbasePager set up, inclusive of the number of http dedicated threads.*/
void setNumOfDatabaseThreadsHint(unsigned int numThreads) { _numDatabaseThreadsHint = numThreads; }
@@ -278,6 +284,22 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
/** Get the hint of the profile mask to use in when creating graphic contexts.*/
unsigned int getGLContextProfileMask() const { return _glContextProfileMask; }
/** helper function for computing the left eye projection matrix.*/
virtual osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd& projection) const;
/** helper function for computing the left eye view matrix.*/
virtual osg::Matrixd computeLeftEyeViewImplementation(const osg::Matrixd& view, double eyeSeperationScale=1.0) const;
/** helper function for computing the right eye view matrix.*/
virtual osg::Matrixd computeRightEyeProjectionImplementation(const osg::Matrixd& projection) const;
/** helper function for computing the right eye view matrix.*/
virtual osg::Matrixd computeRightEyeViewImplementation(const osg::Matrixd& view, double eyeSeperationScale=1.0) const;
protected:
virtual ~DisplaySettings();
@@ -313,6 +335,7 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
bool _compileContextsHint;
bool _serializeDrawDispatch;
bool _useSceneViewForStereoHint;
unsigned int _numDatabaseThreadsHint;
unsigned int _numHttpDatabaseThreadsHint;