[ Maverik Level 1 functions ]
mav_navigationMouseDefaultParams
Summary
Provides control of the default implementation of mouse navigation
Syntax
void mav_navigationMouseDefaultParams(MAV_window *w, int but,
MAV_navigatorFn x, float xls, float xas, MAV_navigatorFn y, float yls,
float yas);
Description
Mouse navigation is controlled on a per-window (w) and per-button
(but) basis and consists of two sets of three values, the first for
horizontal mouse movements, the second for vertical. The three
arguments in each set are:
- x (and y): a function (of type MAV_navigatorFn) which performs
the required navigation. Maverik provides many default navigator
functions.
- xls (and yls): the scaling factor to convert from pixels into
application units in order to apply linear movements.
- xas (and yas): the scaling factor to convert from pixels into
radians in order to apply angular movements (this is usually
independent of the application).
For example, the following defines navigation triggered by the left mouse
button. Horizontal movements of the mouse yaws the view; and vertical
movement moves the view forward:
mav_navigationMouseDefaultParams(mav_win_all, MAV_LEFT_BUTTON,
mav_navigateYaw, 0.02, -0.001,
mav_navigateForwards, 0.02, 0.001);
A vertical mouse movement of 100 pixels equates to the eyepoint moving 2
(100x0.02) application units forwards.
Note that the angular scaling factor is negative for
mav_navigateYaw. This is because a right-handed coordinate system is
assumed which implies that a positive yaw will rotate the view to the
left. This is the opposite to what is required, and so a negative
scaling factor is used to compensate.
See also
MAV_navigatorFn.html>MAV_navigatorFn, default navigator functions
Back to the index page.