cpe::trackball Class Reference

A container class to deal with a trackball, use ArcBall paradigm. More...

+ Collaboration diagram for cpe::trackball:

Public Member Functions

 trackball ()
 
const quaternionquat () const
 get the current quaternion More...
 
quaternionquat ()
 get the current quaternion More...
 
const quaterniond_quat () const
 get the quaternion to apply More...
 
quaterniond_quat ()
 get the quaternion to apply More...
 
float & radius ()
 get the disc radius More...
 
float radius () const
 get the disc radius More...
 
double project_to_disc (float x, float y) const
 return the distance to disc for the 3D coordinate More...
 
void set_2d_coords (float x0, float y0, float x1, float y1)
 given a set of 2d coords difference, return the corresponding quaternion More...
 
void apply_rotation ()
 multiply d_q to current_q More...
 
void no_motion ()
 Set d_q to 0. More...
 

Private Attributes

quaternion current_q
 the current quaternion More...
 
quaternion d_q
 the quaternion to apply More...
 
float disc_radius
 internal parameter of the disc radius More...
 

Detailed Description

A container class to deal with a trackball, use ArcBall paradigm.

Constructor & Destructor Documentation

cpe::trackball::trackball ( )

initial constructor

References current_q.

Member Function Documentation

void cpe::trackball::apply_rotation ( )

multiply d_q to current_q

References cpe::quaternion::conjugated(), current_q, and d_q.

Referenced by cpe::navigator_tool::trackball_rotate().

+ Here is the call graph for this function:

const quaternion & cpe::trackball::d_quat ( ) const

get the quaternion to apply

References d_q.

quaternion & cpe::trackball::d_quat ( )

get the quaternion to apply

References d_q.

void cpe::trackball::no_motion ( )

Set d_q to 0.

References d_q.

double cpe::trackball::project_to_disc ( float  x,
float  y 
) const

return the distance to disc for the 3D coordinate

References disc_radius.

Referenced by set_2d_coords().

const quaternion & cpe::trackball::quat ( ) const
quaternion & cpe::trackball::quat ( )

get the current quaternion

References current_q.

float & cpe::trackball::radius ( )

get the disc radius

References disc_radius.

float cpe::trackball::radius ( ) const

get the disc radius

References disc_radius.

void cpe::trackball::set_2d_coords ( float  x0,
float  y0,
float  x1,
float  y1 
)

given a set of 2d coords difference, return the corresponding quaternion

References cpe::vec3::cross(), d_q, disc_radius, cpe::vec3::norm(), and project_to_disc().

Referenced by cpe::navigator_tool::trackball_rotate().

+ Here is the call graph for this function:

Member Data Documentation

quaternion cpe::trackball::current_q
private

the current quaternion

Referenced by apply_rotation(), quat(), and trackball().

quaternion cpe::trackball::d_q
private

the quaternion to apply

Referenced by apply_rotation(), d_quat(), no_motion(), and set_2d_coords().

float cpe::trackball::disc_radius
private

internal parameter of the disc radius

Referenced by project_to_disc(), radius(), and set_2d_coords().


The documentation for this class was generated from the following files: