SceneView is literally a view of a scene, encapsulating the camera (modelview+projection matrices), global state, lights and the scene itself.
Inheritance:
Public Methods
-
SceneView(osg::DisplaySettings* ds=NULL)
- Construct a default scene view
-
void setDefaults()
- Set scene view to use default global state, light, camera and render visitor
-
void setSceneData(osg::Node* node)
- Set the data which to view.
-
osg::Node* getSceneData()
- Get the scene data which to view.
-
const osg::Node* getSceneData() const
- Get the const scene data which to view.
-
void setViewport(osg::Viewport* viewport)
- Set the viewport of the scene view to use specfied osg::Viewport.
-
void setViewport(int x, int y, int width, int height)
- Set the viewport of the scene view to specified dimensions.
-
const osg::Viewport* getViewport() const
- Get the const viewport.
-
osg::Viewport* getViewport()
- Get the viewport.
-
void getViewport(int& x, int& y, int& width, int& height)
- Get the viewport of the scene view.
-
inline void setDisplaySettings(osg::DisplaySettings* vs)
- Set the DisplaySettings.
-
inline const osg::DisplaySettings* getDisplaySettings() const
- Get the const DisplaySettings
-
inline osg::DisplaySettings* getDisplaySettings()
- Get the DisplaySettings
-
void setBackgroundColor(const osg::Vec4& color)
- Set the background color used in glClearColor().
-
const osg::Vec4& getBackgroundColor() const
- Get the background color
-
void setGlobalStateSet(osg::StateSet* state)
-
osg::StateSet* getGlobalStateSet()
-
const osg::StateSet* getGlobalStateSet() const
-
void setLocalStateSet(osg::StateSet* state)
-
osg::StateSet* getLocalStateSet()
-
const osg::StateSet* getLocalStateSet() const
-
void setLightingMode(LightingMode mode)
-
LightingMode getLightingMode() const
-
void setLight(osg::Light* light)
-
osg::Light* getLight()
-
const osg::Light* getLight() const
-
void setState(osg::State* state)
-
osg::State* getState()
-
const osg::State* getState() const
-
void setProjectionMatrix(const osg::Matrix& matrix)
- Set the projection matrix.
-
void setProjectionMatrixAsOrtho(double left, double right, double bottom, double top, double zNear, double zFar)
- Set to a orthographic projection.
-
void setProjectionMatrixAsOrtho2D(double left, double right, double bottom, double top)
- Set to a 2D orthographic projection.
-
void setProjectionMatrixAsFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
- Set to a perspective projection.
-
void setProjectionMatrixAsPerspective(double fovy, double aspectRatio, double zNear, double zFar)
- Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
-
osg::Matrix& getProjectionMatrix()
- Get the projection matrix
-
const osg::Matrix& getProjectionMatrix() const
- Get the const projection matrix
-
void getProjectionMatrixAsOrtho(double& left, double& right, double& bottom, double& top, double& zNear, double& zFar)
- Get the othorgraphic settings of the orthographic projection matrix.
-
void getProjectionMatrixAsFrustum(double& left, double& right, double& bottom, double& top, double& zNear, double& zFar)
- Get the frustum setting of a perspective projection matrix.
-
void setViewMatrix(const osg::Matrix& matrix)
- Set the view matrix.
-
void setViewMatrixAsLookAt(const osg::Vec3& eye, const osg::Vec3& center, const osg::Vec3& up)
- Set to the position and orientation of view matrix, using the same convention as gluLookAt.
-
osg::Matrix& getViewMatrix()
- Get the view matrix.
-
const osg::Matrix& getViewMatrix() const
- Get the const view matrix.
-
void getViewMatrixAsLookAt(osg::Vec3& eye, osg::Vec3& center, osg::Vec3& up, float lookDistance=1.0f)
- Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt.
-
void setInitVisitor(osg::NodeVisitor* av)
-
osg::NodeVisitor* getInitVisitor()
-
const osg::NodeVisitor* getInitVisitor() const
-
void setUpdateVisitor(osg::NodeVisitor* av)
-
osg::NodeVisitor* getUpdateVisitor()
-
const osg::NodeVisitor* getUpdateVisitor() const
-
void setCullVisitor(osgUtil::CullVisitor* cv)
-
osgUtil::CullVisitor* getCullVisitor()
-
const osgUtil::CullVisitor* getCullVisitor() const
-
void setCullVisitorLeft(osgUtil::CullVisitor* cv)
-
osgUtil::CullVisitor* getCullVisitorLeft()
-
const osgUtil::CullVisitor* getCullVisitorLeft() const
-
void setCullVisitorRight(osgUtil::CullVisitor* cv)
-
osgUtil::CullVisitor* getCullVisitorRight()
-
const osgUtil::CullVisitor* getCullVisitorRight() const
-
void setRenderGraph(osgUtil::RenderGraph* rg)
-
osgUtil::RenderGraph* getRenderGraph()
-
const osgUtil::RenderGraph* getRenderGraph() const
-
void setRenderGraphLeft(osgUtil::RenderGraph* rg)
-
osgUtil::RenderGraph* getRenderGraphLeft()
-
const osgUtil::RenderGraph* getRenderGraphLeft() const
-
void setRenderGraphRight(osgUtil::RenderGraph* rg)
-
osgUtil::RenderGraph* getRenderGraphRight()
-
const osgUtil::RenderGraph* getRenderGraphRight() const
-
void setRenderStage(osgUtil::RenderStage* rs)
-
osgUtil::RenderStage* getRenderStage()
-
const osgUtil::RenderStage* getRenderStage() const
-
void setRenderStageLeft(osgUtil::RenderStage* rs)
-
osgUtil::RenderStage* getRenderStageLeft()
-
const osgUtil::RenderStage* getRenderStageLeft() const
-
void setRenderStageRight(osgUtil::RenderStage* rs)
-
osgUtil::RenderStage* getRenderStageRight()
-
const osgUtil::RenderStage* getRenderStageRight() const
-
void setCullMask(const osg::Node::NodeMask nm)
-
osg::Node::NodeMask getCullMask() const
-
void setCullMaskLeft(const osg::Node::NodeMask nm)
-
osg::Node::NodeMask getCullMaskLeft() const
-
void setCullMaskRight(const osg::Node::NodeMask nm)
-
osg::Node::NodeMask getCullMaskRight() const
-
void setLODScale(float bias)
- Set the LOD bias for the CullVisitor to use
-
float getLODScale() const
- Get the LOD bias
-
void setSmallFeatureCullingPixelSize(float value)
- Set the Small Feature Culling Pixel Size
-
float getSmallFeatureCullingPixelSize() const
- Get the Small Feature Culling Pixel Size
-
void setCullingMode(osg::CullStack::CullingMode mode)
- Set the culling mode for the CullVisitor to use
-
osg::CullStack::CullingMode getCullingMode() const
- Returns the current CullingMode
-
void setComputeNearFarMode(CullVisitor::ComputeNearFarMode cnfm)
- Set the ComputeNearFarMode for the CullVisitor to use
-
CullVisitor::ComputeNearFarMode getComputeNearFarMode() const
- Get the ComputeNearFarMode
-
void setFusionDistance(FusionDistanceMode mode, float value=1.0f)
- Set the FusionDistanceMode and Value.
-
FusionDistanceMode getFusionDistanceMode() const
- Get the FusionDistanceMode
-
float getFusionDistanceValue() const
- Get the FusionDistanceValue.
-
void setPrioritizeTextures(bool pt)
- set whether the draw method should call renderer->prioritizeTexture
-
bool getPrioritizeTextures() const
- get whether the draw method should call renderer->prioritizeTexture
-
bool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const
- Calculate, via glUnProject, the object coordinates of a window point.
-
bool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const
- Calculate, via glUnProject, the object coordinates of a window x,y when projected onto the near and far planes.
-
bool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const
- Calculate, via glProject, the object coordinates of a window.
-
inline void setFrameStamp(osg::FrameStamp* fs)
- Set the frame stamp for the current frame
-
inline const osg::FrameStamp* getFrameStamp() const
- Set the frame stamp for the current frame
-
virtual void init()
- Do init traversal of attached scene graph using Init NodeVisitor.
-
virtual void update()
- Do app traversal of attached scene graph using App NodeVisitor
-
virtual void app()
-
virtual void cull()
- Do cull traversal of attached scene graph using Cull NodeVisitor
-
virtual void draw()
- Do draw traversal of draw bins generated by cull traversal
Public Members
-
enum LightingMode
-
enum FusionDistanceMode
- FusionDistanceMode is used only when working in stereo
Protected Fields
-
osg::ref_ptr<osg::Node> _sceneData
-
osg::ref_ptr<osg::StateSet> _globalStateSet
-
osg::ref_ptr<osg::StateSet> _localStateSet
-
osg::ref_ptr<osg::Light> _light
-
osg::ref_ptr<osg::RefMatrix> _projectionMatrix
-
osg::ref_ptr<osg::RefMatrix> _viewMatrix
-
osg::ref_ptr<osg::DisplaySettings> _displaySettings
-
osg::ref_ptr<osg::State> _state
-
bool _initCalled
-
osg::ref_ptr<osg::NodeVisitor> _initVisitor
-
osg::ref_ptr<osg::NodeVisitor> _updateVisitor
-
osg::Node::NodeMask _cullMask
-
osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor
-
osg::ref_ptr<osgUtil::RenderGraph> _rendergraph
-
osg::ref_ptr<osgUtil::RenderStage> _renderStage
-
osg::Node::NodeMask _cullMaskLeft
-
osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorLeft
-
osg::ref_ptr<osgUtil::RenderGraph> _rendergraphLeft
-
osg::ref_ptr<osgUtil::RenderStage> _renderStageLeft
-
osg::Node::NodeMask _cullMaskRight
-
osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorRight
-
osg::ref_ptr<osgUtil::RenderGraph> _rendergraphRight
-
osg::ref_ptr<osgUtil::RenderStage> _renderStageRight
-
osg::ref_ptr<osg::FrameStamp> _frameStamp
-
osg::Vec4 _backgroundColor
-
CullVisitor::ComputeNearFarMode _computeNearFar
-
osg::CullStack::CullingMode _cullingMode
-
float _LODScale
-
float _smallFeatureCullingPixelSize
-
FusionDistanceMode _fusionDistanceMode
-
float _fusionDistanceValue
-
osg::ref_ptr<osg::Viewport> _viewport
-
LightingMode _lightingMode
-
bool _prioritizeTextures
Protected Methods
-
virtual ~SceneView()
-
virtual void cullStage(osg::RefMatrix* projection, osg::RefMatrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
- Do cull traversal of attached scene graph using Cull NodeVisitor
-
const osg::Matrix computeMVPW() const
-
void clearArea(int x, int y, int width, int height, const osg::Vec4& color)
Documentation
SceneView is literally a view of a scene, encapsulating the
camera (modelview+projection matrices), global state, lights and the scene itself. Provides
methods for setting up the view and rendering it.
- SceneView(osg::DisplaySettings* ds=NULL)
- Construct a default scene view
- void setDefaults()
- Set scene view to use default global state, light, camera
and render visitor
- void setSceneData(osg::Node* node)
- Set the data which to view. The data will typically be
an osg::Scene but can be any osg::Node type.
- osg::Node* getSceneData()
- Get the scene data which to view. The data will typically be
an osg::Scene but can be any osg::Node type.
- const osg::Node* getSceneData() const
- Get the const scene data which to view. The data will typically be
an osg::Scene but can be any osg::Node type.
- void setViewport(osg::Viewport* viewport)
- Set the viewport of the scene view to use specfied osg::Viewport.
- void setViewport(int x, int y, int width, int height)
- Set the viewport of the scene view to specified dimensions.
- const osg::Viewport* getViewport() const
- Get the const viewport.
- osg::Viewport* getViewport()
- Get the viewport.
- void getViewport(int& x, int& y, int& width, int& height)
- Get the viewport of the scene view.
- inline void setDisplaySettings(osg::DisplaySettings* vs)
- Set the DisplaySettings.
- inline const osg::DisplaySettings* getDisplaySettings() const
- Get the const DisplaySettings
- inline osg::DisplaySettings* getDisplaySettings()
- Get the DisplaySettings
- void setBackgroundColor(const osg::Vec4& color)
- Set the background color used in glClearColor().
Defaults to an off blue color.
- const osg::Vec4& getBackgroundColor() const
- Get the background color
- void setGlobalStateSet(osg::StateSet* state)
- osg::StateSet* getGlobalStateSet()
- const osg::StateSet* getGlobalStateSet() const
- void setLocalStateSet(osg::StateSet* state)
- osg::StateSet* getLocalStateSet()
- const osg::StateSet* getLocalStateSet() const
- enum LightingMode
- HEADLIGHT
- SKY_LIGHT
- NO_SCENEVIEW_LIGHT
- void setLightingMode(LightingMode mode)
- LightingMode getLightingMode() const
- void setLight(osg::Light* light)
- osg::Light* getLight()
- const osg::Light* getLight() const
- void setState(osg::State* state)
- osg::State* getState()
- const osg::State* getState() const
- void setProjectionMatrix(const osg::Matrix& matrix)
- Set the projection matrix. Can be thought of as setting the lens of a camera.
- void setProjectionMatrixAsOrtho(double left, double right, double bottom, double top, double zNear, double zFar)
- Set to a orthographic projection. See OpenGL glOrtho for documentation further details.
- void setProjectionMatrixAsOrtho2D(double left, double right, double bottom, double top)
- Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.
- void setProjectionMatrixAsFrustum(double left, double right, double bottom, double top, double zNear, double zFar)
- Set to a perspective projection. See OpenGL glFrustum documentation for further details.
- void setProjectionMatrixAsPerspective(double fovy, double aspectRatio, double zNear, double zFar)
- Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
Aspect ratio is defined as width/height.
- osg::Matrix& getProjectionMatrix()
- Get the projection matrix
- const osg::Matrix& getProjectionMatrix() const
- Get the const projection matrix
- void getProjectionMatrixAsOrtho(double& left, double& right, double& bottom, double& top, double& zNear, double& zFar)
- Get the othorgraphic settings of the orthographic projection matrix.
Note, if matrix is not an orthographic matrix then invalid values will be returned.
- void getProjectionMatrixAsFrustum(double& left, double& right, double& bottom, double& top, double& zNear, double& zFar)
- Get the frustum setting of a perspective projection matrix.
Note, if matrix is not an perspective matrix then invalid values will be returned.
- void setViewMatrix(const osg::Matrix& matrix)
- Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates.
- void setViewMatrixAsLookAt(const osg::Vec3& eye, const osg::Vec3& center, const osg::Vec3& up)
- Set to the position and orientation of view matrix, using the same convention as gluLookAt.
- osg::Matrix& getViewMatrix()
- Get the view matrix.
- const osg::Matrix& getViewMatrix() const
- Get the const view matrix.
- void getViewMatrixAsLookAt(osg::Vec3& eye, osg::Vec3& center, osg::Vec3& up, float lookDistance=1.0f)
- Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt.
- void setInitVisitor(osg::NodeVisitor* av)
- osg::NodeVisitor* getInitVisitor()
- const osg::NodeVisitor* getInitVisitor() const
- void setUpdateVisitor(osg::NodeVisitor* av)
- osg::NodeVisitor* getUpdateVisitor()
- const osg::NodeVisitor* getUpdateVisitor() const
- void setCullVisitor(osgUtil::CullVisitor* cv)
- osgUtil::CullVisitor* getCullVisitor()
- const osgUtil::CullVisitor* getCullVisitor() const
- void setCullVisitorLeft(osgUtil::CullVisitor* cv)
- osgUtil::CullVisitor* getCullVisitorLeft()
- const osgUtil::CullVisitor* getCullVisitorLeft() const
- void setCullVisitorRight(osgUtil::CullVisitor* cv)
- osgUtil::CullVisitor* getCullVisitorRight()
- const osgUtil::CullVisitor* getCullVisitorRight() const
- void setRenderGraph(osgUtil::RenderGraph* rg)
- osgUtil::RenderGraph* getRenderGraph()
- const osgUtil::RenderGraph* getRenderGraph() const
- void setRenderGraphLeft(osgUtil::RenderGraph* rg)
- osgUtil::RenderGraph* getRenderGraphLeft()
- const osgUtil::RenderGraph* getRenderGraphLeft() const
- void setRenderGraphRight(osgUtil::RenderGraph* rg)
- osgUtil::RenderGraph* getRenderGraphRight()
- const osgUtil::RenderGraph* getRenderGraphRight() const
- void setRenderStage(osgUtil::RenderStage* rs)
- osgUtil::RenderStage* getRenderStage()
- const osgUtil::RenderStage* getRenderStage() const
- void setRenderStageLeft(osgUtil::RenderStage* rs)
- osgUtil::RenderStage* getRenderStageLeft()
- const osgUtil::RenderStage* getRenderStageLeft() const
- void setRenderStageRight(osgUtil::RenderStage* rs)
- osgUtil::RenderStage* getRenderStageRight()
- const osgUtil::RenderStage* getRenderStageRight() const
- void setCullMask(const osg::Node::NodeMask nm)
- osg::Node::NodeMask getCullMask() const
- void setCullMaskLeft(const osg::Node::NodeMask nm)
- osg::Node::NodeMask getCullMaskLeft() const
- void setCullMaskRight(const osg::Node::NodeMask nm)
- osg::Node::NodeMask getCullMaskRight() const
- void setLODScale(float bias)
- Set the LOD bias for the CullVisitor to use
- float getLODScale() const
- Get the LOD bias
- void setSmallFeatureCullingPixelSize(float value)
- Set the Small Feature Culling Pixel Size
- float getSmallFeatureCullingPixelSize() const
- Get the Small Feature Culling Pixel Size
- void setCullingMode(osg::CullStack::CullingMode mode)
- Set the culling mode for the CullVisitor to use
- osg::CullStack::CullingMode getCullingMode() const
- Returns the current CullingMode
- void setComputeNearFarMode(CullVisitor::ComputeNearFarMode cnfm)
- Set the ComputeNearFarMode for the CullVisitor to use
- CullVisitor::ComputeNearFarMode getComputeNearFarMode() const
- Get the ComputeNearFarMode
- enum FusionDistanceMode
- FusionDistanceMode is used only when working in stereo
- USE_FUSION_DISTANCE_VALUE
- Use fusion distance from the value set on the SceneView
- PROPORTIONAL_TO_SCREEN_DISTANCE
- Compute the fusion distance by multiplying the screen distance by the fusion distance value
- void setFusionDistance(FusionDistanceMode mode, float value=1.0f)
- Set the FusionDistanceMode and Value. Note, is used only when working in stereo.
- FusionDistanceMode getFusionDistanceMode() const
- Get the FusionDistanceMode
- float getFusionDistanceValue() const
- Get the FusionDistanceValue. Note, only used for USE_FUSION_DISTANCE_VALUE & PROPORTIONAL_TO_SCREEN_DISTANCE modes.
- void setPrioritizeTextures(bool pt)
- set whether the draw method should call renderer->prioritizeTexture
- bool getPrioritizeTextures() const
- get whether the draw method should call renderer->prioritizeTexture
- bool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const
- Calculate, via glUnProject, the object coordinates of a window point.
Note, current implementation requires that SceneView::draw() has been previously called
for projectWindowIntoObject to produce valid values. Consistent with OpenGL
windows coordinates are calculated relative to the bottom left of the window.
Returns true on successful projection.
- bool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const
- Calculate, via glUnProject, the object coordinates of a window x,y
when projected onto the near and far planes.
Note, current implementation requires that SceneView::draw() has been previously called
for projectWindowIntoObject to produce valid values. Consistent with OpenGL
windows coordinates are calculated relative to the bottom left of the window.
Returns true on successful projection.
- bool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const
- Calculate, via glProject, the object coordinates of a window.
Note, current implementation requires that SceneView::draw() has been previously called
for projectWindowIntoObject to produce valid values. Consistent with OpenGL
windows coordinates are calculated relative to the bottom left of the window,
whereas as window API's normally have the top left as the origin,
so you may need to pass in (mouseX,window_height-mouseY,...).
Returns true on successful projection.
- inline void setFrameStamp(osg::FrameStamp* fs)
- Set the frame stamp for the current frame
- inline const osg::FrameStamp* getFrameStamp() const
- Set the frame stamp for the current frame
- virtual void init()
- Do init traversal of attached scene graph using Init NodeVisitor.
The init traversal is called once for each SceneView, and should
be used to compile display list, texture objects intialize data
not otherwise intializaed during scene graph loading. Note, is
called automatically by update&cull if it hasn't already been called
elsewhere. Also init() should only ever be called within a valid
graphics context.
- virtual void update()
- Do app traversal of attached scene graph using App NodeVisitor
- virtual void app()
- virtual void cull()
- Do cull traversal of attached scene graph using Cull NodeVisitor
- virtual void draw()
- Do draw traversal of draw bins generated by cull traversal
- virtual ~SceneView()
- virtual void cullStage(osg::RefMatrix* projection, osg::RefMatrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
- Do cull traversal of attached scene graph using Cull NodeVisitor
- const osg::Matrix computeMVPW() const
- void clearArea(int x, int y, int width, int height, const osg::Vec4& color)
- osg::ref_ptr<osg::Node> _sceneData
- osg::ref_ptr<osg::StateSet> _globalStateSet
- osg::ref_ptr<osg::StateSet> _localStateSet
- osg::ref_ptr<osg::Light> _light
- osg::ref_ptr<osg::RefMatrix> _projectionMatrix
- osg::ref_ptr<osg::RefMatrix> _viewMatrix
- osg::ref_ptr<osg::DisplaySettings> _displaySettings
- osg::ref_ptr<osg::State> _state
- bool _initCalled
- osg::ref_ptr<osg::NodeVisitor> _initVisitor
- osg::ref_ptr<osg::NodeVisitor> _updateVisitor
- osg::Node::NodeMask _cullMask
- osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor
- osg::ref_ptr<osgUtil::RenderGraph> _rendergraph
- osg::ref_ptr<osgUtil::RenderStage> _renderStage
- osg::Node::NodeMask _cullMaskLeft
- osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorLeft
- osg::ref_ptr<osgUtil::RenderGraph> _rendergraphLeft
- osg::ref_ptr<osgUtil::RenderStage> _renderStageLeft
- osg::Node::NodeMask _cullMaskRight
- osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorRight
- osg::ref_ptr<osgUtil::RenderGraph> _rendergraphRight
- osg::ref_ptr<osgUtil::RenderStage> _renderStageRight
- osg::ref_ptr<osg::FrameStamp> _frameStamp
- osg::Vec4 _backgroundColor
- CullVisitor::ComputeNearFarMode _computeNearFar
- osg::CullStack::CullingMode _cullingMode
- float _LODScale
- float _smallFeatureCullingPixelSize
- FusionDistanceMode _fusionDistanceMode
- float _fusionDistanceValue
- osg::ref_ptr<osg::Viewport> _viewport
- LightingMode _lightingMode
- bool _prioritizeTextures
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.