Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuArcBall Class Reference

Provides arc ball control for a vuCamera. More...

#include <vuArcBall.h>

Collaboration diagram for vuArcBall:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vuArcBall ()
 default constructor
void attachCamera (vuCamera &camera)
 attach a camera
void setWinSize (int maxX, int maxY)
 set extensions of window
void setCenter (vuVector &center)
 set a center around which the camera rotates
void turn (int ox, int oy, int nx, int ny)
 Turn camera.

Protected Member Functions

vuVector spherePoint (int px, int py)
 Translate point into unit-sphere coordinate.

Protected Attributes

int m_Winx
 This is the width of the window.
int m_Winy
 This is the height of the window.
vuVector m_Center
 This is the vector that points to the center of this window.
vuCameram_Camera
 This is the camera associated with this window.

Detailed Description

Provides arc ball control for a vuCamera.

An arc ball is a useful way to control the rotation of an object. Therefore the surface points of a Halfsphere are mapped to the screen. If the mouse is dragged over the screen the rotation behaves like a ball which surface is touched by a moving finger.

Definition at line 13 of file vuArcBall.h.


Constructor & Destructor Documentation

vuArcBall::vuArcBall  ) 
 

default constructor

Definition at line 8 of file vuArcBall.cpp.

References m_Camera.


Member Function Documentation

void vuArcBall::attachCamera vuCamera camera  ) 
 

attach a camera

Definition at line 14 of file vuArcBall.cpp.

References m_Camera.

Referenced by vuSpecFVR::glOnMouse(), vuPreviewWin::glOnMouse(), vuBCCSheetSplatter::glOnMouse(), and vuBasicUtility::onMouseLeftMoving().

void vuArcBall::setCenter vuVector center  ) 
 

set a center around which the camera rotates

Definition at line 30 of file vuArcBall.cpp.

References m_Center.

void vuArcBall::setWinSize int  maxX,
int  maxY
 

set extensions of window

This is necessairy to provide a proper mapping of cartesian coordinates to surface points of a spere

Definition at line 23 of file vuArcBall.cpp.

References m_Winx, and m_Winy.

Referenced by vuSpecFVR::glOnMouse(), vuPreviewWin::glOnMouse(), vuBCCSheetSplatter::glOnMouse(), and vuBasicUtility::onMouseLeftMoving().

vuVector vuArcBall::spherePoint int  px,
int  py
[protected]
 

Translate point into unit-sphere coordinate.

Definition at line 38 of file vuArcBall.cpp.

References m_Winx, and m_Winy.

Referenced by turn().

void vuArcBall::turn int  ox,
int  oy,
int  nx,
int  ny
 

Turn camera.

old (ox,oy) and new (nx,ny) position of mouse pointer are used to perform a rotation of the camera around a central point

Definition at line 67 of file vuArcBall.cpp.

References vuVector::cross, vuVector::dot, vuCamera::getViewMat(), M_1_PI, m_Camera, vuMatrix::makeRotate(), vuVector::makeUnit(), vuVector::norm2(), spherePoint(), and vuCamera::transform().

Referenced by vuSpecFVR::glOnMouse(), vuPreviewWin::glOnMouse(), vuBCCSheetSplatter::glOnMouse(), and vuBasicUtility::onMouseLeftMoving().

Here is the call graph for this function:


Member Data Documentation

vuCamera* vuArcBall::m_Camera [protected]
 

This is the camera associated with this window.

Definition at line 44 of file vuArcBall.h.

Referenced by attachCamera(), turn(), and vuArcBall().

vuVector vuArcBall::m_Center [protected]
 

This is the vector that points to the center of this window.

Definition at line 43 of file vuArcBall.h.

Referenced by setCenter().

int vuArcBall::m_Winx [protected]
 

This is the width of the window.

Definition at line 41 of file vuArcBall.h.

Referenced by setWinSize(), and spherePoint().

int vuArcBall::m_Winy [protected]
 

This is the height of the window.

Definition at line 42 of file vuArcBall.h.

Referenced by setWinSize(), and spherePoint().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:21:11 2004 for vuVolume by  doxygen 1.3.9.1