diff --git a/include/osg/State b/include/osg/State index a4088e699..d5a7c25c2 100644 --- a/include/osg/State +++ b/include/osg/State @@ -87,6 +87,14 @@ class SG_EXPORT State : public Referenced } + inline void setInitialViewMatrix(const osg::RefMatrix* matrix) + { + if (matrix) _initialViewMatrix = matrix; + else _initialViewMatrix = _identity; + } + + inline const osg::Matrix& getInitialViewMatrix() const { return *_initialViewMatrix; } + inline void applyProjectionMatrix(const osg::RefMatrix* matrix) { if (_projection!=matrix) @@ -106,7 +114,7 @@ class SG_EXPORT State : public Referenced } } - const osg::Matrix& getProjectionMatrix() const + inline const osg::Matrix& getProjectionMatrix() const { return *_projection; } @@ -630,6 +638,7 @@ class SG_EXPORT State : public Referenced ref_ptr _frameStamp; ref_ptr _identity; + ref_ptr _initialViewMatrix; ref_ptr _projection; ref_ptr _modelView; diff --git a/runexamples.bat b/runexamples.bat index f442aaaa0..c63e6bbc2 100644 --- a/runexamples.bat +++ b/runexamples.bat @@ -4,6 +4,12 @@ osgversion echo osglogo osglogo +echo slideshow3D introduction.xml +slideshow3D introduction.xml + +echo slideshow3D models.xml +slideshow3D models.xml + echo osgviewer cow.osg osgviewer cow.osg diff --git a/src/osg/State.cpp b/src/osg/State.cpp index 792a69f57..24b0a14c5 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -23,6 +23,7 @@ State::State() { _contextID = 0; _identity = new osg::RefMatrix(); // default RefMatrix constructs to identity. + _initialViewMatrix = _identity; _projection = _identity; _modelView = _identity; diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index d95b77cf3..d3ed21ba6 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -260,14 +260,8 @@ void DatabasePager::run() } -// // hack hack hack... sleep for 1ms so we give other threads a chance.. -// #ifdef WIN32 -// Sleep(1); -// #else -// usleep(1000); -// #endif - - yield(); + // go to sleep till our the next time our thread gets scheduled. + Yield(); } diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index a443f1f23..166276b2d 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -553,6 +553,7 @@ void SceneView::draw() //osg::Timer_t tend = timer.tick(); //std::cout<<"time to flush rendering objects"<setInitialViewMatrix(_viewMatrix.get()); RenderLeaf* previous = NULL; if (_displaySettings.valid() && _displaySettings->getStereo())