|
OpenFrames
|
Encapsulates variables needed for a view. More...
#include <View.hpp>
Public Types | |
| enum | ProjectionType { ORTHOGRAPHIC =0, PERSPECTIVE } |
| enum | ViewFrameType { ABSOLUTE_FRAME =0, RELATIVE_FRAME } |
| enum | ViewRotationType { DIRECT =0, AZEL } |
Public Member Functions | |
| View (ReferenceFrame *root, ReferenceFrame *viewFrame, ViewFrameType baseframe=RELATIVE_FRAME) | |
| View (ReferenceFrame *root, ReferenceFrame *viewFrame, ReferenceFrame *lookatFrame, ViewFrameType frameType=RELATIVE_FRAME, ViewRotationType rotationType=AZEL) | |
| ProjectionType | getProjectionType () |
| void | setPerspective (const double fovy, const double ratio) |
| void | getPerspective (double &fovy, double &ratio) const |
| void | setOrthographic (const double left, const double right, const double bottom, const double top) |
| void | getOrthographic (double &left, double &right, double &bottom, double &top) const |
| osg::Matrixd | getProjectionMatrix () |
| osg::Matrixd | getViewMatrix () |
| void | setDefaultViewDistance (double distance) |
| double | getDefaultViewDistance () const |
| FollowingTrackball * | getTrackball () const |
| void | setTrackball (FollowingTrackball *trackball) |
| void | resetView () |
| void | saveView () |
| void | restoreView () |
| void | setViewFrame (ReferenceFrame *root, ReferenceFrame *viewFrame, ViewFrameType frameType=RELATIVE_FRAME) |
| void | setViewBetweenFrames (ReferenceFrame *root, ReferenceFrame *viewFrame, ReferenceFrame *lookatFrame, ViewFrameType frameType=RELATIVE_FRAME, ViewRotationType rotationType=AZEL) |
| ReferenceFrame * | getViewRoot () |
| ReferenceFrame * | getViewFrame () |
| ReferenceFrame * | getLookAtFrame () |
| ViewFrameType | getViewFrameType () |
| ViewRotationType | getViewRotationType () |
| bool | isValid () |
Protected Member Functions | |
| void | _init () |
Protected Attributes | |
| osg::ref_ptr< TransformAccumulator > | _xform |
| ViewFrameType | _frameType |
| osg::ref_ptr< TransformAccumulator > | _xform_lookat |
| ViewRotationType | _rotationType |
| ProjectionType | _projType |
| osg::Matrixd | _projection |
| double | _defaultViewDistance |
| osg::ref_ptr< FollowingTrackball > | _trackball |
Encapsulates variables needed for a view.
This class encapsulates all the variables needed to describe a view of a scene, namely the modelview and projection matrices. The modelview matrix is a combination of the viewed ReferenceFrame's transformation matrix and the user's point of view (controlled using the mouse/keyboard).
The type of the projection matrix.
The base frame when viewing a ReferenceFrame. The camera is assumed to be fixed in this frame when computing its user-controlled transformations.
The method used to rotate the view to look at the "to" frame. Since the camera by default looks down the Y-axis, this specifies how the Y-axis is rotated to match the vector that points to the "to" frame.
|
inline |
Get the parameters for an orthographic projection. Only valid if an ortho projection was previously set.
|
inline |
Get the parameters for a symmetric perspective view. Only valid if a perspective view has been previously set.
|
inline |
Get the projection and view matrices.
|
inline |
Get the projection type
|
inline |
Get or set the trackball manipulator
|
inline |
Get the root/origin frames associated with this View
| void OpenFrames::View::resetView | ( | ) |
Reset the View's home position to the default. NOTE: This overrides any previously saved view.
| void OpenFrames::View::saveView | ( | ) |
Save the current view as the home view NOTE: This is used by RenderRectangle to save/restore a View when switching Views, so it is not safe for end users. Instead, end users should directly call the trackball's get/setTransformation functions (inherited from osgGA::StandardManipulator) and and OpenVRTrackball's get/setRoomToTrackballMatrix functions with custom view parameters.
|
inline |
Set the Trackball's default view distance. This is applied when the trackball is reset. A default distance <= 0.0 means that the default distance should be auto-computed.
|
inline |
Set an orthographic projection with the given bounds.
|
inline |
Set a symmetric perspective view.
| void OpenFrames::View::setViewBetweenFrames | ( | ReferenceFrame * | root, |
| ReferenceFrame * | viewFrame, | ||
| ReferenceFrame * | lookatFrame, | ||
| ViewFrameType | frameType = RELATIVE_FRAME, |
||
| ViewRotationType | rotationType = AZEL |
||
| ) |
View the lookat frame from the point of view of the base frame. Optionally, set the reference frame used when viewing the target frame and the rotation type that should be used to rotate from the target to the lookat frame.
| void OpenFrames::View::setViewFrame | ( | ReferenceFrame * | root, |
| ReferenceFrame * | viewFrame, | ||
| ViewFrameType | frameType = RELATIVE_FRAME |
||
| ) |
Set the frame to be viewed and the root frame that it should be viewed with respect to. Generally the root frame should be the root of the ReferenceFrame heirarchy that the viewed frame is part of. Optionally, set the reference frame used when viewing the target frame.
|
protected |
Default distance at which to view the frame.
|
protected |
The projection matrix.
|
protected |
The projection type for this view.
|
protected |
The transform for user interactivity.
|
protected |
The transform for the origin ReferenceFrame.
|
protected |
The transform for the look-at ReferenceFrame.
1.8.14