GLC_FlyMover : Fly Mode interactive manipulation. More...
#include <glc_flymover.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_FlyMover (GLC_Viewport *, const QList< GLC_RepMover * > &repsList=QList< GLC_RepMover * >()) | |
| Default constructor. | |
| GLC_FlyMover (const GLC_FlyMover &flyMover) | |
| Copy constructor. | |
| virtual | ~GLC_FlyMover () |
| Destructor. | |
Get Functions | |
| virtual GLC_Mover * | clone () const |
| Return a clone of the mover. | |
| double | turningRate () const |
| Return the turning rate in degres. | |
| double | flyingVelocity () const |
| Return the flying velocity. | |
Set Functions | |
| virtual void | init (const GLC_UserInput &userInput) |
| Initialized the mover. | |
| virtual bool | move (const GLC_UserInput &userInput) |
| Move the camera. | |
| virtual void | ends () |
| Ends this mover. | |
| void | setMaximumTurnRate (double turnRate) |
| Set the maximum turning rate in degre. | |
| void | setFlyingVelocity (double velocity) |
| Set the flying velocity. | |
| void | increaseVelocity (double factor) |
| increase the flying velocity | |
Protected Member Functions | |
| void | timerEvent (QTimerEvent *) |
Private Member Functions | |
| GLC_Vector3d | mapForFlying (double x, double y) |
| Map the position of mouse for the fly mode. | |
| void | fly () |
| Fly. | |
Private Attributes | |
| double | m_TurnRate |
| THe turning rate. | |
| int | m_TimerId |
| The timer id. | |
| int | m_TimerInterval |
| the timer interval | |
| double | m_Velocity |
| fly velocity | |
GLC_FlyMover : Fly Mode interactive manipulation.
Definition at line 34 of file glc_flymover.h.
| GLC_FlyMover::GLC_FlyMover | ( | GLC_Viewport * | pViewport, | |
| const QList< GLC_RepMover * > & | repsList = QList<GLC_RepMover*>() | |||
| ) |
Default constructor.
Definition at line 28 of file glc_flymover.cpp.
References GLC_RepMover::RepMoverInfo::m_DoubleInfo, GLC_Mover::m_MoverInfo, GLC_RepMover::RepMoverInfo::m_VectorInfo, and m_Velocity.
Referenced by clone().
| GLC_FlyMover::GLC_FlyMover | ( | const GLC_FlyMover & | flyMover | ) |
Copy constructor.
Definition at line 39 of file glc_flymover.cpp.
| GLC_FlyMover::~GLC_FlyMover | ( | ) | [virtual] |
| GLC_Mover * GLC_FlyMover::clone | ( | ) | const [virtual] |
Return a clone of the mover.
Implements GLC_Mover.
Definition at line 61 of file glc_flymover.cpp.
References GLC_FlyMover().
| void GLC_FlyMover::ends | ( | ) | [virtual] |
Ends this mover.
Reimplemented from GLC_Mover.
Definition at line 95 of file glc_flymover.cpp.
References m_TimerId.
| void GLC_FlyMover::fly | ( | ) | [private] |
Fly.
Definition at line 160 of file glc_flymover.cpp.
References GLC_Viewport::cameraHandle(), GLC_Camera::eye(), GLC_Camera::forward(), GLC_Mover::m_PreviousVector, GLC_Mover::m_pViewport, GLC_Camera::move(), and GLC_Camera::viewMatrix().
Referenced by timerEvent().
| double GLC_FlyMover::flyingVelocity | ( | ) | const [inline] |
Return the flying velocity.
Definition at line 64 of file glc_flymover.h.
| void GLC_FlyMover::increaseVelocity | ( | double | factor | ) |
increase the flying velocity
Definition at line 107 of file glc_flymover.cpp.
References GLC_RepMover::RepMoverInfo::m_DoubleInfo, GLC_Mover::m_MoverInfo, and m_Velocity.
| void GLC_FlyMover::init | ( | const GLC_UserInput & | userInput | ) | [virtual] |
Initialized the mover.
Implements GLC_Mover.
Definition at line 71 of file glc_flymover.cpp.
References GLC_Viewport::cameraHandle(), GLC_Camera::eye(), GLC_RepMover::RepMoverInfo::m_DoubleInfo, GLC_Mover::m_MoverInfo, GLC_Mover::m_PreviousVector, GLC_Mover::m_pViewport, m_TimerId, m_TimerInterval, m_Velocity, mapForFlying(), GLC_Camera::setDistTargetEye(), GLC_Viewport::unProject(), GLC_UserInput::x(), and GLC_UserInput::y().
| GLC_Vector3d GLC_FlyMover::mapForFlying | ( | double | x, | |
| double | y | |||
| ) | [private] |
Map the position of mouse for the fly mode.
Definition at line 125 of file glc_flymover.cpp.
References GLC_Vector3d::length(), GLC_Mover::m_MoverInfo, GLC_Mover::m_pViewport, m_TurnRate, GLC_RepMover::RepMoverInfo::m_VectorInfo, GLC_Vector3d::normalize(), GLC_Vector3d::setZ(), GLC_Mover::updateRepresentation(), GLC_Viewport::viewHSize(), and GLC_Viewport::viewVSize().
| bool GLC_FlyMover::move | ( | const GLC_UserInput & | userInput | ) | [virtual] |
Move the camera.
Implements GLC_Mover.
Definition at line 86 of file glc_flymover.cpp.
References GLC_Viewport::cameraHandle(), GLC_Camera::eye(), GLC_Mover::m_PreviousVector, GLC_Mover::m_pViewport, mapForFlying(), GLC_Camera::setDistTargetEye(), GLC_Viewport::unProject(), GLC_UserInput::x(), and GLC_UserInput::y().
| void GLC_FlyMover::setFlyingVelocity | ( | double | velocity | ) |
Set the flying velocity.
Definition at line 101 of file glc_flymover.cpp.
References GLC_RepMover::RepMoverInfo::m_DoubleInfo, GLC_Mover::m_MoverInfo, and m_Velocity.
| void GLC_FlyMover::setMaximumTurnRate | ( | double | turnRate | ) | [inline] |
Set the maximum turning rate in degre.
Definition at line 83 of file glc_flymover.h.
| void GLC_FlyMover::timerEvent | ( | QTimerEvent * | ) | [protected] |
Definition at line 113 of file glc_flymover.cpp.
References GLC_Viewport::cameraHandle(), fly(), GLC_Camera::forward(), GLC_Mover::m_pViewport, m_TimerInterval, m_Velocity, GLC_Camera::move(), and GLC_Mover::updated().
| double GLC_FlyMover::turningRate | ( | ) | const [inline] |
Return the turning rate in degres.
Definition at line 60 of file glc_flymover.h.
References glc::PI.
int GLC_FlyMover::m_TimerId [private] |
The timer id.
Definition at line 115 of file glc_flymover.h.
Referenced by ends(), init(), and ~GLC_FlyMover().
int GLC_FlyMover::m_TimerInterval [private] |
the timer interval
Definition at line 118 of file glc_flymover.h.
Referenced by init(), and timerEvent().
double GLC_FlyMover::m_TurnRate [private] |
double GLC_FlyMover::m_Velocity [private] |
fly velocity
Definition at line 121 of file glc_flymover.h.
Referenced by GLC_FlyMover(), increaseVelocity(), init(), setFlyingVelocity(), and timerEvent().