Inheritance diagram for osg::Viewport:
Public Member Functions | |
Viewport () | |
Viewport (int x, int y, int width, int height) | |
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 (int x, int y, int width, int height) |
void | getViewport (int &x, int &y, int &width, int &height) const |
int & | x () |
int | x () const |
int & | y () |
int | y () const |
int & | width () |
int | width () const |
int & | height () |
int | height () const |
bool | valid () const |
float | aspectRatio () const |
Return the aspectRatio 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 Member Functions | |
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 aspectRatio of the viewport, which is equal to width/height. If height is zero, the potental division by zero is avoided 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 convert local coordinates into window coordinates use v_window = v_local * MVPW matrix, where the MVPW matrix is ModelViewMatrix * ProjectionMatrix * WindowMatrix, the latter supplied by Viewport::computeWindowMatrix(), the ModelView and Projection Matrix can either be sourced from the current osg::State object, via osgUtil::SceneView or CullVisitor. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|