|
Public Types |
typedef Options | LightingMode |
enum | Options {
NO_SCENEVIEW_LIGHT = 0x0,
HEADLIGHT = 0x1,
SKY_LIGHT = 0x2,
COMPILE_GLOBJECTS_AT_INIT = 0x4,
STANDARD_SETTINGS
} |
enum | ActiveUniforms {
FRAME_NUMBER_UNIFORM = 0x1,
FRAME_TIME_UNIFORM = 0x2,
DELTA_FRAME_TIME_UNIFORM = 0x4,
VIEW_MATRIX_UNIFORM = 0x8,
VIEW_MATRIX_INVERSE_UNIFORM = 0x10,
DEFAULT_UNIFORMS,
ALL_UNIFORMS = 0xFFFFFFFF
} |
enum | FusionDistanceMode { USE_FUSION_DISTANCE_VALUE,
PROPORTIONAL_TO_SCREEN_DISTANCE
} |
| FusionDistanceMode is used only when working in stereo. More...
|
Public Member Functions |
| SceneView (osg::DisplaySettings *ds=NULL) |
| Construct a default scene view.
|
void | setDefaults (unsigned int options=STANDARD_SETTINGS) |
| Set scene view to use default global state, light, camera and render visitor.
|
void | setCamera (osg::CameraNode *camera) |
| Set the camera used to represent the camera view of this SceneView.
|
osg::CameraNode * | getCamera () |
| Get the camera used to represent the camera view of this SceneView.
|
const osg::CameraNode * | getCamera () const |
| Get the const camera used to represent the camera view of this SceneView.
|
void | setSceneData (osg::Node *node) |
| Set the data to view.
|
osg::Node * | getSceneData (unsigned int childNo=0) |
| Get the scene data to view.
|
const osg::Node * | getSceneData (unsigned int childNo=0) const |
| Get the const scene data which to view.
|
unsigned int | getNumSceneData () const |
| Get the number of scene data subgraphs added to the SceneView's camera.
|
void | setViewport (osg::Viewport *viewport) |
| Set the viewport of the scene view to use specified osg::Viewport.
|
void | setViewport (int x, int y, int width, int height) |
| Set the viewport of the scene view to specified dimensions.
|
osg::Viewport * | getViewport () |
| Get the viewport.
|
const osg::Viewport * | getViewport () const |
| Get the const viewport.
|
void | getViewport (int &x, int &y, int &width, int &height) const |
| Get the viewport of the scene view.
|
void | setDisplaySettings (osg::DisplaySettings *vs) |
| Set the DisplaySettings.
|
const osg::DisplaySettings * | getDisplaySettings () const |
| Get the const DisplaySettings.
|
osg::DisplaySettings * | getDisplaySettings () |
| Get the DisplaySettings.
|
void | setClearColor (const osg::Vec4 &color) |
| Set the color used in glClearColor().
|
const osg::Vec4 & | getClearColor () const |
| Get the color used in glClearColor.
|
void | setRedrawInterlacedStereoStencilMask (bool flag) |
| Mannually set the redraw interlaced stereo stencil mask request flag to control whether to redraw the stencil buffer on the next frame.
|
bool | getRedrawInterlacedStereoStencilMask () const |
| Get the redraw interlaced stereo stencil mask request flag.
|
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 | setActiveUniforms (int activeUniforms) |
| Set the uniforms that SceneView should set set up on each frame.
|
int | getActiveUniforms () const |
| Get the uniforms that SceneView should set set up on each frame.
|
void | updateUniforms () |
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::Matrixf &matrix) |
| Set the projection matrix.
|
void | setProjectionMatrix (const osg::Matrixd &matrix) |
| Set the projection matrix.
|
void | setProjectionMatrixAsOrtho (double left, double right, double bottom, double top, double zNear, double zFar) |
| Set to an 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::Matrixd & | getProjectionMatrix () |
| Get the projection matrix.
|
const osg::Matrixd & | getProjectionMatrix () const |
| Get the const projection matrix.
|
bool | getProjectionMatrixAsOrtho (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const |
| Get the othographic settings of the orthographic projection matrix.
|
bool | getProjectionMatrixAsFrustum (double &left, double &right, double &bottom, double &top, double &zNear, double &zFar) const |
| Get the frustum setting of a perspective projection matrix.
|
bool | getProjectionMatrixAsPerspective (double &fovy, double &aspectRatio, double &zNear, double &zFar) const |
| Get the frustum setting of a symmetric perspective projection matrix.
|
void | setViewMatrix (const osg::Matrixf &matrix) |
| Set the view matrix.
|
void | setViewMatrix (const osg::Matrixd &matrix) |
| Set the view matrix.
|
void | setViewMatrixAsLookAt (const osg::Vec3 &eye, const osg::Vec3 ¢er, const osg::Vec3 &up) |
| Set to the position and orientation of view matrix, using the same convention as gluLookAt.
|
osg::Matrixd & | getViewMatrix () |
| Get the view matrix.
|
const osg::Matrixd & | getViewMatrix () const |
| Get the const view matrix.
|
void | getViewMatrixAsLookAt (osg::Vec3 &eye, osg::Vec3 ¢er, osg::Vec3 &up, float lookDistance=1.0f) const |
| 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 | setCollectOccludersVisitor (osg::CollectOccludersVisitor *cov) |
osg::CollectOccludersVisitor * | getCollectOccludersVisitor () |
const osg::CollectOccludersVisitor * | getCollectOccludersVisitor () const |
void | setStateGraph (osgUtil::StateGraph *rg) |
osgUtil::StateGraph * | getStateGraph () |
const osgUtil::StateGraph * | getStateGraph () const |
void | setStateGraphLeft (osgUtil::StateGraph *rg) |
osgUtil::StateGraph * | getStateGraphLeft () |
const osgUtil::StateGraph * | getStateGraphLeft () const |
void | setStateGraphRight (osgUtil::StateGraph *rg) |
osgUtil::StateGraph * | getStateGraphRight () |
const osgUtil::StateGraph * | getStateGraphRight () 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 | setDrawBufferValue (GLenum drawBufferValue) |
| Set the draw buffer value used at the start of each frame draw.
|
GLenum | getDrawBufferValue () const |
| Get the draw buffer value used at the start of each frame draw.
|
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.
|
void | setComputeStereoMatricesCallback (ComputeStereoMatricesCallback *callback) |
ComputeStereoMatricesCallback * | getComputeStereoMatricesCallback () |
const ComputeStereoMatricesCallback * | getComputeStereoMatricesCallback () const |
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.
|
void | setFrameStamp (osg::FrameStamp *fs) |
| Set the frame stamp for the current frame.
|
const osg::FrameStamp * | getFrameStamp () const |
| Get the frame stamp for the current frame.
|
osg::Matrixd | computeLeftEyeProjection (const osg::Matrixd &projection) const |
osg::Matrixd | computeLeftEyeView (const osg::Matrixd &view) const |
osg::Matrixd | computeRightEyeProjection (const osg::Matrixd &projection) const |
osg::Matrixd | computeRightEyeView (const osg::Matrixd &view) const |
virtual osg::Matrixd | computeLeftEyeProjectionImplementation (const osg::Matrixd &projection) const |
virtual osg::Matrixd | computeLeftEyeViewImplementation (const osg::Matrixd &view) const |
virtual osg::Matrixd | computeRightEyeProjectionImplementation (const osg::Matrixd &projection) const |
virtual osg::Matrixd | computeRightEyeViewImplementation (const osg::Matrixd &view) const |
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 | 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 void | releaseAllGLObjects () |
| Release all OpenGL objects from the scene graph, such as texture objects, display lists etc.
|
virtual void | flushAllDeletedGLObjects () |
| Flush all deleted OpenGL objects, such as texture objects, display lists etc.
|
virtual void | flushDeletedGLObjects (double &availableTime) |
| Flush deleted OpenGL objects, such as texture objects, display lists etc within specified available time.
|
bool | getStats (Statistics *primStats) |
| Extract stats for current draw list.
|
Protected Member Functions |
virtual | ~SceneView () |
virtual void | cullStage (const osg::Matrixd &projection, const osg::Matrixd &modelview, osgUtil::CullVisitor *cullVisitor, osgUtil::StateGraph *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) |
Protected Attributes |
osg::ref_ptr< osg::StateSet > | _localStateSet |
osg::ref_ptr< osg::State > | _state |
bool | _initCalled |
osg::ref_ptr< osg::NodeVisitor > | _initVisitor |
osg::ref_ptr< osg::NodeVisitor > | _updateVisitor |
osg::ref_ptr< osgUtil::CullVisitor > | _cullVisitor |
osg::ref_ptr< osgUtil::StateGraph > | _rendergraph |
osg::ref_ptr< osgUtil::RenderStage > | _renderStage |
osg::ref_ptr< ComputeStereoMatricesCallback > | _computeStereoMatricesCallback |
osg::ref_ptr< osgUtil::CullVisitor > | _cullVisitorLeft |
osg::ref_ptr< osgUtil::StateGraph > | _rendergraphLeft |
osg::ref_ptr< osgUtil::RenderStage > | _renderStageLeft |
osg::ref_ptr< osgUtil::CullVisitor > | _cullVisitorRight |
osg::ref_ptr< osgUtil::StateGraph > | _rendergraphRight |
osg::ref_ptr< osgUtil::RenderStage > | _renderStageRight |
osg::ref_ptr< osg::CollectOccludersVisitor > | _collectOccludersVisistor |
osg::ref_ptr< osg::FrameStamp > | _frameStamp |
osg::ref_ptr< osg::CameraNode > | _camera |
osg::ref_ptr< osg::StateSet > | _globalStateSet |
osg::ref_ptr< osg::Light > | _light |
osg::ref_ptr< osg::DisplaySettings > | _displaySettings |
FusionDistanceMode | _fusionDistanceMode |
float | _fusionDistanceValue |
LightingMode | _lightingMode |
bool | _prioritizeTextures |
GLenum | _drawBufferValue |
bool | _requiresFlush |
int | _activeUniforms |
double | _previousFrameTime |
bool | _redrawInterlacedStereoStencilMask |
int | _interlacedStereoStencilWidth |
int | _interlacedStereoStencilHeight |
Provides methods for setting up the view and rendering it.