SceneView is literally a view of a scene, encapsulating the camera, 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 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 setCamera(osg::Camera* camera)
- set an osg::Camera for the scene view to use for setting projection and modelview matrices internaly.
-
osg::Camera* getCamera()
-
const osg::Camera* getCamera() const
-
void setProjectionMatrix(osg::Matrix* matrix)
- set a projection matrix.
-
osg::Matrix* getProjectionMatrix()
-
const osg::Matrix* getProjectionMatrix() const
-
void setModelViewMatrix(osg::Matrix* matrix)
- set a modelview matrix.
-
osg::Matrix* getModelViewMatrix()
-
const osg::Matrix* getModelViewMatrix() const
-
void setInitVisitor(osg::NodeVisitor* av)
-
osg::NodeVisitor* getInitVisitor()
-
const osg::NodeVisitor* getInitVisitor() const
-
void setAppVisitor(osg::NodeVisitor* av)
-
osg::NodeVisitor* getAppVisitor()
-
const osg::NodeVisitor* getAppVisitor() const
-
void setCullVisitor(osgUtil::CullVisitor* cv)
-
osgUtil::CullVisitor* getCullVisitor()
-
const osgUtil::CullVisitor* getCullVisitor() const
-
void setRenderGraph(osgUtil::RenderGraph* rg)
-
osgUtil::RenderGraph* getRenderGraph()
-
const osgUtil::RenderGraph* getRenderGraph() const
-
void setRenderStage(osgUtil::RenderStage* rs)
-
osgUtil::RenderStage* getRenderStage()
-
const osgUtil::RenderStage* getRenderStage() const
-
void setLODBias(float bias)
-
float getLODBias() const
-
void setCullMask(const osg::Node::NodeMask nm)
-
const osg::Node::NodeMask getCullMask() const
-
void setCullMaskLeft(const osg::Node::NodeMask nm)
-
const osg::Node::NodeMask getCullMaskLeft() const
-
void setCullMaskRight(const osg::Node::NodeMask nm)
-
const osg::Node::NodeMask getCullMaskRight() const
-
void setCalcNearFar(bool calc)
- Set to true if you want SceneView to automatically calculate values for the near/far clipping planes, each frame, set false to use camera's internal near and far planes.
-
bool getCalcNearFar() const
- return true if SceneView automatically calculates near and far clipping planes for each frame
-
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 app()
- Do app traversal of attached scene graph using App NodeVisitor
-
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
Protected Fields
-
osg::ref_ptr<osg::Node> _sceneData
-
osg::ref_ptr<osg::StateSet> _globalState
-
osg::ref_ptr<osg::Light> _light
-
osg::ref_ptr<osg::Camera> _camera
-
osg::ref_ptr<osg::Matrix> _projectionMatrix
-
osg::ref_ptr<osg::Matrix> _modelviewMatrix
-
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> _appVisitor
-
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
-
bool _need_compile
-
bool _calc_nearfar
-
osg::Vec4 _backgroundColor
-
double _near_plane
-
double _far_plane
-
float _lodBias
-
osg::ref_ptr<osg::Viewport> _viewport
-
LightingMode _lightingMode
-
bool _prioritizeTextures
Protected Methods
-
virtual ~SceneView()
-
virtual void cullStage(osg::Matrix* projection, osg::Matrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
- Do cull traversal of attached scene graph using Cull NodeVisitor
-
virtual void drawStage(osgUtil::RenderStage* renderStage)
-
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, 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
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 setCamera(osg::Camera* camera)
- set an osg::Camera for the scene view to use for setting projection and modelview matrices internaly.
However, the projection matrix from the camera will be overriden by a projection matrix which is set explicitly
via setProjectionMatrix(..), see below.
Also, the model matrix from the camera will be overriden by a modelview matrix which is set explicitly
via setModelViewMatrix(..), see below.
osg::Camera* getCamera()
const osg::Camera* getCamera() const
void setProjectionMatrix(osg::Matrix* matrix)
- set a projection matrix. Note, this will override a camera's projection matrix if it is not NULL.
osg::Matrix* getProjectionMatrix()
const osg::Matrix* getProjectionMatrix() const
void setModelViewMatrix(osg::Matrix* matrix)
- set a modelview matrix. Note, this will override a camera's modelview matrix if it is not NULL.
osg::Matrix* getModelViewMatrix()
const osg::Matrix* getModelViewMatrix() const
void setInitVisitor(osg::NodeVisitor* av)
osg::NodeVisitor* getInitVisitor()
const osg::NodeVisitor* getInitVisitor() const
void setAppVisitor(osg::NodeVisitor* av)
osg::NodeVisitor* getAppVisitor()
const osg::NodeVisitor* getAppVisitor() const
void setCullVisitor(osgUtil::CullVisitor* cv)
osgUtil::CullVisitor* getCullVisitor()
const osgUtil::CullVisitor* getCullVisitor() const
void setRenderGraph(osgUtil::RenderGraph* rg)
osgUtil::RenderGraph* getRenderGraph()
const osgUtil::RenderGraph* getRenderGraph() const
void setRenderStage(osgUtil::RenderStage* rs)
osgUtil::RenderStage* getRenderStage()
const osgUtil::RenderStage* getRenderStage() const
void setLODBias(float bias)
float getLODBias() const
void setCullMask(const osg::Node::NodeMask nm)
const osg::Node::NodeMask getCullMask() const
void setCullMaskLeft(const osg::Node::NodeMask nm)
const osg::Node::NodeMask getCullMaskLeft() const
void setCullMaskRight(const osg::Node::NodeMask nm)
const osg::Node::NodeMask getCullMaskRight() const
void setCalcNearFar(bool calc)
- Set to true if you want SceneView to automatically calculate values
for the near/far clipping planes, each frame, set false to use camera's
internal near and far planes. Default value is true.
bool getCalcNearFar() const
- return true if SceneView automatically calculates near and
far clipping planes for each frame
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 app&cull if it hasn't already been called
elsewhere. Also init() should only ever be called within a valid
graphics context.
virtual void app()
- Do app traversal of attached scene graph using App NodeVisitor
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::Matrix* projection, osg::Matrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
- Do cull traversal of attached scene graph using Cull NodeVisitor
virtual void drawStage(osgUtil::RenderStage* renderStage)
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> _globalState
osg::ref_ptr<osg::Light> _light
osg::ref_ptr<osg::Camera> _camera
osg::ref_ptr<osg::Matrix> _projectionMatrix
osg::ref_ptr<osg::Matrix> _modelviewMatrix
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> _appVisitor
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
bool _need_compile
bool _calc_nearfar
osg::Vec4 _backgroundColor
double _near_plane
double _far_plane
float _lodBias
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++.