1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGUTIL_SCENEVIEW
15#define OSGUTIL_SCENEVIEW 1
18#include <osg/StateSet>
20#include <osg/FrameStamp>
21#include <osg/DisplaySettings>
22#include <osg/CollectOccludersVisitor>
23#include <osg/CullSettings>
26#include <osgUtil/CullVisitor>
31 * SceneView is deprecated, and is now just kept for backwards compatibility.
32 * It is recommend that you use osgViewer::Viewer/Composite in combination
33 * with osgViewer::GraphicsWindowEmbedded for embedded rendering support as
34 * this provides a greater range of functionality and consistency of API.
36class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
40 /** Construct a default scene view.*/
41 SceneView(osg::DisplaySettings* ds=NULL);
43 SceneView(const SceneView& sceneview, const osg::CopyOp& copyop = osg::CopyOp());
45 META_Object(osgUtil, SceneView);
49 NO_SCENEVIEW_LIGHT = 0x0,
52 COMPILE_GLOBJECTS_AT_INIT = 0x4,
53 APPLY_GLOBAL_DEFAULTS = 0x8,
54 CLEAR_GLOBAL_STATESET = 0x10,
55 STANDARD_SETTINGS = HEADLIGHT |
56 COMPILE_GLOBJECTS_AT_INIT |
57 APPLY_GLOBAL_DEFAULTS |
63 virtual void setDefaults() { setDefaults(STANDARD_SETTINGS); }
65 /** Set scene view to use default global state, light, camera
68 virtual void setDefaults(unsigned int options);
70 /** Set the camera used to represent the camera view of this SceneView.*/
71 void setCamera(osg::Camera* camera, bool assumeOwnershipOfCamera = true);
73 /** Get the camera used to represent the camera view of this SceneView.*/
74 osg::Camera* getCamera() { return _camera.get(); }
76 /** Get the const camera used to represent the camera view of this SceneView.*/
77 const osg::Camera* getCamera() const { return _camera.get(); }
79 /** Set the data to view. The data will typically be
80 * an osg::Scene but can be any osg::Node type.
82 void setSceneData(osg::Node* node);
84 /** Get the scene data to view. The data will typically be
85 * an osg::Scene but can be any osg::Node type.
87 osg::Node* getSceneData(unsigned int childNo=0) { return (_camera->getNumChildren()>childNo) ? _camera->getChild(childNo) : 0; }
89 /** Get the const scene data which to view. The data will typically be
90 * an osg::Scene but can be any osg::Node type.
92 const osg::Node* getSceneData(unsigned int childNo=0) const { return (_camera->getNumChildren()>childNo) ? _camera->getChild(childNo) : 0; }
94 /** Get the number of scene data subgraphs added to the SceneView's camera.*/
95 unsigned int getNumSceneData() const { return _camera->getNumChildren(); }
97 /** Set the viewport of the scene view to use specified osg::Viewport. */
98 void setViewport(osg::Viewport* viewport) { _camera->setViewport(viewport); }
100 /** Set the viewport of the scene view to specified dimensions. */
101 void setViewport(int x,int y,int width,int height) { _camera->setViewport(x,y,width,height); }
104 /** Get the viewport. */
105 osg::Viewport* getViewport() { return (_camera->getViewport()!=0) ? _camera->getViewport() : 0; }
107 /** Get the const viewport. */
108 const osg::Viewport* getViewport() const { return (_camera->getViewport()!=0) ? _camera->getViewport() : 0; }
110 /** Set the DisplaySettings. */
111 inline void setDisplaySettings(osg::DisplaySettings* vs) { _displaySettings = vs; }
113 /** Get the const DisplaySettings */
114 inline const osg::DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); }
116 /** Get the DisplaySettings */
117 inline osg::DisplaySettings* getDisplaySettings() { return _displaySettings.get(); }
120 /** Set the color used in glClearColor().
121 Defaults to an off blue color.*/
122 void setClearColor(const osg::Vec4& color) { _camera->setClearColor(color); }
124 /** Get the color used in glClearColor.*/
125 const osg::Vec4& getClearColor() const { return _camera->getClearColor(); }
128 /** Manually set the redraw interlaced stereo stencil mask request flag to control whether to redraw the stencil buffer on the next frame.*/
129 void setRedrawInterlacedStereoStencilMask(bool flag) { _redrawInterlacedStereoStencilMask = flag; }
131 /** Get the redraw interlaced stereo stencil mask request flag.*/
132 bool getRedrawInterlacedStereoStencilMask() const { return _redrawInterlacedStereoStencilMask; }
135 void setGlobalStateSet(osg::StateSet* state) { _globalStateSet = state; }
136 osg::StateSet* getGlobalStateSet() { return _globalStateSet.get(); }
137 const osg::StateSet* getGlobalStateSet() const { return _globalStateSet.get(); }
139 void setSecondaryStateSet(osg::StateSet* state) { _secondaryStateSet = state; }
140 osg::StateSet* getSecondaryStateSet() { return _secondaryStateSet.get(); }
141 const osg::StateSet* getSecondaryStateSet() const { return _secondaryStateSet.get(); }
143 void setLocalStateSet(osg::StateSet* state) { _localStateSet = state; }
144 osg::StateSet* getLocalStateSet() { return _localStateSet.get(); }
145 const osg::StateSet* getLocalStateSet() const { return _localStateSet.get(); }
149 FRAME_NUMBER_UNIFORM = 1,
150 FRAME_TIME_UNIFORM = 2,
151 DELTA_FRAME_TIME_UNIFORM = 4,
152 SIMULATION_TIME_UNIFORM = 8,
153 DELTA_SIMULATION_TIME_UNIFORM = 16,
154 VIEW_MATRIX_UNIFORM = 32,
155 VIEW_MATRIX_INVERSE_UNIFORM = 64,
156 DEFAULT_UNIFORMS = FRAME_NUMBER_UNIFORM |
158 DELTA_FRAME_TIME_UNIFORM |
159 SIMULATION_TIME_UNIFORM |
160 DELTA_SIMULATION_TIME_UNIFORM |
161 VIEW_MATRIX_UNIFORM |
162 VIEW_MATRIX_INVERSE_UNIFORM,
163 ALL_UNIFORMS = 0x7FFFFFFF
166 /** Set the uniforms that SceneView should set set up on each frame.*/
167 void setActiveUniforms(int activeUniforms) { _activeUniforms = activeUniforms; }
169 /** Get the uniforms that SceneView should set set up on each frame.*/
170 int getActiveUniforms() const { return _activeUniforms; }
172 void updateUniforms();
175 typedef Options LightingMode;
177 void setLightingMode(LightingMode mode);
178 LightingMode getLightingMode() const { return _lightingMode; }
180 void setLight(osg::Light* light) { _light = light; }
181 osg::Light* getLight() { return _light.get(); }
182 const osg::Light* getLight() const { return _light.get(); }
184 void setState(osg::State* state) { _renderInfo.setState(state); }
185 osg::State* getState() { return _renderInfo.getState(); }
186 const osg::State* getState() const { return _renderInfo.getState(); }
188 void setView(osg::View* view) { _camera->setView(view); }
189 osg::View* getView() { return _camera->getView(); }
190 const osg::View* getView() const { return _camera->getView(); }
192 void setRenderInfo(osg::RenderInfo& renderInfo) { _renderInfo = renderInfo; }
193 osg::RenderInfo& getRenderInfo() { return _renderInfo; }
194 const osg::RenderInfo& getRenderInfo() const { return _renderInfo; }
198 /** Set the projection matrix. Can be thought of as setting the lens of a camera. */
199 inline void setProjectionMatrix(const osg::Matrixf& matrix) { _camera->setProjectionMatrix(matrix); }
201 /** Set the projection matrix. Can be thought of as setting the lens of a camera. */
202 inline void setProjectionMatrix(const osg::Matrixd& matrix) { _camera->setProjectionMatrix(matrix); }
204 /** Set to an orthographic projection. See OpenGL glOrtho documentation for further details.*/
205 void setProjectionMatrixAsOrtho(double left, double right,
206 double bottom, double top,
207 double zNear, double zFar);
209 /** Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.*/
210 void setProjectionMatrixAsOrtho2D(double left, double right,
211 double bottom, double top);
213 /** Set to a perspective projection. See OpenGL glFrustum documentation for further details.*/
214 void setProjectionMatrixAsFrustum(double left, double right,
215 double bottom, double top,
216 double zNear, double zFar);
218 /** Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
219 * Aspect ratio is defined as width/height.*/
220 void setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
221 double zNear, double zFar);
223 /** Get the projection matrix.*/
224 osg::Matrixd& getProjectionMatrix() { return _camera->getProjectionMatrix(); }
226 /** Get the const projection matrix.*/
227 const osg::Matrixd& getProjectionMatrix() const { return _camera->getProjectionMatrix(); }
229 /** Get the orthographic settings of the orthographic projection matrix.
230 * Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/
231 bool getProjectionMatrixAsOrtho(double& left, double& right,
232 double& bottom, double& top,
233 double& zNear, double& zFar) const;
235 /** Get the frustum setting of a perspective projection matrix.
236 * Returns false if matrix is not a perspective matrix, where parameter values are undefined.*/
237 bool getProjectionMatrixAsFrustum(double& left, double& right,
238 double& bottom, double& top,
239 double& zNear, double& zFar) const;
241 /** Get the frustum setting of a symmetric perspective projection matrix.
242 * Returns false if matrix is not a perspective matrix, where parameter values are undefined.
243 * Note, if matrix is not a symmetric perspective matrix then the shear will be lost.
244 * Asymmetric matrices occur when stereo, power walls, caves and reality center display are used.
245 * In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/
246 bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
247 double& zNear, double& zFar) const;
250 /** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
251 inline void setViewMatrix(const osg::Matrixf& matrix) { _camera->setViewMatrix(matrix); }
253 /** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
254 inline void setViewMatrix(const osg::Matrixd& matrix) { _camera->setViewMatrix(matrix); }
256 /** Set the position and orientation components of the view matrix, using the same convention as gluLookAt. */
257 void setViewMatrixAsLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
259 /** Get the view matrix. */
260 osg::Matrixd& getViewMatrix() { return _camera->getViewMatrix(); }
262 /** Get the const view matrix. */
263 const osg::Matrixd& getViewMatrix() const { return _camera->getViewMatrix(); }
265 /** Get the position and orientation components of a modelview matrix, using the same convention as gluLookAt. */
266 void getViewMatrixAsLookAt(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up,float lookDistance=1.0f) const;
271 void setInitVisitor(osg::NodeVisitor* av) { _initVisitor = av; }
272 osg::NodeVisitor* getInitVisitor() { return _initVisitor.get(); }
273 const osg::NodeVisitor* getInitVisitor() const { return _initVisitor.get(); }
276 void setUpdateVisitor(osg::NodeVisitor* av) { _updateVisitor = av; }
277 osg::NodeVisitor* getUpdateVisitor() { return _updateVisitor.get(); }
278 const osg::NodeVisitor* getUpdateVisitor() const { return _updateVisitor.get(); }
281 void setCullVisitor(osgUtil::CullVisitor* cv) { _cullVisitor = cv; }
282 osgUtil::CullVisitor* getCullVisitor() { return _cullVisitor.get(); }
283 const osgUtil::CullVisitor* getCullVisitor() const { return _cullVisitor.get(); }
285 void setCullVisitorLeft(osgUtil::CullVisitor* cv) { _cullVisitorLeft = cv; }
286 osgUtil::CullVisitor* getCullVisitorLeft() { return _cullVisitorLeft.get(); }
287 const osgUtil::CullVisitor* getCullVisitorLeft() const { return _cullVisitorLeft.get(); }
289 void setCullVisitorRight(osgUtil::CullVisitor* cv) { _cullVisitorRight = cv; }
290 osgUtil::CullVisitor* getCullVisitorRight() { return _cullVisitorRight.get(); }
291 const osgUtil::CullVisitor* getCullVisitorRight() const { return _cullVisitorRight.get(); }
293 void setCollectOccludersVisitor(osg::CollectOccludersVisitor* cov) { _collectOccludersVisitor = cov; }
294 osg::CollectOccludersVisitor* getCollectOccludersVisitor() { return _collectOccludersVisitor.get(); }
295 const osg::CollectOccludersVisitor* getCollectOccludersVisitor() const { return _collectOccludersVisitor.get(); }
298 void setStateGraph(osgUtil::StateGraph* rg) { _stateGraph = rg; }
299 osgUtil::StateGraph* getStateGraph() { return _stateGraph.get(); }
300 const osgUtil::StateGraph* getStateGraph() const { return _stateGraph.get(); }
302 void setStateGraphLeft(osgUtil::StateGraph* rg) { _stateGraphLeft = rg; }
303 osgUtil::StateGraph* getStateGraphLeft() { return _stateGraphLeft.get(); }
304 const osgUtil::StateGraph* getStateGraphLeft() const { return _stateGraphLeft.get(); }
306 void setStateGraphRight(osgUtil::StateGraph* rg) { _stateGraphRight = rg; }
307 osgUtil::StateGraph* getStateGraphRight() { return _stateGraphRight.get(); }
308 const osgUtil::StateGraph* getStateGraphRight() const { return _stateGraphRight.get(); }
311 void setRenderStage(osgUtil::RenderStage* rs) { _renderStage = rs; }
312 osgUtil::RenderStage* getRenderStage() { return _renderStage.get(); }
313 const osgUtil::RenderStage* getRenderStage() const { return _renderStage.get(); }
315 void setRenderStageLeft(osgUtil::RenderStage* rs) { _renderStageLeft = rs; }
316 osgUtil::RenderStage* getRenderStageLeft() { return _renderStageLeft.get(); }
317 const osgUtil::RenderStage* getRenderStageLeft() const { return _renderStageLeft.get(); }
319 void setRenderStageRight(osgUtil::RenderStage* rs) { _renderStageRight = rs; }
320 osgUtil::RenderStage* getRenderStageRight() { return _renderStageRight.get(); }
321 const osgUtil::RenderStage* getRenderStageRight() const { return _renderStageRight.get(); }
323 /** search through any pre and post RenderStages that reference a Camera, and take a reference to each of these cameras to prevent them being deleted while they are still be used by the drawing thread.*/
324 void collateReferencesToDependentCameras();
326 /** clear the reference to any any dependent cameras.*/
327 void clearReferencesToDependentCameras();
330 /** Set the draw buffer value used at the start of each frame draw. Note, overridden in quad buffer stereo mode */
331 void setDrawBufferValue( GLenum drawBufferValue ) { _camera->setDrawBuffer(drawBufferValue); }
333 /** Get the draw buffer value used at the start of each frame draw. */
334 GLenum getDrawBufferValue() const { return _camera->getDrawBuffer(); }
337 /** FusionDistanceMode is used only when working in stereo.*/
338 enum FusionDistanceMode
340 /** Use fusion distance from the value set on the SceneView.*/
341 USE_FUSION_DISTANCE_VALUE,
342 /** Compute the fusion distance by multiplying the screen distance by the fusion distance value.*/
343 PROPORTIONAL_TO_SCREEN_DISTANCE
346 /** Set the FusionDistanceMode and Value. Note, is used only when working in stereo.*/
347 void setFusionDistance(FusionDistanceMode mode,float value=1.0f)
349 _fusionDistanceMode = mode;
350 _fusionDistanceValue = value;
353 /** Get the FusionDistanceMode.*/
354 FusionDistanceMode getFusionDistanceMode() const { return _fusionDistanceMode; }
356 /** Get the FusionDistanceValue. Note, only used for USE_FUSION_DISTANCE_VALUE & PROPORTIONAL_TO_SCREEN_DISTANCE modes.*/
357 float getFusionDistanceValue() const { return _fusionDistanceValue; }
360 /** Set whether the draw method should call renderer->prioritizeTexture.*/
361 void setPrioritizeTextures(bool pt) { _prioritizeTextures = pt; }
363 /** Get whether the draw method should call renderer->prioritizeTexture.*/
364 bool getPrioritizeTextures() const { return _prioritizeTextures; }
366 /** Callback for overidding the default method for compute the offset projection and view matrices.*/
367 struct ComputeStereoMatricesCallback : public osg::Referenced
369 virtual osg::Matrixd computeLeftEyeProjection(const osg::Matrixd& projection) const = 0;
370 virtual osg::Matrixd computeLeftEyeView(const osg::Matrixd& view) const = 0;
372 virtual osg::Matrixd computeRightEyeProjection(const osg::Matrixd& projection) const = 0;
373 virtual osg::Matrixd computeRightEyeView(const osg::Matrixd& view) const = 0;
376 void setComputeStereoMatricesCallback(ComputeStereoMatricesCallback* callback) { _computeStereoMatricesCallback=callback; }
377 ComputeStereoMatricesCallback* getComputeStereoMatricesCallback() { return _computeStereoMatricesCallback.get(); }
378 const ComputeStereoMatricesCallback* getComputeStereoMatricesCallback() const { return _computeStereoMatricesCallback.get(); }
380 /** Calculate the object coordinates of a point in window coordinates.
381 Note, current implementation requires that SceneView::draw() has been previously called
382 for projectWindowIntoObject to produce valid values. Consistent with OpenGL,
383 window coordinates are calculated relative to the bottom left of the window.
384 Returns true on successful projection.
386 bool projectWindowIntoObject(const osg::Vec3& window,osg::Vec3& object) const;
388 /** Calculate the object coordinates of a window x,y when projected onto the near and far planes.
389 Note, current implementation requires that SceneView::draw() has been previously called
390 for projectWindowIntoObject to produce valid values. Consistent with OpenGL,
391 window coordinates are calculated relative to the bottom left of the window.
392 Returns true on successful projection.
394 bool projectWindowXYIntoObject(int x,int y,osg::Vec3& near_point,osg::Vec3& far_point) const;
396 /** Calculate the window coordinates of a point in object coordinates.
397 Note, current implementation requires that SceneView::draw() has been previously called
398 for projectWindowIntoObject to produce valid values. Consistent with OpenGL,
399 window coordinates are calculated relative to the bottom left of the window,
400 whereas window API's normally have the top left as the origin,
401 so you may need to pass in (mouseX,window_height-mouseY,...).
402 Returns true on successful projection.
404 bool projectObjectIntoWindow(const osg::Vec3& object,osg::Vec3& window) const;
407 /** Set the frame stamp for the current frame.*/
408 inline void setFrameStamp(osg::FrameStamp* fs) { _frameStamp = fs; }
410 /** Get the frame stamp for the current frame.*/
411 inline osg::FrameStamp* getFrameStamp() { return _frameStamp.get(); }
413 /** Get the const frame stamp for the current frame.*/
414 inline const osg::FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
417 inline osg::Matrixd computeLeftEyeProjection(const osg::Matrixd& projection) const
419 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeLeftEyeProjection(projection);
420 else return computeLeftEyeProjectionImplementation(projection);
423 inline osg::Matrixd computeLeftEyeView(const osg::Matrixd& view) const
425 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeLeftEyeView(view);
426 else return computeLeftEyeViewImplementation(view);
429 inline osg::Matrixd computeRightEyeProjection(const osg::Matrixd& projection) const
431 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeRightEyeProjection(projection);
432 else return computeRightEyeProjectionImplementation(projection);
435 inline osg::Matrixd computeRightEyeView(const osg::Matrixd& view) const
437 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeRightEyeView(view);
438 else return computeRightEyeViewImplementation(view);
441 /** helper function for computing the left eye projection matrix.*/
442 virtual osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd& projection) const;
444 /** helper function for computing the left eye view matrix.*/
445 virtual osg::Matrixd computeLeftEyeViewImplementation(const osg::Matrixd& view) const;
447 /** helper function for computing the right eye view matrix.*/
448 virtual osg::Matrixd computeRightEyeProjectionImplementation(const osg::Matrixd& projection) const;
450 /** helper function for computing the right eye view matrix.*/
451 virtual osg::Matrixd computeRightEyeViewImplementation(const osg::Matrixd& view) const;
454 /** Inherit the local cull settings variable from a specified CullSettings object, according to the inheritance mask.*/
455 virtual void inheritCullSettings(const osg::CullSettings& settings) { inheritCullSettings(settings, _inheritanceMask); }
457 /** Inherit the local cull settings variable from a specified CullSettings object, according to the inheritance mask.*/
458 virtual void inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask);
461 /** Do init traversal of the attached scene graph using Init NodeVisitor.
462 * The init traversal is called once for each SceneView, and should
463 * be used to compile display lists, texture objects and initialize data
464 * not otherwise initialized during scene graph loading. Note, is
465 * called automatically by update & cull if it hasn't already been called
466 * elsewhere. Also init() should only ever be called within a valid
467 * graphics context.*/
470 /** Do app traversal of the attached scene graph using App NodeVisitor.*/
471 virtual void update();
473 /** Do cull traversal of the attached scene graph using Cull NodeVisitor.*/
476 /** Do draw traversal of draw bins generated by cull traversal.*/
479 /** Compute the number of dynamic objects that will be held in the rendering backend */
480 unsigned int getDynamicObjectCount() const { return _dynamicObjectCount; }
482 /** Release all OpenGL objects from the scene graph, such as texture objects, display lists, etc.
483 * These released scene graphs are placed in the respective delete GLObjects cache, and
484 * then need to be deleted in OpenGL by SceneView::flushAllDeleteGLObjects(). */
485 virtual void releaseAllGLObjects();
487 virtual void resizeGLObjectBuffers(unsigned int maxSize);
488 virtual void releaseGLObjects(osg::State* = 0) const;
490 /** Flush all deleted OpenGL objects, such as texture objects, display lists, etc.*/
491 virtual void flushAllDeletedGLObjects();
493 /** Flush deleted OpenGL objects, such as texture objects, display lists, etc., within the specified available time.*/
494 virtual void flushDeletedGLObjects(double& availableTime);
496 /** Extract stats for current draw list. */
497 bool getStats(Statistics& primStats);
499 /** Set whether the SceneView should automatically call flushDeletedObjects() on each new frame.*/
500 void setAutomaticFlush(bool automaticFlush) { _automaticFlush = automaticFlush; }
501 bool getAutomaticFlush() const { return _automaticFlush; }
503 void setResetColorMaskToAllOn(bool enable) { _resetColorMaskToAllEnabled = enable; }
504 bool getResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
508 virtual ~SceneView();
510 /** Do cull traversal of attached scene graph using Cull NodeVisitor. Return true if computeNearFar has been done during the cull traversal.*/
511 virtual bool cullStage(const osg::Matrixd& projection,const osg::Matrixd& modelview,osgUtil::CullVisitor* cullVisitor, osgUtil::StateGraph* rendergraph, osgUtil::RenderStage* renderStage, osg::Viewport *viewport);
513 void computeLeftEyeViewport(const osg::Viewport *viewport);
514 void computeRightEyeViewport(const osg::Viewport *viewport);
516 const osg::Matrix computeMVPW() const;
518 void clearArea(int x,int y,int width,int height,const osg::Vec4& color);
520 osg::ref_ptr<osg::StateSet> _localStateSet;
521 osg::RenderInfo _renderInfo;
524 osg::ref_ptr<osg::NodeVisitor> _initVisitor;
525 osg::ref_ptr<osg::NodeVisitor> _updateVisitor;
526 osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor;
527 osg::ref_ptr<osgUtil::StateGraph> _stateGraph;
528 osg::ref_ptr<osgUtil::RenderStage> _renderStage;
530 osg::ref_ptr<ComputeStereoMatricesCallback> _computeStereoMatricesCallback;
532 osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorLeft;
533 osg::ref_ptr<osgUtil::StateGraph> _stateGraphLeft;
534 osg::ref_ptr<osgUtil::RenderStage> _renderStageLeft;
535 osg::ref_ptr<osg::Viewport> _viewportLeft;
537 osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorRight;
538 osg::ref_ptr<osgUtil::StateGraph> _stateGraphRight;
539 osg::ref_ptr<osgUtil::RenderStage> _renderStageRight;
540 osg::ref_ptr<osg::Viewport> _viewportRight;
542 osg::ref_ptr<osg::CollectOccludersVisitor> _collectOccludersVisitor;
544 osg::ref_ptr<osg::FrameStamp> _frameStamp;
546 osg::observer_ptr<osg::Camera> _camera;
547 osg::ref_ptr<osg::Camera> _cameraWithOwnership;
549 osg::ref_ptr<osg::StateSet> _globalStateSet;
550 osg::ref_ptr<osg::Light> _light;
551 osg::ref_ptr<osg::DisplaySettings> _displaySettings;
553 osg::ref_ptr<osg::StateSet> _secondaryStateSet;
555 FusionDistanceMode _fusionDistanceMode;
556 float _fusionDistanceValue;
558 LightingMode _lightingMode;
560 bool _prioritizeTextures;
562 bool _automaticFlush;
566 double _previousFrameTime;
567 double _previousSimulationTime;
569 bool _redrawInterlacedStereoStencilMask;
570 int _interlacedStereoStencilWidth;
571 int _interlacedStereoStencilHeight;
573 unsigned int _dynamicObjectCount;
575 bool _resetColorMaskToAllEnabled;