class OSGUTIL_EXPORT osgUtil::SceneView: public osg::Referenced

SceneView is literaly a view of a scene, encapsulating the camera, global state, lights and the scene itself.

Inheritance:


Public Classes

[more]enum LightingMode

Public Methods

[more] SceneView()
Constrcut a default scene view
[more]void setSceneData(osg::Node* node)
Set the data which to view.
[more]osg::Node* getSceneData()
Get the scene data which to view.
[more]void setViewport(int x, int y, int width, int height)
Set the viewport of the scene view.
[more]void getViewport(int& x, int& y, int& width, int& height)
Get the viewport of the scene view.
[more]void setDefaults()
Set scene view to use default global state, light, camera and render visitor
[more]void setBackgroundColor(const osg::Vec4& color)
Set the background color used in glClearColor().
[more]const osg::Vec4& getBackgroundColor() const
Get the background color
[more]void setGlobalState(osg::GeoState* state)
[more]osg::GeoState* getGlobalState() const
[more]void setLightingMode(LightingMode mode)
[more]LightingMode getLightingMode() const
[more]void setLight(osg::Light* light)
[more]osg::Light* getLight() const
[more]void setCamera(osg::Camera* camera)
[more]osg::Camera* getCamera() const
[more]void setRenderVisitor(osgUtil::RenderVisitor* rv)
[more]osgUtil::RenderVisitor* getRenderVisitor() const
[more]void setLODBias(float bias)
[more]float getLODBias() const
[more]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.
[more]bool getCalcNearFar()
return true if SceneView automatically caclculates near and far clipping planes for each frame
[more]bool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const
Calculate, via glUnProject, the object coordinates of a window point.
[more]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.
[more]bool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const
Calculate, via glProject, the object coordinates of a window.
[more]virtual void cull()
[more]virtual void draw()

Protected Fields

[more]osg::ref_ptr<osg::Node> _sceneData
[more]osg::ref_ptr<osg::GeoState> _globalState
[more]osg::ref_ptr<osg::Light> _light
[more]osg::ref_ptr<osg::Camera> _camera
[more]osg::ref_ptr<osgUtil::RenderVisitor> _renderVisitor
[more]bool _need_compile
[more]bool _calc_nearfar
[more]osg::Vec4 _backgroundColor
[more]double _near_plane
[more]double _far_plane
[more]float _lodBias
[more]GLint _view[4]
[more]GLdouble _model[16]
[more]GLdouble _proj[16]
[more]LightingMode _lightingMode

Protected Methods

[more]virtual ~SceneView()


Documentation

SceneView is literaly 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.
o SceneView()
Constrcut a default scene view

ovoid 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.

oosg::Node* getSceneData()
Get the scene data which to view. The data will typically be an osg::Scene but can be any osg::Node type.

ovoid setViewport(int x, int y, int width, int height)
Set the viewport of the scene view.

ovoid getViewport(int& x, int& y, int& width, int& height)
Get the viewport of the scene view.

ovoid setDefaults()
Set scene view to use default global state, light, camera and render visitor

ovoid setBackgroundColor(const osg::Vec4& color)
Set the background color used in glClearColor(). Defaults to an off blue color.

oconst osg::Vec4& getBackgroundColor() const
Get the background color

ovoid setGlobalState(osg::GeoState* state)

oosg::GeoState* getGlobalState() const

oenum LightingMode

o HEADLIGHT

o SKY_LIGHT

o NO_SCENEVIEW_LIGHT

ovoid setLightingMode(LightingMode mode)

oLightingMode getLightingMode() const

ovoid setLight(osg::Light* light)

oosg::Light* getLight() const

ovoid setCamera(osg::Camera* camera)

oosg::Camera* getCamera() const

ovoid setRenderVisitor(osgUtil::RenderVisitor* rv)

oosgUtil::RenderVisitor* getRenderVisitor() const

ovoid setLODBias(float bias)

ofloat getLODBias() const

ovoid 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.

obool getCalcNearFar()
return true if SceneView automatically caclculates near and far clipping planes for each frame

obool 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.

obool 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.

obool 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.

ovirtual void cull()

ovirtual void draw()

ovirtual ~SceneView()

oosg::ref_ptr<osg::Node> _sceneData

oosg::ref_ptr<osg::GeoState> _globalState

oosg::ref_ptr<osg::Light> _light

oosg::ref_ptr<osg::Camera> _camera

oosg::ref_ptr<osgUtil::RenderVisitor> _renderVisitor

obool _need_compile

obool _calc_nearfar

oosg::Vec4 _backgroundColor

odouble _near_plane

odouble _far_plane

ofloat _lodBias

oGLint _view[4]

oGLdouble _model[16]

oGLdouble _proj[16]

oLightingMode _lightingMode


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.