MouseOrbit.c File Reference

This module implements the mouse interface for orbital mode. More...


Functions

void MouseOrbit_contruct (MouseOrbit *mom, const char *fileName)
 Initialize the MouseOrbit structure 'mom' using configuration settings in file 'fileName'.
void MouseOrbit_start (MouseOrbit *mom, view_t *view, int height)
 Start MouseOrbit mode navigation using structure 'mom' updating view 'view' and with starting height 'height'.
void MouseOrbit_execute (MouseOrbit *mom, const VGIS_Event *event, view_t *view, int mouse[2])
 Execute MouseOrbit navigation using structure 'mom' on view 'view' processing the current event 'event' and using mouse locaiton 'mouse'.


Detailed Description

This module implements the mouse interface for orbital mode.

Author:
Zachary Wartell

MOUSE ORBIT INTERFACE

To pan the terrain press and hold the left mouse button.

To rotate the terrain, select a center of rotation then press and hold the left mouse button along with the Control key.

To zoom in, press and hold the middle mouse button.

To zoom out, press and hold the right mouse button.


Function Documentation

void MouseOrbit_contruct MouseOrbit mom,
const char *  fileName
 

Initialize the MouseOrbit structure 'mom' using configuration settings in file 'fileName'.

Author:
Zach Wartell

void MouseOrbit_execute MouseOrbit mom,
const VGIS_Event event,
view_t view,
int  mouse[2]
 

Execute MouseOrbit navigation using structure 'mom' on view 'view' processing the current event 'event' and using mouse locaiton 'mouse'.

Author:
Zach Wartell
Implementation Notes:

MouseOrbit panning works in one of two modes. If the ray from the eye through the mouse pointer intersects the terrain, we compute a polygon accurate intersection of the ray and terrain to find the grabbed point. This becomes necessary when zoomed in order to maintain a nice 1:1 ratio between mouse movement and terrain panning movement. If above ray intersects nothing, then panning increment is mapped directly to mouse movement. This is useful when zoomed out where you can see the whole planet.

An alternative implementation, for the polygon accurate intersection would be reading the z-buffer under the pointer to compute the grab point in 3-space, but I used the analytic intersection test since I had already use that for the more general workbench orbit mode (see Workbench.c).

void MouseOrbit_start MouseOrbit mom,
view_t view,
int  height
 

Start MouseOrbit mode navigation using structure 'mom' updating view 'view' and with starting height 'height'.

If 'height' = 0 then the starting height isn't changed.

Author:
Zach Wartell


Generated by doxygen written by Dimitri van Heesch, © 1997-2001