Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   File List   Namespace Members   Related Pages  

osg::Navigator Class Reference
[Navigators]

General Navigator for wrapping simple navigators. See General Navigator for a description. More...

#include <OSGNavigator.h>

List of all members.

Public Types

enum  Mode { TRACKBALL = 0, FLY, WALK }
enum  State {
  IDLE = 0, ROTATING, TRANSLATING_XY, TRANSLATING_Z,
  TRANSLATING_ZPLUS = 10, TRANSLATING_ZMINUS
}
enum  MouseButton {
  LEFT_MOUSE = 0, MIDDLE_MOUSE, RIGHT_MOUSE, UP_MOUSE,
  DOWN_MOUSE
}
enum  Key { LEFT = 0, RIGHT, FORWARDS, BACKWARDS }

Public Methods

Constructors
 Navigator ()
Destructors
 ~Navigator ()
Notificators
void buttonPress (Int16 button, Int16 x, Int16 y)
void buttonRelease (Int16 button, Int16 x, Int16 y)
void keyPress (Int16 key, Int16 x, Int16 y)
void moveTo (Int16 x, Int16 y)
void updateCameraTransformation ()
Set
void setMode (Mode new_mode)
void setViewport (ViewportPtr new_viewport)
void setMotionFactor (Real32 new_factor)
void setFrom (Pnt3f new_from)
void setAt (Pnt3f new_at)
void setDistance (Real32 new_distance)
void setUp (Vec3f new_up)
void set (Pnt3f new_from, Pnt3f new_at, Vec3f new_up)
void set (const Matrix &new_matrix)
bool setClickCenter (bool state)
void setCameraTransformation (const NodePtr &new_cartn)
Get
const MatrixgetMatrix ()
const Pnt3fgetFrom ()
const Pnt3fgetAt ()
const Vec3fgetUp ()
State getState ()
Mode getMode ()
WalkNavigatorgetWalkNavigator ()

Private Methods

void getIntersectionPoint (Int16 x, Int16 y)
void calcDeltas (Int16 fromX, Int16 fromY, Int16 toX, Int16 toY, Real32 &distanceX, Real32 &distanceY)

Private Attributes

Class Fields
TrackballNavigator _trackball
FlyNavigator _flyer
WalkNavigator _walker
Real32 _rMotionFactor
State _currentState
Mode _currentMode
ViewportPtr _vp
NodePtr _cartN
bool _moved
bool _clickCenter
Real32 _lastX
Real32 _lastY
Pnt3f _ip
Vec3f _dir
Matrix theMatrix


Detailed Description

The general Navigator helper class, see General Navigator for a description.


Member Enumeration Documentation

enum osg::Navigator::Mode
 

The navigation mode, i.e. the actual active low-level navigator.

Enumeration values:
TRACKBALL 
FLY 
WALK 

enum osg::Navigator::State
 

The navigation state, mainly needed for correct interpretation of mouse motions, which have to be interpreted differently for different states. Interpretation also depends on the currently active Navigator::Mode.

Enumeration values:
IDLE  Inactive state.
ROTATING  State for in-place rotation.
TRANSLATING_XY  State for x/y translation, used by the Trackball case.
TRANSLATING_Z  State for z translation, used by the Trackball case.
TRANSLATING_ZPLUS  State for rotation with automatic forward motion. The standard fly forward state.
TRANSLATING_ZMINUS  State for rotation with automatic backwards motion. The standard fly backwards state.

enum osg::Navigator::MouseButton
 

Abstraction enumeration for mouse buttons, to keep the Navigator independent of the actual Window System.

Enumeration values:
LEFT_MOUSE 
MIDDLE_MOUSE 
RIGHT_MOUSE 
UP_MOUSE  Mouse wheel up button.
DOWN_MOUSE  Mouse wheel down button.

enum osg::Navigator::Key
 

Abstraction enumeration for keys, to keep the Navigator independent of the actual Window System.

Enumeration values:
LEFT 
RIGHT 
FORWARDS 
BACKWARDS 


Constructor & Destructor Documentation

Navigator::Navigator  
 

Navigator::~Navigator  
 


Member Function Documentation

void Navigator::buttonPress Int16    button,
Int16    x,
Int16    y
 

Mouse button press handler.

void Navigator::buttonRelease Int16    button,
Int16    x,
Int16    y
 

Mouse button release handler.

void Navigator::keyPress Int16    key,
Int16    x,
Int16    y
 

Key press handler.

void Navigator::moveTo Int16    x,
Int16    y
 

Mouse motion handler.

void Navigator::updateCameraTransformation  
 

Updates the camera transformation matrix directly in the node specified as the cart.

void Navigator::setMode Mode    new_mode
 

Set the navigator mode (Trackball/Flyer/Walker).

void Navigator::setViewport ViewportPtr    new_viewport
 

Set the viewport.

void Navigator::setMotionFactor Real32    new_factor
 

Set the motion factor.

void Navigator::setFrom Pnt3f    new_from
 

Set the from point, i.e. the viewer position.

void Navigator::setAt Pnt3f    new_at
 

Set the at point, i.e. the target position for the viewer.

void Navigator::setDistance Real32    new_distance
 

Set the distance from the target position.

void Navigator::setUp Vec3f    new_up
 

Set the up vector, i.e. the vertical direction on screen.

void Navigator::set Pnt3f    new_from,
Pnt3f    new_at,
Vec3f    new_up
 

Set the full navigator parameters.

void Navigator::set const Matrix   new_matrix
 

Set the full navigator parameters from a matrix.

bool Navigator::setClickCenter bool    state
 

Set the clickCenter current state.

void Navigator::setCameraTransformation const NodePtr   new_cartn
 

Set the camera transformation node.

const Matrix & Navigator::getMatrix void   
 

Get the transformation matrix.

const Pnt3f & Navigator::getFrom  
 

Get the from point, i.e. the viewer position.

const Pnt3f & Navigator::getAt  
 

Get the at point, i.e. the target position.

const Vec3f & Navigator::getUp  
 

Get the up vector.

Navigator::State Navigator::getState void   
 

Get the navigator's current state.

Navigator::Mode Navigator::getMode void   
 

Get the navigator's current mode.

WalkNavigator* osg::Navigator::getWalkNavigator   [inline]
 

Get the transformation matrix.

void Navigator::getIntersectionPoint Int16    x,
Int16    y
[private]
 

Calculates the intersection point of a ray that starts at from and goes through the position on the screen given by x,y with the world, if no intersection point exists the intersection is set to (0,0,0)

void Navigator::calcDeltas Int16    fromX,
Int16    fromY,
Int16    toX,
Int16    toY,
Real32   distanceX,
Real32   distanceY
[private]
 

Calculate the real translation that has to be done, so that the trackball can actually drag the object in the plane parallel to the screen.


Member Data Documentation

TrackballNavigator osg::Navigator::_trackball [private]
 

FlyNavigator osg::Navigator::_flyer [private]
 

WalkNavigator osg::Navigator::_walker [private]
 

Navigator::_rMotionFactor [private]
 

The motion factor, roughly equivalent to speed.

State osg::Navigator::_currentState [private]
 

Mode osg::Navigator::_currentMode [private]
 

ViewportPtr osg::Navigator::_vp [private]
 

NodePtr osg::Navigator::_cartN [private]
 

bool osg::Navigator::_moved [private]
 

bool osg::Navigator::_clickCenter [private]
 

Real32 osg::Navigator::_lastX [private]
 

Real32 osg::Navigator::_lastY [private]
 

Navigator::_ip [private]
 

Temporary hit point for intersection testing.

Navigator::_dir [private]
 

Temporary ray direction for intersection testing.

Matrix osg::Navigator::theMatrix [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Mar 19 06:26:29 2003 for OpenSG by doxygen1.3-rc2