OpenSceneGraph  3.0.1
Classes | Public Member Functions | Protected Member Functions | Protected Attributes
osgGA::CameraManipulator Class Reference

CameraManipulator is an abstract base class defining the interface, and a certain amount of default functionality, for classes which wish to control OSG cameras in response to GUI events. More...

Inheritance diagram for osgGA::CameraManipulator:
Inheritance graph
[legend]

List of all members.

Classes

class  CoordinateFrameCallback
 callback class to use to allow matrix manipulators to query the application for the local coordinate frame. More...

Public Member Functions

virtual const char * className () const
 return the name of the object's class type.
virtual void setCoordinateFrameCallback (CoordinateFrameCallback *cb)
 set the coordinate frame which callback tells the manipulator which way is up, east and north.
CoordinateFrameCallbackgetCoordinateFrameCallback ()
 get the coordinate frame callback which tells the manipulator which way is up, east and north.
const CoordinateFrameCallbackgetCoordinateFrameCallback () const
 get the coordinate frame callback which tells the manipulator which way is up, east and north.
osg::CoordinateFrame getCoordinateFrame (const osg::Vec3d &position) const
 get the coordinate frame.
osg::Vec3d getSideVector (const osg::CoordinateFrame &cf) const
osg::Vec3d getFrontVector (const osg::CoordinateFrame &cf) const
osg::Vec3d getUpVector (const osg::CoordinateFrame &cf) const
virtual void setByMatrix (const osg::Matrixd &matrix)=0
 set the position of the matrix manipulator using a 4x4 Matrix.
virtual void setByInverseMatrix (const osg::Matrixd &matrix)=0
 set the position of the matrix manipulator using a 4x4 Matrix.
virtual osg::Matrixd getMatrix () const =0
 get the position of the manipulator as 4x4 Matrix.
virtual osg::Matrixd getInverseMatrix () const =0
 get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.
virtual
osgUtil::SceneView::FusionDistanceMode 
getFusionDistanceMode () const
 Get the FusionDistanceMode.
virtual float getFusionDistanceValue () const
 Get the FusionDistanceValue.
void setIntersectTraversalMask (unsigned int mask)
 Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.
unsigned int getIntersectTraversalMask () const
 Get the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.
virtual void setNode (osg::Node *)
 Attach a node to the manipulator, automatically detaching any previously attached node.
virtual const osg::NodegetNode () const
 Return const node if attached.
virtual osg::NodegetNode ()
 Return node if attached.
virtual void setHomePosition (const osg::Vec3d &eye, const osg::Vec3d &center, const osg::Vec3d &up, bool autoComputeHomePosition=false)
 Manually set the home position, and set the automatic compute of home position.
virtual void getHomePosition (osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up) const
 Get the manually set home position.
virtual void setAutoComputeHomePosition (bool flag)
 Set whether the automatic compute of the home position is enabled.
bool getAutoComputeHomePosition () const
 Get whether the automatic compute of the home position is enabled.
virtual void computeHomePosition (const osg::Camera *camera=NULL, bool useBoundingBox=false)
 Compute the home position.
virtual void home (const GUIEventAdapter &, GUIActionAdapter &)
 Move the camera to the default position.
virtual void home (double)
 Move the camera to the default position.
virtual void init (const GUIEventAdapter &, GUIActionAdapter &)
 Start/restart the manipulator.
virtual bool handle (const GUIEventAdapter &ea, GUIActionAdapter &us)
 Handle events, return true if handled, false otherwise.

Protected Member Functions

 CameraManipulator ()
 CameraManipulator (const CameraManipulator &mm, const osg::CopyOp &copyOp=osg::CopyOp::SHALLOW_COPY)
virtual ~CameraManipulator ()
std::string getManipulatorName () const

Protected Attributes

unsigned int _intersectTraversalMask
bool _autoComputeHomePosition
osg::Vec3d _homeEye
osg::Vec3d _homeCenter
osg::Vec3d _homeUp
osg::ref_ptr
< CoordinateFrameCallback
_coordinateFrameCallback

Detailed Description

CameraManipulator is an abstract base class defining the interface, and a certain amount of default functionality, for classes which wish to control OSG cameras in response to GUI events.


Constructor & Destructor Documentation

osgGA::CameraManipulator::CameraManipulator ( ) [protected]
osgGA::CameraManipulator::CameraManipulator ( const CameraManipulator mm,
const osg::CopyOp copyOp = osg::CopyOp::SHALLOW_COPY 
) [protected]
virtual osgGA::CameraManipulator::~CameraManipulator ( ) [protected, virtual]

Member Function Documentation

virtual const char* osgGA::CameraManipulator::className ( ) const [inline, virtual]
virtual void osgGA::CameraManipulator::computeHomePosition ( const osg::Camera camera = NULL,
bool  useBoundingBox = false 
) [virtual]

Compute the home position.

bool osgGA::CameraManipulator::getAutoComputeHomePosition ( ) const [inline]

Get whether the automatic compute of the home position is enabled.

osg::CoordinateFrame osgGA::CameraManipulator::getCoordinateFrame ( const osg::Vec3d position) const [inline]

get the coordinate frame.

CoordinateFrameCallback* osgGA::CameraManipulator::getCoordinateFrameCallback ( ) [inline]

get the coordinate frame callback which tells the manipulator which way is up, east and north.

const CoordinateFrameCallback* osgGA::CameraManipulator::getCoordinateFrameCallback ( ) const [inline]

get the coordinate frame callback which tells the manipulator which way is up, east and north.

osg::Vec3d osgGA::CameraManipulator::getFrontVector ( const osg::CoordinateFrame cf) const [inline]
virtual osgUtil::SceneView::FusionDistanceMode osgGA::CameraManipulator::getFusionDistanceMode ( ) const [inline, virtual]

Get the FusionDistanceMode.

Used by SceneView for setting up stereo convergence.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::OrbitManipulator, and osgGA::SphericalManipulator.

virtual float osgGA::CameraManipulator::getFusionDistanceValue ( ) const [inline, virtual]

Get the FusionDistanceValue.

Used by SceneView for setting up stereo convergence.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::OrbitManipulator, and osgGA::SphericalManipulator.

virtual void osgGA::CameraManipulator::getHomePosition ( osg::Vec3d eye,
osg::Vec3d center,
osg::Vec3d up 
) const [inline, virtual]

Get the manually set home position.

unsigned int osgGA::CameraManipulator::getIntersectTraversalMask ( ) const [inline]

Get the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.

virtual osg::Matrixd osgGA::CameraManipulator::getInverseMatrix ( ) const [pure virtual]
std::string osgGA::CameraManipulator::getManipulatorName ( ) const [protected]
virtual osg::Matrixd osgGA::CameraManipulator::getMatrix ( ) const [pure virtual]
virtual const osg::Node* osgGA::CameraManipulator::getNode ( ) const [inline, virtual]
virtual osg::Node* osgGA::CameraManipulator::getNode ( ) [inline, virtual]
osg::Vec3d osgGA::CameraManipulator::getSideVector ( const osg::CoordinateFrame cf) const [inline]
osg::Vec3d osgGA::CameraManipulator::getUpVector ( const osg::CoordinateFrame cf) const [inline]
virtual bool osgGA::CameraManipulator::handle ( const GUIEventAdapter ea,
GUIActionAdapter us 
) [virtual]
virtual void osgGA::CameraManipulator::home ( const GUIEventAdapter ,
GUIActionAdapter  
) [inline, virtual]

Move the camera to the default position.

May be ignored by manipulators if home functionality is not appropriate.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::UFOManipulator, osgGA::AnimationPathManipulator, osgGA::StandardManipulator, osgGA::SphericalManipulator, osgGA::FirstPersonManipulator, osgGA::DriveManipulator, and osgGA::FlightManipulator.

virtual void osgGA::CameraManipulator::home ( double  ) [inline, virtual]

Move the camera to the default position.

This version does not require GUIEventAdapter and GUIActionAdapter so may be called from somewhere other than a handle() method in GUIEventHandler. Application must be aware of implications.

Reimplemented in osgGA::UFOManipulator, osgGA::AnimationPathManipulator, osgGA::StandardManipulator, osgGA::SphericalManipulator, and osgGA::FirstPersonManipulator.

virtual void osgGA::CameraManipulator::init ( const GUIEventAdapter ,
GUIActionAdapter  
) [inline, virtual]
virtual void osgGA::CameraManipulator::setAutoComputeHomePosition ( bool  flag) [inline, virtual]

Set whether the automatic compute of the home position is enabled.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

virtual void osgGA::CameraManipulator::setByInverseMatrix ( const osg::Matrixd matrix) [pure virtual]
virtual void osgGA::CameraManipulator::setByMatrix ( const osg::Matrixd matrix) [pure virtual]
virtual void osgGA::CameraManipulator::setCoordinateFrameCallback ( CoordinateFrameCallback cb) [inline, virtual]

set the coordinate frame which callback tells the manipulator which way is up, east and north.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

virtual void osgGA::CameraManipulator::setHomePosition ( const osg::Vec3d eye,
const osg::Vec3d center,
const osg::Vec3d up,
bool  autoComputeHomePosition = false 
) [inline, virtual]

Manually set the home position, and set the automatic compute of home position.

Reimplemented in osgGA::KeySwitchMatrixManipulator.

void osgGA::CameraManipulator::setIntersectTraversalMask ( unsigned int  mask) [inline]

Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection.

The intersection traversal mask is useful for controlling what parts of the scene graph should be used for intersection purposes.

virtual void osgGA::CameraManipulator::setNode ( osg::Node ) [inline, virtual]

Attach a node to the manipulator, automatically detaching any previously attached node.

setNode(NULL) detaches previous nodes. May be ignored by manipulators which do not require a reference model.

Reimplemented in osgGA::KeySwitchMatrixManipulator, osgGA::UFOManipulator, osgGA::NodeTrackerManipulator, osgGA::StandardManipulator, osgGA::SphericalManipulator, osgGA::DriveManipulator, osgGA::TerrainManipulator, and osgGA::CameraViewSwitchManipulator.


Member Data Documentation


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

osg logo
Generated at Mon Oct 3 2011 12:39:47 for the OpenSceneGraph by doxygen 1.7.5.