#include <manipulatedCameraFrame.h>
Inherits ManipulatedFrame.
Fly parameters | |
float | flySpeed () const |
Vec | flyUpVector () const |
void | setFlySpeed (const float s) |
void | setFlyUpVector (const Vec &up) |
XML representation | |
virtual QDomElement | domElement (const QString &name, QDomDocument &doc) const |
virtual void | initFromDOMElement (const QDomElement &e) |
Mouse event handlers | |
virtual void | mouseReleaseEvent (QMouseEvent *const, Camera *const) |
virtual void | mouseMoveEvent (QMouseEvent *const, const Camera *const camera) |
virtual void | wheelEvent (QWheelEvent *const, const Camera *const camera) |
Public Member Functions | |
ManipulatedCameraFrame () | |
virtual | ~ManipulatedCameraFrame () |
ManipulatedCameraFrame (const ManipulatedCameraFrame &mcf) | |
ManipulatedCameraFrame & | operator= (const ManipulatedCameraFrame &mcf) |
Protected Slots | |
void | updateFrameInFlyMode () |
Protected Member Functions | |
void | updateFlyUpVector () |
Quaternion | quaternionFromThetaPhi (const int x, const int y, const Camera *const camera) |
A ManipulatedCameraFrame is a specialization of a ManipulatedFrame, designed for associated Camera frames. All mouse motions are basically interpreted in a negated way: when the mouse goes to the right, the ManipulatedFrame translation goes to the right, while the ManipulatedCameraFrame has to go to the left, so that the scene seems to move to the right.
See the mouse page for a description of the possible displacements that can be performed using the mouse.
The ManipulatedFrame::isManipulated() function is used to call QGLViewer::fastDraw() instead of QGLViewer::draw() for interactive scene displays when the camera is manipulated (see the fastDraw example).
A ManipulatedCameraFrame can be used as the QGLViewer::manipulatedFrame() (for instance, with two viewers, it is possible to manipulate the first viewer camera in the second viewer). In that case, the mouse response will be the one of a classical ManipulatedFrame, as one would expect.
When created, ManipulatedCameraFrame are not added to the MouseGrabber::MouseGrabberPool() as ManipulatedFrame are.
false
, this rotationCenter() will still be used.
|
Creates a default ManipulatedCameraFrame. flySpeed() is set to 0.0 and flyUpVector() is (0,1,0). The Frame rotatesAroundCenter().
|
|
Virtual destructor. Empty. |
|
Copy constructor. Performs a deep copy of all members using operator=(). Signal and slot connections are not copied. |
|
Creates an XML QDomElement that represents the ManipulatedCameraFrame. Adds to ManipulatedFrame::domElement() the ManipulatedCameraFrame specific informations.
Fields that are not described in the Use initFromDOMElement() to restore the ManipulatedCameraFrame state from the resulting QDomElement. Reimplemented from ManipulatedFrame. |
|
Returns the current fly speed set with setFlySpeed(). Set according to the QGLViewer::sceneRadius() in QGLViewer::setSceneRadius(). |
|
Return the up vector used in QGLViewer::MOVE_FORWARD and QGLViewer::MOVE_BACKWARD modes. This vector is normal to the displacement horizontal plane. Horizontal displacements of the mouse rotates the frame around this vector. It is expressed in the world coordinate system. Vertical displacements of the mouse rotate around the Camera |
|
Restore the ManipulatedCameraFrame state from a QDomElement created by domElement(). See also Frame::initFromDOMElement().
Fields that are not described in Reimplemented from ManipulatedFrame. |
|
Move the camera frame according to the mouse motion. The camera is given as an argument so that its parameters (width and height of the window, fieldOfView) are available in order to fit the mouse motion and the display. Emits manipulated(). Reimplemented from ManipulatedFrame. |
|
When the user releases the mouse button, the manipulatedFrame action is stopped. Reimplemented from ManipulatedFrame. |
|
Classical = operator. Signal and slot connections are not copied. See also ManipulatedFrame::operator=(). |
|
Set lastQuat according to the mouse motion. Simple Theta,Phi inferred from the X,flyUpVector() axis. |
|
When a QGLViewer::MOVE_FORWARD or QGLViewer::MOVE_BACKWARD action is produced by the mouse, this value tunes the speed of the displacement. Current value is given by flySpeed(). See the mouse page and QGLViewer::setMouseBinding() for details. |
|
Defines the fly up vector (used in MOVE_FORWARD and MOVE_BACKWARD mode), defined in the world coordinate system. See flyUpVector(). |
|
This function will be called by the camera when the camera orientation is changed, so that the flyUpVector (private) is changed accordingly. You should not need to call this function. |
|
Called for continuous frame motion in fly mode (see QGLViewer::MOVE_FORWARD). Emits manipulated(). |
|
The wheel behavior depends on the wheel binded action. Current possible actions are ZOOM, MOVE_FORWARD, MOVE_BACKWARD. See QGLViewer::setWheelBinding() to customize the binding. ZOOM speeds depends on wheelSensitivity() while MOVE_FORWARD and MOVE_BACKWARD depend on flySpeed().
Reimplemented from ManipulatedFrame. |