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

osgSensor::OsgSensor Class Reference

Class for accessing a matrix from a 6Dof device. More...

#include <OsgSensor.h>

Inherited by osgSensor::KeyboardSensor, and osgSensor::TransformSensor.

List of all members.

Public Types

enum  MatrixPropagateFlag
 Specifies if matrix should be inverted or not when propagated.
enum  EnableFlag {
  EnableNone = 0, EnableTranslationX = 1, EnableTranslationY = 2, EnableTranslationZ = 4,
  EnableRotationX = 8, EnableRotationY = 16, EnableRotationZ = 32, EnableNegTranslationX = 64,
  EnableNegTranslationY = 128, EnableNegTranslationZ = 256, EnableRotation = EnableRotationX| EnableRotationY| EnableRotationZ, EnableTranslation = EnableTranslationX|EnableTranslationY|EnableTranslationZ,
  EnableAll = EnableTranslation | EnableRotation
}
 Specifies what is propagated from the sensor to the matrix. More...

Public Member Functions

const osg::Vec3 & getTranslation ()
 Reads data from the sensor and returns the position.
const osg::Quat & getRotation ()
 Read data from the sensor and returns the rotation part (quaternion).
const osg::Matrix & getMatrix ()
 Reads data from the sensor and returns the matrix.
void setScale (const osg::Vec3 &scale)
 Set the translation scale. By default (1,1,1).
const osg::Vec3 & getScale () const
 Return the translation scale.
void setMatrixPropagateFlag (MatrixPropagateFlag flag)
 Set matrix propagate flag (should matrix be inverted when propagated?).
MatrixPropagateFlag getMatrixPropagateFlag ()
 Get matrix propagate flag.
void setEnable (bool f)
 Specifies if this sensor will propagate any information or not (Same result as setPropagate(EnableNone) but it wont change the EnableFlag.
bool getEnable ()
 Reurns wether this sensor is enabled or not.
bool isPropagated (EnableFlag f)
 Is EnableFlag f set?
void setPropagate (EnableFlag f)
EnableFlag getPropagate ()
virtual bool handle (int key)
void setTranslationOffset (const osg::Vec3 &offset)
 Set offset for sensor in global coordinate system.
void setLocalTranslationOffset (const osg::Vec3 &offset)
 Set offset for sensor in local coordinate system.

Protected Member Functions

virtual ~OsgSensor ()
 Destructor.
virtual void sample ()
 Reads data from the sensor and updates all internal data.
void setTranslation (const osg::Vec3 &translation)
virtual const char * className ()
 Returns the name of this class.


Detailed Description

Class for accessing a matrix from a 6Dof device.


Member Enumeration Documentation

enum osgSensor::OsgSensor::EnableFlag
 

Specifies what is propagated from the sensor to the matrix.

Enumerator:
EnableNone  Nothing is propagated.
EnableTranslationX  Propagate translation in X.
EnableTranslationY  Propagate translation in Y.
EnableTranslationZ  Propagate translation in Z.
EnableRotationX  Propagate rotation in X (not in use).
EnableRotationY  Propagate rotation in Z (not in use).
EnableRotationZ  Propagate rotation in Z (not in use).
EnableNegTranslationX  Propagate negative translation in X.
EnableNegTranslationY  Propagate negative translation in Y.
EnableNegTranslationZ  Propagate negative translation in Z.
EnableRotation  Propagate rotation in x,y,z.
EnableTranslation  Enable translation in X, Y, Z.
EnableAll  Enable all DOF.


Member Function Documentation

EnableFlag osgSensor::OsgSensor::getPropagate  )  [inline]
 

Specifies what the sensor will propagate. Possibility to select what the sensor will return, position and/or orientation etc. See EnableFlag

virtual bool osgSensor::OsgSensor::handle int  key  )  [inline, virtual]
 

Take care of a keyboard event

Parameters:
key - Pressed key
Returns:
true if key is handled otherwise false

void osgSensor::OsgSensor::setPropagate EnableFlag  f  )  [inline]
 

Specifies what the sensor will propagate. Possibility to select what the sensor will return, position and/or orientation etc. See EnableFlag

void osgSensor::OsgSensor::setTranslation const osg::Vec3 &  translation  )  [protected]
 

Set the position of the sensor value. Will use Enable filter to only use the non filtered values from translation


The documentation for this class was generated from the following file:
Generated on Wed May 10 16:29:46 2006 for osgHaptics by  doxygen 1.4.4