Inheritance diagram for osg::Viewport:
Public Methods | |
Viewport () | |
Viewport (const Viewport &vp, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_StateAttribute (osg, Viewport, VIEWPORT) | |
virtual int | compare (const StateAttribute &sa) const |
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. | |
void | setViewport (const int x, const int y, const int width, const int height) |
void | getViewport (int &x, int &y, int &width, int &height) const |
const int | x () const |
const int | y () const |
const int | width () const |
const int | height () const |
const bool | valid () const |
const float | aspectRatio () const |
Return the aspcetRatio of the viewport, which is equal to width/height. | |
const osg::Matrix | computeWindowMatrix () const |
Compute the Window Matrix which takes projected coords into Window coordinates. | |
virtual void | apply (State &state) const |
apply the OpenGL state attributes. | |
Protected Methods | |
virtual | ~Viewport () |
Protected Attributes | |
int | _x |
int | _y |
int | _width |
int | _height |
|
|
|
Copy constructor using CopyOp to manage deep vs shallow copy.
|
|
|
|
apply the OpenGL state attributes. The global state for the current OpenGL context is passed in to allow the StateAttribute to obtain details on the the current context and state. Implements osg::StateAttribute. |
|
Return the aspcetRatio of the viewport, which is equal to width/height. If height is zero, the potental division by zero is avoid by simply returning 1.0f. |
|
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Implements osg::StateAttribute. |
|
Compute the Window Matrix which takes projected coords into Window coordinates. To converted local coodinates into window coordinates use v_window = v_local * MVPW matrix, where the MVPW matrix is ModelViewMatrix * ProjectionMatrix * WindowMatrix, the later supplied by viewport::computeWindowMatrix(), the ModelView and Projection Matrix can either be sourced from the current osg::State object, via osgUtil::SceneView or CullVisitor. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|