#include <ivfwidget/IvfFlyHandler.h>
Inheritance diagram for CIvfFlyHandler:
Public Member Functions | |
CIvfFlyHandler (CIvfWidgetBase *widget, CIvfCamera *camera) | |
IvfClassInfo ("CIvfFlyHandler", CIvfHandlerBase) | |
void | update () |
void | setMouseSensitivity (double value) |
double | getMouseSensitivity () |
void | setSpeedStep (double step) |
double | getSpeedStep () |
void | setMaxSpeed (double speed) |
double | getMaxSpeed () |
void | setRedraw (bool flag) |
virtual void | onKeyboard (int key, int x, int y) |
virtual void | onMouseUp (int x, int y) |
virtual void | onMouseDown (int x, int y) |
virtual void | onMouseMove (int x, int y) |
void | doKeyboard (int key, int x, int y) |
void | doMouseUp (int x, int y) |
void | doMouseMove (int x, int y) |
void | doMouseDown (int x, int y) |
Protected Member Functions | |
virtual void | doDeactivate () |
virtual void | doActivate () |
This handler implements a fly navigation mode that can be used together with CIvfWidgetBase derived classes, such as CIvfFltkBase, CIvfWin32Window, CIvfMfcBase etc. The class take a reference to the active widget and a CIvfCamera derived class.
Controls:
w - Increase velocity
s - Decrease velocity
x - Sets velocity to zero.
q - Increase vertical velocity
a - Decrease vertical velocity
Definition at line 53 of file IvfFlyHandler.h.
|
Class constructor widget Reference to a CIvfWidgetBase class. In most cases this parameter can be set to this.
|
|
Return max speed |
|
Return mouse sensitivity |
|
Return current speed step value |
|
onKeyboard method The onKeyboard method is called when a key on the keyboard is pressed Reimplemented from CIvfKeyboardEvent. |
|
onMouseUp method The onMouse method is called when the mouse button is released. Reimplemented from CIvfMouseDownEvent. |
|
onMouseMove method The onMouseMove method is called whenever the mouse is moved in the window. Reimplemented from CIvfMouseMoveEvent. |
|
onMouseMove method The onMouseMove method is called whenever the mouse is moved in the window. Reimplemented from CIvfMouseUpEvent. |
|
Set maximum speed |
|
Set mouse sensistivity The mouse sensitivity is used determine the turning/rotate speed when the mouse is moved: mouse_delta_x * sensitivity * dt mouse_delta_y * sensitivity * dt |
|
Set redraw handling The fly handler can handle screen redrawing automatically (flag=true) Sometimes it can be effective to control redrawing manually (flag=false) |
|
Set speed step The speed step value determines how much the speed increases or decreases when the user presses the forward/back button (W/S) to increase/decrease the forward velocity. |
|
View update routine The fly handler needs to be updated regularly. This routine updates the state variables and the camera depending on the elapsed time. Typically this routine should be called from a timer or an application loop. |