OpenSceneGraph 3.6.5
SceneView
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
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.
7 *
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.
12*/
13
14#ifndef OSGUTIL_SCENEVIEW
15#define OSGUTIL_SCENEVIEW 1
16
17#include <osg/Node>
18#include <osg/StateSet>
19#include <osg/Light>
20#include <osg/FrameStamp>
21#include <osg/DisplaySettings>
23#include <osg/CullSettings>
24#include <osg/Camera>
25
26#include <osgUtil/CullVisitor>
27
28namespace osgUtil {
29
37{
38 public:
39
42
43 SceneView(const SceneView& sceneview, const osg::CopyOp& copyop = osg::CopyOp());
44
46
61
62 /* Set defaults. */
64
68 virtual void setDefaults(unsigned int options);
69
71 void setCamera(osg::Camera* camera, bool assumeOwnershipOfCamera = true);
72
74 osg::Camera* getCamera() { return _camera.get(); }
75
77 const osg::Camera* getCamera() const { return _camera.get(); }
78
83
87 osg::Node* getSceneData(unsigned int childNo=0) { return (_camera->getNumChildren()>childNo) ? _camera->getChild(childNo) : 0; }
88
92 const osg::Node* getSceneData(unsigned int childNo=0) const { return (_camera->getNumChildren()>childNo) ? _camera->getChild(childNo) : 0; }
93
95 unsigned int getNumSceneData() const { return _camera->getNumChildren(); }
96
98 void setViewport(osg::Viewport* viewport) { _camera->setViewport(viewport); }
99
101 void setViewport(int x,int y,int width,int height) { _camera->setViewport(x,y,width,height); }
102
103
105 osg::Viewport* getViewport() { return (_camera->getViewport()!=0) ? _camera->getViewport() : 0; }
106
108 const osg::Viewport* getViewport() const { return (_camera->getViewport()!=0) ? _camera->getViewport() : 0; }
109
112
114 inline const osg::DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); }
115
118
119
122 void setClearColor(const osg::Vec4& color) { _camera->setClearColor(color); }
123
125 const osg::Vec4& getClearColor() const { return _camera->getClearColor(); }
126
127
130
133
134
137 const osg::StateSet* getGlobalStateSet() const { return _globalStateSet.get(); }
138
142
145 const osg::StateSet* getLocalStateSet() const { return _localStateSet.get(); }
146
165
167 void setActiveUniforms(int activeUniforms) { _activeUniforms = activeUniforms; }
168
170 int getActiveUniforms() const { return _activeUniforms; }
171
173
174
176
179
180 void setLight(osg::Light* light) { _light = light; }
181 osg::Light* getLight() { return _light.get(); }
182 const osg::Light* getLight() const { return _light.get(); }
183
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(); }
187
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(); }
191
192 void setRenderInfo(osg::RenderInfo& renderInfo) { _renderInfo = renderInfo; }
194 const osg::RenderInfo& getRenderInfo() const { return _renderInfo; }
195
196
197
199 inline void setProjectionMatrix(const osg::Matrixf& matrix) { _camera->setProjectionMatrix(matrix); }
200
202 inline void setProjectionMatrix(const osg::Matrixd& matrix) { _camera->setProjectionMatrix(matrix); }
203
205 void setProjectionMatrixAsOrtho(double left, double right,
206 double bottom, double top,
207 double zNear, double zFar);
208
210 void setProjectionMatrixAsOrtho2D(double left, double right,
211 double bottom, double top);
212
214 void setProjectionMatrixAsFrustum(double left, double right,
215 double bottom, double top,
216 double zNear, double zFar);
217
220 void setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
221 double zNear, double zFar);
222
224 osg::Matrixd& getProjectionMatrix() { return _camera->getProjectionMatrix(); }
225
227 const osg::Matrixd& getProjectionMatrix() const { return _camera->getProjectionMatrix(); }
228
231 bool getProjectionMatrixAsOrtho(double& left, double& right,
232 double& bottom, double& top,
233 double& zNear, double& zFar) const;
234
237 bool getProjectionMatrixAsFrustum(double& left, double& right,
238 double& bottom, double& top,
239 double& zNear, double& zFar) const;
240
246 bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
247 double& zNear, double& zFar) const;
248
249
251 inline void setViewMatrix(const osg::Matrixf& matrix) { _camera->setViewMatrix(matrix); }
252
254 inline void setViewMatrix(const osg::Matrixd& matrix) { _camera->setViewMatrix(matrix); }
255
257 void setViewMatrixAsLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
258
260 osg::Matrixd& getViewMatrix() { return _camera->getViewMatrix(); }
261
263 const osg::Matrixd& getViewMatrix() const { return _camera->getViewMatrix(); }
264
266 void getViewMatrixAsLookAt(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up,float lookDistance=1.0f) const;
267
268
269
270
273 const osg::NodeVisitor* getInitVisitor() const { return _initVisitor.get(); }
274
275
278 const osg::NodeVisitor* getUpdateVisitor() const { return _updateVisitor.get(); }
279
280
283 const osgUtil::CullVisitor* getCullVisitor() const { return _cullVisitor.get(); }
284
288
292
296
297
300 const osgUtil::StateGraph* getStateGraph() const { return _stateGraph.get(); }
301
305
309
310
313 const osgUtil::RenderStage* getRenderStage() const { return _renderStage.get(); }
314
318
322
325
328
329
331 void setDrawBufferValue( GLenum drawBufferValue ) { _camera->setDrawBuffer(drawBufferValue); }
332
334 GLenum getDrawBufferValue() const { return _camera->getDrawBuffer(); }
335
336
345
347 void setFusionDistance(FusionDistanceMode mode,float value=1.0f)
348 {
349 _fusionDistanceMode = mode;
350 _fusionDistanceValue = value;
351 }
352
355
358
359
362
365
368 {
369 virtual osg::Matrixd computeLeftEyeProjection(const osg::Matrixd& projection) const = 0;
370 virtual osg::Matrixd computeLeftEyeView(const osg::Matrixd& view) const = 0;
371
372 virtual osg::Matrixd computeRightEyeProjection(const osg::Matrixd& projection) const = 0;
373 virtual osg::Matrixd computeRightEyeView(const osg::Matrixd& view) const = 0;
374 };
375
379
386 bool projectWindowIntoObject(const osg::Vec3& window,osg::Vec3& object) const;
387
394 bool projectWindowXYIntoObject(int x,int y,osg::Vec3& near_point,osg::Vec3& far_point) const;
395
404 bool projectObjectIntoWindow(const osg::Vec3& object,osg::Vec3& window) const;
405
406
408 inline void setFrameStamp(osg::FrameStamp* fs) { _frameStamp = fs; }
409
411 inline osg::FrameStamp* getFrameStamp() { return _frameStamp.get(); }
412
414 inline const osg::FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
415
416
417 inline osg::Matrixd computeLeftEyeProjection(const osg::Matrixd& projection) const
418 {
419 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeLeftEyeProjection(projection);
420 else return computeLeftEyeProjectionImplementation(projection);
421 }
422
424 {
425 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeLeftEyeView(view);
426 else return computeLeftEyeViewImplementation(view);
427 }
428
430 {
431 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeRightEyeProjection(projection);
432 else return computeRightEyeProjectionImplementation(projection);
433 }
434
436 {
437 if (_computeStereoMatricesCallback.valid()) return _computeStereoMatricesCallback->computeRightEyeView(view);
438 else return computeRightEyeViewImplementation(view);
439 }
440
443
446
449
452
453
455 virtual void inheritCullSettings(const osg::CullSettings& settings) { inheritCullSettings(settings, _inheritanceMask); }
456
458 virtual void inheritCullSettings(const osg::CullSettings& settings, unsigned int inheritanceMask);
459
460
468 virtual void init();
469
471 virtual void update();
472
474 virtual void cull();
475
477 virtual void draw();
478
480 unsigned int getDynamicObjectCount() const { return _dynamicObjectCount; }
481
485 virtual void releaseAllGLObjects();
486
487 virtual void resizeGLObjectBuffers(unsigned int maxSize);
488 virtual void releaseGLObjects(osg::State* = 0) const;
489
492
494 virtual void flushDeletedGLObjects(double& availableTime);
495
497 bool getStats(Statistics& primStats);
498
500 void setAutomaticFlush(bool automaticFlush) { _automaticFlush = automaticFlush; }
501 bool getAutomaticFlush() const { return _automaticFlush; }
502
505
506 protected:
507
508 virtual ~SceneView();
509
511 virtual bool cullStage(const osg::Matrixd& projection,const osg::Matrixd& modelview,osgUtil::CullVisitor* cullVisitor, osgUtil::StateGraph* rendergraph, osgUtil::RenderStage* renderStage, osg::Viewport *viewport);
512
515
517
518 void clearArea(int x,int y,int width,int height,const osg::Vec4& color);
519
522
529
531
536
541
543
545
548
552
554
557
559
561
564
568
572
574
576};
577
578}
579
580#endif
581
Vec3f Vec3
Definition Vec3:21
Matrixd Matrix
Definition Matrix:27
Vec4f Vec4
Definition Vec4:21
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Definition CollectOccludersVisitor:25
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
Definition CullSettings:28
InheritanceMask _inheritanceMask
Definition CullSettings:251
DisplaySettings class for encapsulating what visuals are required and have been set up,...
Definition DisplaySettings:34
Class which encapsulates the frame number, reference time and calendar time of specific frame,...
Definition FrameStamp:35
Light state class which encapsulates OpenGL glLight() functionality.
Definition Light:40
Definition Matrixd:27
Definition Matrixf:27
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
Definition RenderInfo:28
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
View - maintains a master camera view and a list of slave cameras that are relative to this master ca...
Definition View:30
Encapsulate OpenGL glViewport.
Definition Viewport:24
Basic NodeVisitor implementation for rendering a scene.
Definition CullVisitor:49
RenderStage base class.
Definition RenderStage:38
osg::Matrixd computeRightEyeView(const osg::Matrixd &view) const
Definition SceneView:435
void setFrameStamp(osg::FrameStamp *fs)
Set the frame stamp for the current frame.
Definition SceneView:408
void setFusionDistance(FusionDistanceMode mode, float value=1.0f)
Set the FusionDistanceMode and Value.
Definition SceneView:347
osg::ref_ptr< osg::NodeVisitor > _updateVisitor
Definition SceneView:525
void setLight(osg::Light *light)
Definition SceneView:180
virtual void setDefaults()
Definition SceneView:63
double _previousFrameTime
Definition SceneView:566
virtual void inheritCullSettings(const osg::CullSettings &settings)
Inherit the local cull settings variable from a specified CullSettings object, according to the inher...
Definition SceneView:455
osgUtil::StateGraph * getStateGraphLeft()
Definition SceneView:303
void setPrioritizeTextures(bool pt)
Set whether the draw method should call renderer->prioritizeTexture.
Definition SceneView:361
osg::NodeVisitor * getUpdateVisitor()
Definition SceneView:277
osg::DisplaySettings * getDisplaySettings()
Get the DisplaySettings.
Definition SceneView:117
void setComputeStereoMatricesCallback(ComputeStereoMatricesCallback *callback)
Definition SceneView:376
unsigned int _dynamicObjectCount
Definition SceneView:573
osg::Camera * getCamera()
Get the camera used to represent the camera view of this SceneView.
Definition SceneView:74
void setProjectionMatrixAsOrtho(double left, double right, double bottom, double top, double zNear, double zFar)
Set to an orthographic projection.
const osgUtil::CullVisitor * getCullVisitorRight() const
Definition SceneView:291
void setViewMatrix(const osg::Matrixf &matrix)
Set the view matrix.
Definition SceneView:251
const osg::View * getView() const
Definition SceneView:190
void setRenderStage(osgUtil::RenderStage *rs)
Definition SceneView:311
osg::ref_ptr< osgUtil::StateGraph > _stateGraphRight
Definition SceneView:538
bool getPrioritizeTextures() const
Get whether the draw method should call renderer->prioritizeTexture.
Definition SceneView:364
void computeRightEyeViewport(const osg::Viewport *viewport)
LightingMode _lightingMode
Definition SceneView:558
osg::Viewport * getViewport()
Get the viewport.
Definition SceneView:105
unsigned int getNumSceneData() const
Get the number of scene data subgraphs added to the SceneView's camera.
Definition SceneView:95
void setClearColor(const osg::Vec4 &color)
Set the color used in glClearColor().
Definition SceneView:122
FusionDistanceMode _fusionDistanceMode
Definition SceneView:555
const osg::FrameStamp * getFrameStamp() const
Get the const frame stamp for the current frame.
Definition SceneView:414
const osg::Light * getLight() const
Definition SceneView:182
void setDrawBufferValue(GLenum drawBufferValue)
Set the draw buffer value used at the start of each frame draw.
Definition SceneView:331
virtual void releaseGLObjects(osg::State *=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
osg::ref_ptr< osgUtil::StateGraph > _stateGraphLeft
Definition SceneView:533
void getViewMatrixAsLookAt(osg::Vec3 &eye, osg::Vec3 &center, osg::Vec3 &up, float lookDistance=1.0f) const
Get the position and orientation components of a modelview matrix, using the same convention as gluLo...
const osg::Matrixd & getProjectionMatrix() const
Get the const projection matrix.
Definition SceneView:227
int _interlacedStereoStencilWidth
Definition SceneView:570
bool getProjectionMatrixAsPerspective(double &fovy, double &aspectRatio, double &zNear, double &zFar) const
Get the frustum setting of a symmetric perspective projection matrix.
osg::RenderInfo _renderInfo
Definition SceneView:521
const ComputeStereoMatricesCallback * getComputeStereoMatricesCallback() const
Definition SceneView:378
const osg::NodeVisitor * getUpdateVisitor() const
Definition SceneView:278
osg::ref_ptr< osg::StateSet > _secondaryStateSet
Definition SceneView:553
osg::ref_ptr< osgUtil::StateGraph > _stateGraph
Definition SceneView:527
float _fusionDistanceValue
Definition SceneView:556
void setActiveUniforms(int activeUniforms)
Set the uniforms that SceneView should set set up on each frame.
Definition SceneView:167
void setStateGraphLeft(osgUtil::StateGraph *rg)
Definition SceneView:302
const osg::CollectOccludersVisitor * getCollectOccludersVisitor() const
Definition SceneView:295
const osgUtil::StateGraph * getStateGraph() const
Definition SceneView:300
osg::ref_ptr< osgUtil::CullVisitor > _cullVisitorRight
Definition SceneView:537
const osg::Matrix computeMVPW() const
osg::ref_ptr< osgUtil::RenderStage > _renderStageRight
Definition SceneView:539
osg::Matrixd computeRightEyeProjection(const osg::Matrixd &projection) const
Definition SceneView:429
void setProjectionMatrix(const osg::Matrixd &matrix)
Set the projection matrix.
Definition SceneView:202
osg::ref_ptr< osg::FrameStamp > _frameStamp
Definition SceneView:544
osg::StateSet * getSecondaryStateSet()
Definition SceneView:140
osgUtil::CullVisitor * getCullVisitor()
Definition SceneView:282
void setViewport(int x, int y, int width, int height)
Set the viewport of the scene view to specified dimensions.
Definition SceneView:101
virtual void update()
Do app traversal of the attached scene graph using App NodeVisitor.
osg::Matrixd & getProjectionMatrix()
Get the projection matrix.
Definition SceneView:224
void setRenderInfo(osg::RenderInfo &renderInfo)
Definition SceneView:192
const osgUtil::StateGraph * getStateGraphRight() const
Definition SceneView:308
bool _requiresFlush
Definition SceneView:563
virtual void setDefaults(unsigned int options)
Set scene view to use default global state, light, camera and render visitor.
void setView(osg::View *view)
Definition SceneView:188
osgUtil::StateGraph * getStateGraphRight()
Definition SceneView:307
virtual osg::Matrixd computeRightEyeProjectionImplementation(const osg::Matrixd &projection) const
helper function for computing the right eye view matrix.
void setRedrawInterlacedStereoStencilMask(bool flag)
Manually set the redraw interlaced stereo stencil mask request flag to control whether to redraw the ...
Definition SceneView:129
void setResetColorMaskToAllOn(bool enable)
Definition SceneView:503
const osgUtil::CullVisitor * getCullVisitor() const
Definition SceneView:283
SceneView(osg::DisplaySettings *ds=NULL)
Construct a default scene view.
void setCollectOccludersVisitor(osg::CollectOccludersVisitor *cov)
Definition SceneView:293
osg::NodeVisitor * getInitVisitor()
Definition SceneView:272
bool getAutomaticFlush() const
Definition SceneView:501
int getActiveUniforms() const
Get the uniforms that SceneView should set set up on each frame.
Definition SceneView:170
void setStateGraphRight(osgUtil::StateGraph *rg)
Definition SceneView:306
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
virtual void draw()
Do draw traversal of draw bins generated by cull traversal.
const osgUtil::RenderStage * getRenderStage() const
Definition SceneView:313
void setUpdateVisitor(osg::NodeVisitor *av)
Definition SceneView:276
void setLocalStateSet(osg::StateSet *state)
Definition SceneView:143
void collateReferencesToDependentCameras()
search through any pre and post RenderStages that reference a Camera, and take a reference to each of...
bool getProjectionMatrixAsOrtho(double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const
Get the orthographic settings of the orthographic projection matrix.
void setCullVisitorRight(osgUtil::CullVisitor *cv)
Definition SceneView:289
virtual osg::Matrixd computeLeftEyeViewImplementation(const osg::Matrixd &view) const
helper function for computing the left eye view matrix.
const osgUtil::CullVisitor * getCullVisitorLeft() const
Definition SceneView:287
osgUtil::CullVisitor * getCullVisitorLeft()
Definition SceneView:286
float getFusionDistanceValue() const
Get the FusionDistanceValue.
Definition SceneView:357
ActiveUniforms
Definition SceneView:148
@ VIEW_MATRIX_UNIFORM
Definition SceneView:154
@ DELTA_FRAME_TIME_UNIFORM
Definition SceneView:151
@ ALL_UNIFORMS
Definition SceneView:163
@ FRAME_TIME_UNIFORM
Definition SceneView:150
@ FRAME_NUMBER_UNIFORM
Definition SceneView:149
@ DELTA_SIMULATION_TIME_UNIFORM
Definition SceneView:153
@ DEFAULT_UNIFORMS
Definition SceneView:156
@ SIMULATION_TIME_UNIFORM
Definition SceneView:152
@ VIEW_MATRIX_INVERSE_UNIFORM
Definition SceneView:155
bool _initCalled
Definition SceneView:523
const osgUtil::RenderStage * getRenderStageLeft() const
Definition SceneView:317
void setCullVisitorLeft(osgUtil::CullVisitor *cv)
Definition SceneView:285
const osg::RenderInfo & getRenderInfo() const
Definition SceneView:194
osg::StateSet * getLocalStateSet()
Definition SceneView:144
osg::View * getView()
Definition SceneView:189
void setSceneData(osg::Node *node)
Set the data to view.
bool getRedrawInterlacedStereoStencilMask() const
Get the redraw interlaced stereo stencil mask request flag.
Definition SceneView:132
void setViewport(osg::Viewport *viewport)
Set the viewport of the scene view to use specified osg::Viewport.
Definition SceneView:98
osg::ref_ptr< osg::StateSet > _globalStateSet
Definition SceneView:549
const osg::StateSet * getGlobalStateSet() const
Definition SceneView:137
osg::ref_ptr< osg::DisplaySettings > _displaySettings
Definition SceneView:551
void setProjectionMatrixAsPerspective(double fovy, double aspectRatio, double zNear, double zFar)
Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further deta...
const osg::Matrixd & getViewMatrix() const
Get the const view matrix.
Definition SceneView:263
osg::State * getState()
Definition SceneView:185
LightingMode getLightingMode() const
Definition SceneView:178
void setState(osg::State *state)
Definition SceneView:184
void setViewMatrix(const osg::Matrixd &matrix)
Set the view matrix.
Definition SceneView:254
bool _redrawInterlacedStereoStencilMask
Definition SceneView:569
bool _resetColorMaskToAllEnabled
Definition SceneView:575
void setProjectionMatrixAsFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
Set to a perspective projection.
const osg::StateSet * getLocalStateSet() const
Definition SceneView:145
void setCamera(osg::Camera *camera, bool assumeOwnershipOfCamera=true)
Set the camera used to represent the camera view of this SceneView.
bool projectObjectIntoWindow(const osg::Vec3 &object, osg::Vec3 &window) const
Calculate the window coordinates of a point in object coordinates.
virtual void inheritCullSettings(const osg::CullSettings &settings, unsigned int inheritanceMask)
Inherit the local cull settings variable from a specified CullSettings object, according to the inher...
osg::ref_ptr< osgUtil::RenderStage > _renderStageLeft
Definition SceneView:534
const osg::Viewport * getViewport() const
Get the const viewport.
Definition SceneView:108
osg::ref_ptr< osg::CollectOccludersVisitor > _collectOccludersVisitor
Definition SceneView:542
const osgUtil::RenderStage * getRenderStageRight() const
Definition SceneView:321
SceneView(const SceneView &sceneview, const osg::CopyOp &copyop=osg::CopyOp())
virtual osg::Matrixd computeRightEyeViewImplementation(const osg::Matrixd &view) const
helper function for computing the right eye view matrix.
void clearReferencesToDependentCameras()
clear the reference to any any dependent cameras.
osg::ref_ptr< osg::Viewport > _viewportLeft
Definition SceneView:535
virtual void cull()
Do cull traversal of the attached scene graph using Cull NodeVisitor.
osg::ref_ptr< osg::Camera > _cameraWithOwnership
Definition SceneView:547
double _previousSimulationTime
Definition SceneView:567
virtual bool cullStage(const osg::Matrixd &projection, const osg::Matrixd &modelview, osgUtil::CullVisitor *cullVisitor, osgUtil::StateGraph *rendergraph, osgUtil::RenderStage *renderStage, osg::Viewport *viewport)
Do cull traversal of attached scene graph using Cull NodeVisitor.
bool _automaticFlush
Definition SceneView:562
void setRenderStageRight(osgUtil::RenderStage *rs)
Definition SceneView:319
virtual void flushAllDeletedGLObjects()
Flush all deleted OpenGL objects, such as texture objects, display lists, etc.
const osg::NodeVisitor * getInitVisitor() const
Definition SceneView:273
osg::Matrixd computeLeftEyeView(const osg::Matrixd &view) const
Definition SceneView:423
const osgUtil::StateGraph * getStateGraphLeft() const
Definition SceneView:304
Options LightingMode
Definition SceneView:175
osgUtil::RenderStage * getRenderStageLeft()
Definition SceneView:316
void setDisplaySettings(osg::DisplaySettings *vs)
Set the DisplaySettings.
Definition SceneView:111
osg::Node * getSceneData(unsigned int childNo=0)
Get the scene data to view.
Definition SceneView:87
osg::ref_ptr< osgUtil::CullVisitor > _cullVisitor
Definition SceneView:526
osg::Matrixd & getViewMatrix()
Get the view matrix.
Definition SceneView:260
osg::ref_ptr< osg::Light > _light
Definition SceneView:550
virtual osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd &projection) const
helper function for computing the left eye projection matrix.
FusionDistanceMode
FusionDistanceMode is used only when working in stereo.
Definition SceneView:339
@ PROPORTIONAL_TO_SCREEN_DISTANCE
Compute the fusion distance by multiplying the screen distance by the fusion distance value.
Definition SceneView:343
@ USE_FUSION_DISTANCE_VALUE
Use fusion distance from the value set on the SceneView.
Definition SceneView:341
osgUtil::StateGraph * getStateGraph()
Definition SceneView:299
unsigned int getDynamicObjectCount() const
Compute the number of dynamic objects that will be held in the rendering backend.
Definition SceneView:480
void setStateGraph(osgUtil::StateGraph *rg)
Definition SceneView:298
void setCullVisitor(osgUtil::CullVisitor *cv)
Definition SceneView:281
const osg::State * getState() const
Definition SceneView:186
osg::RenderInfo & getRenderInfo()
Definition SceneView:193
bool getProjectionMatrixAsFrustum(double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const
Get the frustum setting of a perspective projection matrix.
osg::ref_ptr< osg::StateSet > _localStateSet
Definition SceneView:520
void clearArea(int x, int y, int width, int height, const osg::Vec4 &color)
bool _prioritizeTextures
Definition SceneView:560
osg::ref_ptr< osgUtil::RenderStage > _renderStage
Definition SceneView:528
virtual void releaseAllGLObjects()
Release all OpenGL objects from the scene graph, such as texture objects, display lists,...
bool getStats(Statistics &primStats)
Extract stats for current draw list.
osg::ref_ptr< osg::Viewport > _viewportRight
Definition SceneView:540
void setSecondaryStateSet(osg::StateSet *state)
Definition SceneView:139
Options
Definition SceneView:48
@ NO_SCENEVIEW_LIGHT
Definition SceneView:49
@ APPLY_GLOBAL_DEFAULTS
Definition SceneView:53
@ CLEAR_GLOBAL_STATESET
Definition SceneView:54
@ COMPILE_GLOBJECTS_AT_INIT
Definition SceneView:52
@ SKY_LIGHT
Definition SceneView:51
@ HEADLIGHT
Definition SceneView:50
@ STANDARD_SETTINGS
Definition SceneView:55
osg::Matrixd computeLeftEyeProjection(const osg::Matrixd &projection) const
Definition SceneView:417
const osg::StateSet * getSecondaryStateSet() const
Definition SceneView:141
osg::StateSet * getGlobalStateSet()
Definition SceneView:136
osgUtil::RenderStage * getRenderStage()
Definition SceneView:312
void setProjectionMatrixAsOrtho2D(double left, double right, double bottom, double top)
Set to a 2D orthographic projection.
osg::ref_ptr< osgUtil::CullVisitor > _cullVisitorLeft
Definition SceneView:532
osg::ref_ptr< osg::NodeVisitor > _initVisitor
Definition SceneView:524
ComputeStereoMatricesCallback * getComputeStereoMatricesCallback()
Definition SceneView:377
osgUtil::CullVisitor * getCullVisitorRight()
Definition SceneView:290
GLenum getDrawBufferValue() const
Get the draw buffer value used at the start of each frame draw.
Definition SceneView:334
virtual ~SceneView()
void setLightingMode(LightingMode mode)
osg::ref_ptr< ComputeStereoMatricesCallback > _computeStereoMatricesCallback
Definition SceneView:530
virtual void flushDeletedGLObjects(double &availableTime)
Flush deleted OpenGL objects, such as texture objects, display lists, etc., within the specified avai...
const osg::Camera * getCamera() const
Get the const camera used to represent the camera view of this SceneView.
Definition SceneView:77
const osg::Vec4 & getClearColor() const
Get the color used in glClearColor.
Definition SceneView:125
void setGlobalStateSet(osg::StateSet *state)
Definition SceneView:135
FusionDistanceMode getFusionDistanceMode() const
Get the FusionDistanceMode.
Definition SceneView:354
void setProjectionMatrix(const osg::Matrixf &matrix)
Set the projection matrix.
Definition SceneView:199
osg::FrameStamp * getFrameStamp()
Get the frame stamp for the current frame.
Definition SceneView:411
void setRenderStageLeft(osgUtil::RenderStage *rs)
Definition SceneView:315
osg::Light * getLight()
Definition SceneView:181
osg::CollectOccludersVisitor * getCollectOccludersVisitor()
Definition SceneView:294
int _activeUniforms
Definition SceneView:565
bool projectWindowIntoObject(const osg::Vec3 &window, osg::Vec3 &object) const
Calculate the object coordinates of a point in window coordinates.
void setInitVisitor(osg::NodeVisitor *av)
Definition SceneView:271
const osg::DisplaySettings * getDisplaySettings() const
Get the const DisplaySettings.
Definition SceneView:114
bool getResetColorMaskToAllOn() const
Definition SceneView:504
osgUtil::RenderStage * getRenderStageRight()
Definition SceneView:320
bool projectWindowXYIntoObject(int x, int y, osg::Vec3 &near_point, osg::Vec3 &far_point) const
Calculate the object coordinates of a window x,y when projected onto the near and far planes.
void computeLeftEyeViewport(const osg::Viewport *viewport)
int _interlacedStereoStencilHeight
Definition SceneView:571
void setViewMatrixAsLookAt(const osg::Vec3 &eye, const osg::Vec3 &center, const osg::Vec3 &up)
Set the position and orientation components of the view matrix, using the same convention as gluLookA...
virtual void init()
Do init traversal of the attached scene graph using Init NodeVisitor.
osg::observer_ptr< osg::Camera > _camera
Definition SceneView:546
void setAutomaticFlush(bool automaticFlush)
Set whether the SceneView should automatically call flushDeletedObjects() on each new frame.
Definition SceneView:500
const osg::Node * getSceneData(unsigned int childNo=0) const
Get the const scene data which to view.
Definition SceneView:92
META_Object(osgUtil, SceneView)
Callback for overidding the default method for compute the offset projection and view matrices.
Definition SceneView:368
virtual osg::Matrixd computeRightEyeProjection(const osg::Matrixd &projection) const =0
virtual osg::Matrixd computeLeftEyeProjection(const osg::Matrixd &projection) const =0
virtual osg::Matrixd computeLeftEyeView(const osg::Matrixd &view) const =0
virtual osg::Matrixd computeRightEyeView(const osg::Matrixd &view) const =0
StateGraph - contained in a renderBin, defines the scene to be drawn.
Definition StateGraph:42
Statistics base class.
Definition Statistics:48
#define NULL
Definition Export:55
#define OSGUTIL_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.