OpenWalnut
1.5.0dev
|
This callback is useful to update viewport information on several nodes supporting it. More...
#include <WGEViewportCallback.h>
Public Member Functions | |
WGEViewportCallback (osg::ref_ptr< Source > reference) | |
Creates new instance of viewport callback and sets the viewport size to the reference camera size. More... | |
WGEViewportCallback (size_t width, size_t height) | |
Creates new instance of viewport callback and sets the viewport size to the specified size. More... | |
virtual | ~WGEViewportCallback () |
Destructor. More... | |
virtual void | operator() (osg::Node *node, osg::NodeVisitor *nv) |
This operator gets called by OSG every update cycle. More... | |
Private Attributes | |
osg::ref_ptr< Source > | m_reference |
The reference camera to use. More... | |
size_t | m_width |
Forced viewport width. More... | |
size_t | m_height |
Forced viewport height. More... | |
This callback is useful to update viewport information on several nodes supporting it.
The specified type must support an setViewport method. This is especially useful to keep offscreen render cameras in sync with the scene cam or to update HUD viewport information. Note that the order of execution of callbacks for a node can cause problems as the new viewport might get set after it is needed.
T | the type supporting setViewport |
Source | the type from who the viewport should be acquired by using osg::Viewport* getViewport() |
Definition at line 42 of file WGEViewportCallback.h.
|
explicit |
Creates new instance of viewport callback and sets the viewport size to the reference camera size.
reference | set the viewport to the one of the reference camera. |
Definition at line 92 of file WGEViewportCallback.h.
WGEViewportCallback< T, Source >::WGEViewportCallback | ( | size_t | width, |
size_t | height | ||
) |
Creates new instance of viewport callback and sets the viewport size to the specified size.
width | viewport width |
height | viewport height |
Definition at line 102 of file WGEViewportCallback.h.
|
virtual |
Destructor.
Definition at line 112 of file WGEViewportCallback.h.
|
virtual |
This operator gets called by OSG every update cycle.
It applies the viewport.
node | the osg node |
nv | the node visitor |
Definition at line 118 of file WGEViewportCallback.h.
|
private |
Forced viewport height.
Definition at line 88 of file WGEViewportCallback.h.
|
private |
The reference camera to use.
Definition at line 78 of file WGEViewportCallback.h.
|
private |
Forced viewport width.
Definition at line 83 of file WGEViewportCallback.h.