![]() |
An open-source, flexible 3D physical simulation framework
|
#include <GraphicsCamera.h>
Public Types | |
enum | Direction { FORWARD, BACKWARD, LEFT, RIGHT } |
Public Member Functions | |
GraphicsCamera (osg::ref_ptr< osg::Camera > _camera, int width=720, int height=505) | |
~GraphicsCamera (void) | |
virtual void | setFrustum (double left, double right, double bottom, double top, double near, double far) |
virtual void | setFrustumFromRad (double horizontalOpeningAngle, double verticalOpeningAngle, double near, double far) |
virtual void | getFrustum (std::vector< double > &frustum) |
virtual void | updateViewport (double rx, double ry, double tx, double ty, double tz, double rz=0, bool remember=0) |
virtual void | updateViewportQuat (double tx, double ty, double tz, double rx, double ry, double rz, double rw) |
virtual void | lookAtIso (double x, double y, double z=0) |
switches the camera to iso mode and looks at the given position(x, y) at the given height(z) More... | |
virtual void | getViewport (double *rx, double *ry, double *tx, double *ty, double *tz, double *rz) |
virtual void | getViewportQuat (double *tx, double *ty, double *tz, double *rx, double *ry, double *rz, double *rw) |
void | setEyeSep (double value) |
double | getEyeSep (void) const |
virtual void | setCamera (int type) |
sets the camera type More... | |
virtual int | getCameraType (void) const |
virtual int | getCamera (void) const |
osg::ref_ptr< osg::Camera > | getOSGCamera () |
utils::Vector | getCameraPosition () |
sets the camera view More... | |
void | setCameraView (interfaces::cameraStruct cs) |
virtual void | getCameraInfo (interfaces::cameraStruct *s) |
returns the cameraStruct More... | |
void | update (void) |
void | setViewport (int x, int y, int width, int height) |
void | eventStartPos (int x, int y) |
void | setKeyswitchManipulator (osg::ref_ptr< osgGA::KeySwitchMatrixManipulator > keyswitchManipulator) |
void | mouseDrag (int button, unsigned int modkey, int x, int y) |
void | move (bool isMoving, Direction dir) |
sets the camera motion state More... | |
void | zoom (float speed) |
moves camera up and donwn in iso mode More... | |
virtual void | changeCameraTypeToPerspective () |
set camera type by context menu More... | |
virtual void | changeCameraTypeToOrtho () |
void | openSetCamViewport () |
void | context_setCamPredefLeft () |
void | context_setCamPredefRight () |
void | context_setCamPredefFront () |
void | context_setCamPredefRear () |
void | context_setCamPredefTop () |
void | context_setCamPredefBottom () |
void | setStereoMode (bool _stereo) |
void | toggleStereoMode (void) |
void | setFocalLength (double value) |
double | getFocalLength (void) const |
void | setSwitchEye (bool val) |
void | setLeftEye (void) |
void | setRightEye (void) |
void | deactivateCam () |
void | activateCam () |
void | setPivot (osg::Vec3f p) |
void | toggleTrackball () |
void | setupDistortion (osg::Texture2D *texture, osg::Image *image, osg::Group *mainScene, double factor) |
![]() | |
virtual | ~GraphicsCameraInterface () |
Private Member Functions | |
void | calcEyeSep (void) |
void | moveForward (float speed) |
moves the camera forward with positive speed and backwards with negative speed More... | |
void | moveRight (float speed) |
moves te camera left with positive speed and right with negative speed More... | |
osg::Vec3f | getClickedPoint (int x, int y) |
Private Attributes | |
interfaces::local_settings * | l_settings |
osg::ref_ptr< osg::Camera > | mainCamera |
osg::ref_ptr< osg::Camera > | hudCamera |
osg::Matrixd | myCameraMatrix |
osg::Matrixd | cameraRotation |
osg::Matrixd | cameraTrans |
osg::ref_ptr< osgGA::KeySwitchMatrixManipulator > | keyswitchManipulator |
osg::Vec3f | pivot |
int | camera |
int | camType |
int | previousType |
double | actOrtH |
int | width |
int | height |
int | xpos |
int | ypos |
int | xrot |
int | yrot |
double | d_xp |
double | d_yp |
double | d_zp |
double | d_xr |
double | d_yr |
double | d_zr |
double | f_nearPlane |
double | f_farPlane |
double | f_aperture |
double | f_focal |
double | f_left [2] |
double | f_right [2] |
double | f_top |
double | f_bottom |
double | f_ratio |
double | f_win_ratio |
double | separation |
double | eyeSep |
bool | stereo |
bool | switch_eyes |
short | left |
int | nodeMask |
bool | isMovingForward |
bool | isMovingBack |
bool | isMovingLeft |
bool | isMovingRight |
double | isoMinHeight |
double | isoMaxHeight |
Definition at line 45 of file GraphicsCamera.h.
Enumerator | |
---|---|
FORWARD | |
BACKWARD | |
LEFT | |
RIGHT |
Definition at line 54 of file GraphicsCamera.h.
mars::graphics::GraphicsCamera::GraphicsCamera | ( | osg::ref_ptr< osg::Camera > | _camera, |
int | width = 720 , |
||
int | height = 505 |
||
) |
Definition at line 49 of file GraphicsCamera.cpp.
mars::graphics::GraphicsCamera::~GraphicsCamera | ( | void | ) |
Definition at line 117 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 957 of file GraphicsCamera.cpp.
|
private |
Definition at line 607 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 133 of file GraphicsCamera.cpp.
|
virtual |
set camera type by context menu
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 121 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 592 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 581 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 573 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 585 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 577 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 588 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 952 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::eventStartPos | ( | int | x, |
int | y | ||
) |
Definition at line 904 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 940 of file GraphicsCamera.cpp.
|
virtual |
returns the cameraStruct
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 334 of file GraphicsCamera.cpp.
Vector mars::graphics::GraphicsCamera::getCameraPosition | ( | ) |
sets the camera view
Definition at line 176 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 948 of file GraphicsCamera.cpp.
|
private |
Definition at line 702 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 620 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 935 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 412 of file GraphicsCamera.cpp.
osg::ref_ptr< osg::Camera > mars::graphics::GraphicsCamera::getOSGCamera | ( | ) |
Definition at line 944 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 550 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 560 of file GraphicsCamera.cpp.
|
virtual |
switches the camera to iso mode and looks at the given position(x, y) at the given height(z)
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 520 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::mouseDrag | ( | int | button, |
unsigned int | modkey, | ||
int | x, | ||
int | y | ||
) |
Definition at line 728 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::move | ( | bool | isMoving, |
GraphicsCamera::Direction | dir | ||
) |
sets the camera motion state
Definition at line 638 of file GraphicsCamera.cpp.
|
private |
moves the camera forward with positive speed and backwards with negative speed
Definition at line 656 of file GraphicsCamera.cpp.
|
private |
moves te camera left with positive speed and right with negative speed
Definition at line 682 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::openSetCamViewport | ( | ) |
|
virtual |
sets the camera type
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 153 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::setCameraView | ( | interfaces::cameraStruct | cs | ) |
Definition at line 366 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 596 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 924 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 401 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 387 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::setKeyswitchManipulator | ( | osg::ref_ptr< osgGA::KeySwitchMatrixManipulator > | keyswitchManipulator | ) |
Definition at line 909 of file GraphicsCamera.cpp.
|
inlinevirtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 120 of file GraphicsCamera.h.
void mars::graphics::GraphicsCamera::setPivot | ( | osg::Vec3f | p | ) |
Definition at line 963 of file GraphicsCamera.cpp.
|
inlinevirtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 121 of file GraphicsCamera.h.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 916 of file GraphicsCamera.cpp.
|
inlinevirtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 119 of file GraphicsCamera.h.
void mars::graphics::GraphicsCamera::setupDistortion | ( | osg::Texture2D * | texture, |
osg::Image * | image, | ||
osg::Group * | mainScene, | ||
double | factor | ||
) |
Definition at line 977 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 325 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 920 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 143 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::update | ( | void | ) |
Definition at line 181 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 428 of file GraphicsCamera.cpp.
|
virtual |
Implements mars::interfaces::GraphicsCameraInterface.
Definition at line 479 of file GraphicsCamera.cpp.
void mars::graphics::GraphicsCamera::zoom | ( | float | speed | ) |
moves camera up and donwn in iso mode
Definition at line 624 of file GraphicsCamera.cpp.
|
private |
Definition at line 142 of file GraphicsCamera.h.
|
private |
Definition at line 140 of file GraphicsCamera.h.
|
private |
Definition at line 136 of file GraphicsCamera.h.
|
private |
Definition at line 137 of file GraphicsCamera.h.
|
private |
Definition at line 141 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 146 of file GraphicsCamera.h.
|
private |
Definition at line 152 of file GraphicsCamera.h.
|
private |
Definition at line 147 of file GraphicsCamera.h.
|
private |
Definition at line 148 of file GraphicsCamera.h.
|
private |
Definition at line 147 of file GraphicsCamera.h.
|
private |
Definition at line 147 of file GraphicsCamera.h.
|
private |
Definition at line 148 of file GraphicsCamera.h.
|
private |
Definition at line 147 of file GraphicsCamera.h.
|
private |
Definition at line 149 of file GraphicsCamera.h.
|
private |
Definition at line 148 of file GraphicsCamera.h.
|
private |
Definition at line 148 of file GraphicsCamera.h.
|
private |
Definition at line 150 of file GraphicsCamera.h.
|
private |
Definition at line 143 of file GraphicsCamera.h.
|
private |
Definition at line 134 of file GraphicsCamera.h.
|
private |
Definition at line 159 of file GraphicsCamera.h.
|
private |
Definition at line 159 of file GraphicsCamera.h.
|
private |
Definition at line 159 of file GraphicsCamera.h.
|
private |
Definition at line 159 of file GraphicsCamera.h.
|
private |
Definition at line 161 of file GraphicsCamera.h.
|
private |
Definition at line 161 of file GraphicsCamera.h.
|
private |
Definition at line 138 of file GraphicsCamera.h.
|
private |
Definition at line 131 of file GraphicsCamera.h.
|
private |
Definition at line 155 of file GraphicsCamera.h.
|
private |
Definition at line 133 of file GraphicsCamera.h.
|
private |
Definition at line 135 of file GraphicsCamera.h.
|
private |
Definition at line 156 of file GraphicsCamera.h.
|
private |
Definition at line 139 of file GraphicsCamera.h.
|
private |
Definition at line 141 of file GraphicsCamera.h.
|
private |
Definition at line 151 of file GraphicsCamera.h.
|
private |
Definition at line 153 of file GraphicsCamera.h.
|
private |
Definition at line 154 of file GraphicsCamera.h.
|
private |
Definition at line 143 of file GraphicsCamera.h.
|
private |
Definition at line 145 of file GraphicsCamera.h.
|
private |
Definition at line 145 of file GraphicsCamera.h.
|
private |
Definition at line 145 of file GraphicsCamera.h.
|
private |
Definition at line 145 of file GraphicsCamera.h.