vtTrackball Class Reference
[Navigation]

Inheritance diagram for vtTrackball:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void SetRadius (float fRadius)
float GetRadius () const
void SetRotateButton (int button, int modifier=0, bool bExact=true)
void SetZoomButton (int button, int modifier=0, bool bExact=true)
void SetTranslateButton (int button, int modifier=0, bool bExact=true)
void SetZoomScale (float s)
void SetRotScale (float s)
void SetTransScale (float s)
void SetDirection (float fTheta, float fPhi)
void MoveDirection (float fTheta, float fPhi)
void OnMouse (vtMouseEvent &event)
 Virtual handler, to catch mouse events, can be overridden by your engine class.
void Eval ()


Detailed Description

A Trackball is a navigation engine which can move a Camera (or any other Transform target) and move it around a center point based on mouse input.

You can set which combinations of mouse buttons and modifier keys will rotate, zoom and translate the target. The default is:


Member Function Documentation

void vtTrackball::Eval (  )  [virtual]

Virtual handler, will be called every frame to do the work of the engine. You must override this if you want your engine to be useful.

Reimplemented from vtEngine.

float vtTrackball::GetRadius (  )  const

Get the radius, the distance from the pivot point that the Trackball rotates around.

void vtTrackball::MoveDirection ( float  fTheta,
float  fPhi 
)

Shift the direction the trackball is facing, by a given offset.

Parameters:
fTheta,fPhi Polar coordinates for the target relative to the pivot point.

void vtTrackball::SetDirection ( float  fTheta,
float  fPhi 
)

Set the direction the trackball is facing.

Parameters:
fTheta,fPhi Polar coordinates for the target relative to the pivot point.

void vtTrackball::SetRadius ( float  fRadius  ) 

Set the radius, the distance from the pivot point that the Trackball rotates around.

void vtTrackball::SetRotateButton ( int  button,
int  modifier = 0,
bool  bExact = true 
)

Set the buttons and modifier keys that will cause the Trackball to rotate.

Parameters:
button The button state (VT_LEFT, VT_RIGHT, and/or VT_MIDDLE)
modifier The modifier state (VT_SHIFT, VT_CONTROL, and/or VT_ALT)
bExact If true, then exactly this button must occur. Otherwise, any button state that includes this state will suffice.

void vtTrackball::SetRotScale ( float  s  ) 

Set the scale factor for rotation, which controls how fast the Trackball will spin its target.

void vtTrackball::SetTranslateButton ( int  button,
int  modifier = 0,
bool  bExact = true 
)

Set the buttons and modifier keys that will cause the Trackball to translate.

Parameters:
button The button state (VT_LEFT, VT_RIGHT, and/or VT_MIDDLE)
modifier The modifier state (VT_SHIFT, VT_CONTROL, and/or VT_ALT)
bExact If true, then exactly this button must occur. Otherwise, any button state that includes this state will suffice.

void vtTrackball::SetTransScale ( float  s  ) 

Set the scale factor for translation, which controls how fast the Trackball will translate its target.

void vtTrackball::SetZoomButton ( int  button,
int  modifier = 0,
bool  bExact = true 
)

Set the buttons and modifier keys that will cause the Trackball to zoom.

Parameters:
button The button state (VT_LEFT, VT_RIGHT, and/or VT_MIDDLE)
modifier The modifier state (VT_SHIFT, VT_CONTROL, and/or VT_ALT)
bExact If true, then exactly this button must occur. Otherwise, any button state that includes this state will suffice.

void vtTrackball::SetZoomScale ( float  s  ) 

Set the scale factor for zoom, which controls how fast the Trackball will zoom in/out.


Generated on Wed Dec 24 13:08:44 2008 for vtlib library by  doxygen 1.5.7.1