Candy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Candy::MouseHapticsDevice Class Reference

A mouse driven haptic device. More...

Inheritance diagram for Candy::MouseHapticsDevice:
Inheritance graph
[legend]

Classes

struct  Depth
 
class  Device
 

Public Member Functions

virtual void preRender ()
 
virtual void renderStylus ()
 

Public Attributes

std::auto_ptr< Depthdepth
  (input/output) The current depth, the z component, of the mouse position. More...
 
std::auto_ptr< H3D::SFBooluseZBuffer
  (input/output) If this field is set to True the z-buffer value at the mouse position will be used to update the current depth position. More...
 
std::auto_ptr< H3D::SFFloatzScale
  (input/output) The value of this field scales the up-down movement in pixels into depth movement in meters. More...
 
std::auto_ptr< H3D::SFRotationorientation
  (input/output) This field controls the orientation of the haptics device, since the mouse pointer only provides position. More...
 

Static Public Attributes

static H3D::H3DNodeDatabase database
 

Protected Attributes

struct CANDY_API Depth
 
Devicedevice
 
H3D::AutoRef< H3D::MouseSensormouse
 

Detailed Description

A mouse driven haptic device.

This device will follow the mouse pointer projected into the 3D world. The movements are interpolated in the haptics thread for stable and soft haptic simulation.

The left mouse button is not used since it is often used for rotating the scene or objects. The right button is mapped to the device's main button. The middle button is used to control the z-position of the device. Press down the button and dragg the mouse up or down to increase or decrease the depth, respectively.

The device can also use the z-buffer to control its z-position. In that case it will read off the front buffer. It will mask away the stylus around the mouse pointer to avoid it being drawn in the way, distrurbing the measure.

The depth position can also be controlled manually by setting or routing.

Member Data Documentation

std::auto_ptr< Depth > Candy::MouseHapticsDevice::depth

(input/output) The current depth, the z component, of the mouse position.

When useZBuffer is set to False, this value is controlled by middle-button-dragging the mouse up or down. When it is set to True, the value of the z-buffer at the mouse position will be used instead.

std::auto_ptr< H3D::SFRotation > Candy::MouseHapticsDevice::orientation

(input/output) This field controls the orientation of the haptics device, since the mouse pointer only provides position.

std::auto_ptr< H3D::SFBool > Candy::MouseHapticsDevice::useZBuffer

(input/output) If this field is set to True the z-buffer value at the mouse position will be used to update the current depth position.

std::auto_ptr< H3D::SFFloat > Candy::MouseHapticsDevice::zScale

(input/output) The value of this field scales the up-down movement in pixels into depth movement in meters.

Default value is 0.001, i.e. 1 mm per pixel.