Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

esve::components::dim4::Rotation_Handler Class Reference

Mappings from two-dimensional mouse input to four-dimensional rotations. More...

#include <esve/components/dim4/Rotation_Handler.hxx>

Inheritance diagram for esve::components::dim4::Rotation_Handler:

esve::components::dimn::Differential_Motion_Handler< Transform, impl_Transform > esve::components::dimn::Supermouse_Motion_Handler esve::components::dimn::Inertial_Motion_Handler esve::components::dimn::Motion_Handler esve::components::dimn::Supermouse_Handler esve::message::impl::Update_Receiver esve::kernel::Wake_State_Handler esve::kernel::impl::Handler esve::message::Update_Receiver esve::kernel::impl::Handler esve::kernel::Handler esve::kernel::Handler List of all members.

Public Types

enum  Mapping {
  ROTATE_K_TOWARD_U, ROTATE_K_TOWARD_U_PERP, ROTATE_1_TOWARD_U, ROTATE_1_TOWARD_U_PERP,
  LEFT_HOPF_ROTATION, RIGHT_HOPF_ROTATION, NEG_LEFT_HOPF_ROTATION, NEG_RIGHT_HOPF_ROTATION,
  DOUBLE_ROTATE_1IJK, DOUBLE_ROTATE_1JKI, DOUBLE_ROTATE_1KIJ, DOUBLE_ROTATE_IJ1K,
  DO_NOTHING
}
 Mappings from 2D mouse input to 4D rotations. More...


Public Member Functions

 Rotation_Handler (engine::dim4::Transform &)
 Constructor. Give the transform on which this handler operates.

void stop ()
 Stop all motion.

void update (double dt)
 Receive the update() message.

types::real sensitivity () const
 Scalar multiplier for all motion.

void sensitivity (types::real)
 Scalar multiplier for all motion.

virtual Mapping mapping (Button) const
 The method to associate mouse drags with rotations.

virtual void mapping (Button, Mapping)
 The method to associate mouse drags with rotations.

void active_transform (Transform &)
 The transform on which this handler operates.

const Transform & active_transform () const
 The transform on which this handler operates.

const Transform & basis (Button) const
 The basis in which the motion is created, for this button. The basis is stored by reference.

void basis (Button, const Transform &basis)
 The basis in which the motion is created, for this button. The basis is stored by reference.


Protected Types

typedef components::dimn::Supermouse Supermouse
 

typedef components::dimn::Supermouse::Button Button
 


Protected Member Functions

bool handle_supermouse_push (Button, const Supermouse &)
 A supermouse button was pushed.

bool handle_supermouse_release (Button, const Supermouse &)
 A supermouse button was released.

bool handle_check_awake (bool currently_awake)
 Do you want to be awake?

virtual void normalize (impl_Transform &transform)
 Hook to normalize (or not) after a differential action.

const types::pureu () const
 Position.

const types::puredu_dt () const
 Velocity, units per second.

const types::puredu_dt (Button b) const
 Drag velocity with this button, units per second.

const types::pured2u_dt2 () const
 Acceleration, units per second^2.

const types::pured2u_dt2 (Button b) const
 Drag acceleration with this button, units per second^2.

bool handle_supermouse_move (const Supermouse &)
 The supermouse moved.

bool handle_wake ()
 The command to wake up.

bool handle_sleep ()
 The command to sleep.

bool awake () const
 Are we awake?

const Supermousesupermouse () const
 The current state of the supermouse.

void create_motion (Button, const types::pure &du_dt)
 Base class hook.

engine::dim4::impl::Transform differential_motion (Button button, types::real dt)
 Base class hook.

void stop_motion (Button)
 Base class hook.

bool has_motion (Button)
 Base class hook.


Detailed Description

Mappings from two-dimensional mouse input to four-dimensional rotations.


Member Enumeration Documentation

enum esve::components::dim4::Rotation_Handler::Mapping
 

Mappings from 2D mouse input to 4D rotations.

Let u represent the mouse drag, lying in the (i,j) plane.

In principle we could rotate any orthonormal pair (a,b), however since our input is only two-dimensional it is most natural to make a = 1 and b = u. Rotations of (1,u) and (1,u)-perp are more than enough to generate SO(4).

To rotate a general plane in four dimensions, one can provide a basis for the motion with the basis() method.

Enumeration values:
ROTATE_K_TOWARD_U  Rotate the (k,u) plane by angle abs(u). This is a 3D rotation with axis cross(k,u).
ROTATE_K_TOWARD_U_PERP  Rotate the (k,u)-perp plane by angle abs(u)
ROTATE_1_TOWARD_U  Rotate the (1,u) plane by angle abs(u).
ROTATE_1_TOWARD_U_PERP  Rotate the (1,u)-perp plane by angle abs(u). This is a 3D rotation with axis u.
LEFT_HOPF_ROTATION  Rotate the (1,u) plane by angle abs(u)/sqrt(2) and rotate the (1,u)-perp plane by angle abs(u)/sqrt(2). This is quaternion multiplication on the left.
RIGHT_HOPF_ROTATION  Rotate the (1,u) plane by angle abs(u)/sqrt(2) and rotate the (1,u)-perp plane by angle -abs(u)/sqrt(2). This is quaternion multiplication on the right.
NEG_LEFT_HOPF_ROTATION  Same as LEFT_HOPF_ROTATION but with motion angles in opposite direction.
NEG_RIGHT_HOPF_ROTATION  Same as RIGHT_HOPF_ROTATION but with motion angles in opposite direction
DOUBLE_ROTATE_1IJK  Torus double-rotation. The first plane is rotated by angle dot(i, u), the second is rotated by angle dot(j, u).
DOUBLE_ROTATE_1JKI  Torus double-rotation. The first plane is rotated by angle dot(i, u), the second is rotated by angle dot(j, u).
DOUBLE_ROTATE_1KIJ  Torus double-rotation. The first plane is rotated by angle dot(i, u), the second is rotated by angle dot(j, u).
DOUBLE_ROTATE_IJ1K  Torus double-rotation. The first plane is rotated by angle dot(i, u), the second is rotated by angle dot(j, u).
DO_NOTHING  Ignore mouse input.


Member Function Documentation

template<typename Transform, typename impl_Transform>
bool esve::components::dimn::Differential_Motion_Handler< Transform, impl_Transform >::handle_check_awake bool  currently_awake  )  [protected, virtual, inherited]
 

Do you want to be awake?

If currently awake, a return value of true indicates a desire to stay awake. If not currently awake, a return value of true indicates a desire to wake up.

Implements esve::kernel::Wake_State_Handler.

template<typename Transform, typename impl_Transform>
virtual void esve::components::dimn::Differential_Motion_Handler< Transform, impl_Transform >::normalize impl_Transform &  transform  )  [protected, virtual, inherited]
 

Hook to normalize (or not) after a differential action.

Default calls transform.normalize()


Generated on Tue May 30 11:40:54 2006 for esve by doxygen 1.3.4