OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgGA::UFOManipulator Class Reference

A UFO manipulator driven with keybindings. More...

#include <UFOManipulator.h>

Inheritance diagram for osgGA::UFOManipulator:
Inheritance graph
[legend]
Collaboration diagram for osgGA::UFOManipulator:
Collaboration graph
[legend]

Public Member Functions

 UFOManipulator ()
 
virtual const char * className () const
 
virtual void setByMatrix (const osg::Matrixd &matrix)
 
virtual void setByInverseMatrix (const osg::Matrixd &invmat)
 
virtual osg::Matrixd getMatrix () const
 
virtual osg::Matrixd getInverseMatrix () const
 
virtual void setNode (osg::Node *node)
 
virtual const osg::NodegetNode () const
 
virtual osg::NodegetNode ()
 
virtual void computeHomePosition ()
 
virtual void home (const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &)
 
void home (double)
 
virtual void init (const GUIEventAdapter &, GUIActionAdapter &)
 
bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
 
void getUsage (osg::ApplicationUsage &usage) const
 
void getCurrentPositionAsLookAt (osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up)
 
void setMinHeight (double in_min_height)
 
double getMinHeight () const
 
void setMinDistance (double in_min_dist)
 
double getMinDistance () const
 
void setForwardSpeed (double in_fs)
 
double getForwardSpeed () const
 
void setSideSpeed (double in_ss)
 
double getSideSpeed () const
 
void setRotationSpeed (double in_rot_speed)
 
double getRotationSpeed () const
 
- Public Member Functions inherited from osgGA::CameraManipulator
virtual void setCoordinateFrameCallback (CoordinateFrameCallback *cb)
 
CoordinateFrameCallbackgetCoordinateFrameCallback ()
 
const CoordinateFrameCallbackgetCoordinateFrameCallback () const
 
osg::CoordinateFrame getCoordinateFrame (const osg::Vec3d &position) const
 
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 updateCamera (osg::Camera &camera)
 
virtual
osgUtil::SceneView::FusionDistanceMode 
getFusionDistanceMode () const
 
virtual float getFusionDistanceValue () const
 
void setIntersectTraversalMask (unsigned int mask)
 
unsigned int getIntersectTraversalMask () const
 
virtual void setHomePosition (const osg::Vec3d &eye, const osg::Vec3d &center, const osg::Vec3d &up, bool autoComputeHomePosition=false)
 
virtual void getHomePosition (osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up) const
 
virtual void setAutoComputeHomePosition (bool flag)
 
bool getAutoComputeHomePosition () const
 
virtual void computeHomePosition (const osg::Camera *camera=NULL, bool useBoundingBox=false)
 
virtual void finishAnimation ()
 
virtual bool handle (osgGA::Event *event, osg::Object *object, osg::NodeVisitor *nv)
 
- Public Member Functions inherited from osgGA::GUIEventHandler
 GUIEventHandler ()
 
 GUIEventHandler (const GUIEventHandler &eh, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
 META_Object (osgGA, GUIEventHandler)
 
virtual bool handle (const GUIEventAdapter &ea, GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
 
- Public Member Functions inherited from osgGA::EventHandler
 EventHandler ()
 
 EventHandler (const EventHandler &eh, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
 META_Object (osgGA, EventHandler)
 
virtual bool run (osg::Object *object, osg::Object *data)
 
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 
virtual void event (osg::NodeVisitor *nv, osg::Drawable *drawable)
 
- Public Member Functions inherited from osg::NodeCallback
 NodeCallback ()
 
 NodeCallback (const NodeCallback &nc, const CopyOp &copyop)
 
 META_Object (osg, NodeCallback)
 
- Public Member Functions inherited from osg::Callback
 Callback ()
 
 Callback (const Callback &cb, const CopyOp &copyop)
 
 META_Object (osg, Callback)
 
bool traverse (osg::Object *object, osg::Object *data)
 
void setNestedCallback (osg::Callback *cb)
 
osg::CallbackgetNestedCallback ()
 
const osg::CallbackgetNestedCallback () const
 
void addNestedCallback (osg::Callback *nc)
 
void removeNestedCallback (osg::Callback *nc)
 
- Public Member Functions inherited from osg::Object
 Object ()
 
 Object (bool threadSafeRefUnref)
 
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
virtual ObjectcloneType () const =0
 
virtual Objectclone (const CopyOp &) const =0
 
virtual bool isSameKindAs (const Object *) const
 
virtual const char * libraryName () const =0
 
std::string getCompoundClassName () const
 
virtual NodeasNode ()
 
virtual const NodeasNode () const
 
virtual NodeVisitorasNodeVisitor ()
 
virtual const NodeVisitorasNodeVisitor () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () const
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
virtual void setName (const std::string &name)
 
void setName (const char *name)
 
const std::string & getName () const
 
void setDataVariance (DataVariance dv)
 
DataVariance getDataVariance () const
 
virtual void computeDataVariance ()
 
void setUserDataContainer (osg::UserDataContainer *udc)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () const
 
template<typename T >
bool getUserValue (const std::string &name, T &value) const
 
template<typename T >
void setUserValue (const std::string &name, const T &value)
 
virtual void resizeGLObjectBuffers (unsigned int)
 
virtual void releaseGLObjects (osg::State *=0) const
 
template<typename T >
BoolValueObject
UCharValueObject
UShortValueObject
UIntValueObject
DoubleValueObject
Vec3fValueObject
Vec2dValueObject
Vec4dValueObject
PlaneValueObject
MatrixdValueObject
BoundingBoxdValueObject
BoundingSpheredValueObject
bool 
getUserValue (const std::string &name, T &value) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 
- Public Member Functions inherited from osg::Drawable::EventCallback
 EventCallback ()
 
 EventCallback (const EventCallback &, const CopyOp &)
 
 META_Object (osg, EventCallback)
 

Protected Member Functions

virtual ~UFOManipulator ()
 
bool intersect (const osg::Vec3d &start, const osg::Vec3d &end, osg::Vec3d &intersection) const
 
void _stop ()
 
void _keyDown (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
 
void _keyUp (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
 
void _frame (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
 
void _adjustPosition ()
 
- Protected Member Functions inherited from osgGA::CameraManipulator
 CameraManipulator ()
 
 CameraManipulator (const CameraManipulator &mm, const osg::CopyOp &copyOp=osg::CopyOp::SHALLOW_COPY)
 
virtual ~CameraManipulator ()
 
std::string getManipulatorName () const
 
- Protected Member Functions inherited from osgGA::GUIEventHandler
virtual ~GUIEventHandler ()
 
- Protected Member Functions inherited from osg::NodeCallback
virtual ~NodeCallback ()
 
- Protected Member Functions inherited from osg::Callback
virtual ~Callback ()
 
- Protected Member Functions inherited from osg::Object
virtual ~Object ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

osg::observer_ptr< osg::Node_node
 
float _viewAngle
 
osg::Matrixd _matrix
 
osg::Matrixd _inverseMatrix
 
osg::Matrixd _offset
 
double _minHeightAboveGround
 
double _minDistanceInFront
 
double _speedEpsilon
 
double _forwardSpeed
 
double _sideSpeed
 
double _upSpeed
 
double _speedAccelerationFactor
 
double _speedDecelerationFactor
 
bool _decelerateUpSideRate
 
double _directionRotationEpsilon
 
double _directionRotationRate
 
double _directionRotationAcceleration
 
double _directionRotationDeceleration
 
double _viewOffsetDelta
 
double _pitchOffsetRate
 
double _pitchOffset
 
double _yawOffsetRate
 
double _yawOffset
 
double _t0
 
double _dt
 
osg::Vec3d _direction
 
osg::Vec3d _position
 
bool _shift
 
bool _ctrl
 
bool _decelerateOffsetRate
 
bool _straightenOffset
 
- Protected Attributes inherited from osgGA::CameraManipulator
unsigned int _intersectTraversalMask
 
bool _autoComputeHomePosition
 
osg::Vec3d _homeEye
 
osg::Vec3d _homeCenter
 
osg::Vec3d _homeUp
 
osg::ref_ptr
< CoordinateFrameCallback
_coordinateFrameCallback
 
- Protected Attributes inherited from osg::Callback
ref_ptr< Callback_nestedCallback
 
- Protected Attributes inherited from osg::Object
std::string _name
 
DataVariance _dataVariance
 
osg::UserDataContainer_userDataContainer
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Public Types inherited from osg::Object
enum  DataVariance { DYNAMIC, STATIC, UNSPECIFIED }
 
- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

A UFO manipulator driven with keybindings.

The UFOManipulator is better suited for applications that employ architectural walk-throughs, or situations where the eyepoint motion model must move slowly, deliberately and well controlled.

The UFO Manipulator allows the following movements with the listed Key combinations:

Parameters
UpArrowAcceleration forward.
DownArrowAcceleration backward (or deceleration forward).
LeftArrowRotate view and direction of travel to the left.
RightArrowRotate view and direction of travel to the right.
SpaceBarBrake. Gradually decelerates linear and rotational movement.
Shift/UpArrowAccelerate up.
Shift/DownArrowAccelerate down.
Shift/LeftArrowAccelerate (linearly) left.
Shift/RightArrowAccelerate (linearly) right.
Shift/SpaceBarInstant brake. Immediately stop all linear and rotational movement.

When the Shift key is released, up, down, linear left and/or linear right movement is decelerated.

\param Ctrl/UpArrow     Rotate view (but not direction of travel) up.
\param Ctrl/DownArrow   Rotate view (but not direction of travel) down.
\param Ctrl/LeftArrow   Rotate view (but not direction of travel) left.
\param Ctrl/RightArrow  Rotate view (but not direction of travel) right.
\param Ctrl/Return      Straightens out the view offset.

Definition at line 56 of file UFOManipulator.h.

Constructor & Destructor Documentation

osgGA::UFOManipulator::UFOManipulator ( )

Default constructor

virtual osgGA::UFOManipulator::~UFOManipulator ( )
protectedvirtual

Member Function Documentation

void osgGA::UFOManipulator::_adjustPosition ( )
protected
void osgGA::UFOManipulator::_frame ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter  
)
protected
void osgGA::UFOManipulator::_keyDown ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter  
)
protected
void osgGA::UFOManipulator::_keyUp ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter  
)
protected
void osgGA::UFOManipulator::_stop ( )
protected
virtual const char* osgGA::UFOManipulator::className ( ) const
virtual

return className

Returns
returns constant "UFO"

Reimplemented from osgGA::CameraManipulator.

virtual void osgGA::UFOManipulator::computeHomePosition ( )
virtual

Computes the home position based on the extents and scale of the scene graph rooted at node

void osgGA::UFOManipulator::getCurrentPositionAsLookAt ( osg::Vec3d eye,
osg::Vec3d center,
osg::Vec3d up 
)

Report the current position as LookAt vectors

double osgGA::UFOManipulator::getForwardSpeed ( ) const
inline

Definition at line 122 of file UFOManipulator.h.

virtual osg::Matrixd osgGA::UFOManipulator::getInverseMatrix ( ) const
virtual

Get the current inverse view matrix

Implements osgGA::CameraManipulator.

virtual osg::Matrixd osgGA::UFOManipulator::getMatrix ( ) const
virtual

Get the current viewmatrix

Implements osgGA::CameraManipulator.

double osgGA::UFOManipulator::getMinDistance ( ) const
inline

Definition at line 119 of file UFOManipulator.h.

double osgGA::UFOManipulator::getMinHeight ( ) const
inline

Definition at line 116 of file UFOManipulator.h.

virtual const osg::Node* osgGA::UFOManipulator::getNode ( ) const
virtual

Get the root node of the subgraph this manipulator is driving the eye through (const)

Reimplemented from osgGA::CameraManipulator.

virtual osg::Node* osgGA::UFOManipulator::getNode ( )
virtual

Get the root node of the subgraph this manipulator is driving the eye through

Reimplemented from osgGA::CameraManipulator.

double osgGA::UFOManipulator::getRotationSpeed ( ) const
inline

Definition at line 128 of file UFOManipulator.h.

double osgGA::UFOManipulator::getSideSpeed ( ) const
inline

Definition at line 125 of file UFOManipulator.h.

void osgGA::UFOManipulator::getUsage ( osg::ApplicationUsage usage) const
virtual

Reports Usage parameters to the application

Reimplemented from osgGA::EventHandler.

bool osgGA::UFOManipulator::handle ( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter aa 
)
virtual

Handles incoming osgGA events

Reimplemented from osgGA::CameraManipulator.

virtual void osgGA::UFOManipulator::home ( const osgGA::GUIEventAdapter ,
osgGA::GUIActionAdapter  
)
virtual

Sets the viewpoint matrix to the home position

Reimplemented from osgGA::CameraManipulator.

void osgGA::UFOManipulator::home ( double  )
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 from osgGA::CameraManipulator.

virtual void osgGA::UFOManipulator::init ( const GUIEventAdapter ,
GUIActionAdapter  
)
virtual

Start/restart the manipulator. FIXME: what does this actually mean? Provide examples.

Reimplemented from osgGA::CameraManipulator.

bool osgGA::UFOManipulator::intersect ( const osg::Vec3d start,
const osg::Vec3d end,
osg::Vec3d intersection 
) const
protected
virtual void osgGA::UFOManipulator::setByInverseMatrix ( const osg::Matrixd invmat)
virtual

Set the current position with the inverse matrix

Parameters
invmatThe inverse of a viewpoint matrix

Implements osgGA::CameraManipulator.

virtual void osgGA::UFOManipulator::setByMatrix ( const osg::Matrixd matrix)
virtual

Set the current position with a matrix

Parameters
matrixA viewpoint matrix.

Implements osgGA::CameraManipulator.

void osgGA::UFOManipulator::setForwardSpeed ( double  in_fs)
inline

Definition at line 121 of file UFOManipulator.h.

void osgGA::UFOManipulator::setMinDistance ( double  in_min_dist)
inline

Definition at line 118 of file UFOManipulator.h.

void osgGA::UFOManipulator::setMinHeight ( double  in_min_height)
inline

Definition at line 115 of file UFOManipulator.h.

virtual void osgGA::UFOManipulator::setNode ( osg::Node node)
virtual

Set the subgraph this manipulator is driving the eye through.

Parameters
noderoot of subgraph

Reimplemented from osgGA::CameraManipulator.

void osgGA::UFOManipulator::setRotationSpeed ( double  in_rot_speed)
inline

Definition at line 127 of file UFOManipulator.h.

void osgGA::UFOManipulator::setSideSpeed ( double  in_ss)
inline

Definition at line 124 of file UFOManipulator.h.

Member Data Documentation

bool osgGA::UFOManipulator::_ctrl
protected

Definition at line 173 of file UFOManipulator.h.

bool osgGA::UFOManipulator::_decelerateOffsetRate
protected

Definition at line 174 of file UFOManipulator.h.

bool osgGA::UFOManipulator::_decelerateUpSideRate
protected

Definition at line 153 of file UFOManipulator.h.

osg::Vec3d osgGA::UFOManipulator::_direction
protected

Definition at line 168 of file UFOManipulator.h.

double osgGA::UFOManipulator::_directionRotationAcceleration
protected

Definition at line 157 of file UFOManipulator.h.

double osgGA::UFOManipulator::_directionRotationDeceleration
protected

Definition at line 158 of file UFOManipulator.h.

double osgGA::UFOManipulator::_directionRotationEpsilon
protected

Definition at line 155 of file UFOManipulator.h.

double osgGA::UFOManipulator::_directionRotationRate
protected

Definition at line 156 of file UFOManipulator.h.

double osgGA::UFOManipulator::_dt
protected

Definition at line 167 of file UFOManipulator.h.

double osgGA::UFOManipulator::_forwardSpeed
protected

Definition at line 147 of file UFOManipulator.h.

osg::Matrixd osgGA::UFOManipulator::_inverseMatrix
protected

Definition at line 140 of file UFOManipulator.h.

osg::Matrixd osgGA::UFOManipulator::_matrix
protected

Definition at line 139 of file UFOManipulator.h.

double osgGA::UFOManipulator::_minDistanceInFront
protected

Definition at line 144 of file UFOManipulator.h.

double osgGA::UFOManipulator::_minHeightAboveGround
protected

Definition at line 143 of file UFOManipulator.h.

osg::observer_ptr<osg::Node> osgGA::UFOManipulator::_node
protected

Definition at line 137 of file UFOManipulator.h.

osg::Matrixd osgGA::UFOManipulator::_offset
protected

Definition at line 141 of file UFOManipulator.h.

double osgGA::UFOManipulator::_pitchOffset
protected

Definition at line 162 of file UFOManipulator.h.

double osgGA::UFOManipulator::_pitchOffsetRate
protected

Definition at line 161 of file UFOManipulator.h.

osg::Vec3d osgGA::UFOManipulator::_position
protected

Definition at line 169 of file UFOManipulator.h.

bool osgGA::UFOManipulator::_shift
protected

Definition at line 172 of file UFOManipulator.h.

double osgGA::UFOManipulator::_sideSpeed
protected

Definition at line 148 of file UFOManipulator.h.

double osgGA::UFOManipulator::_speedAccelerationFactor
protected

Definition at line 150 of file UFOManipulator.h.

double osgGA::UFOManipulator::_speedDecelerationFactor
protected

Definition at line 151 of file UFOManipulator.h.

double osgGA::UFOManipulator::_speedEpsilon
protected

Definition at line 146 of file UFOManipulator.h.

bool osgGA::UFOManipulator::_straightenOffset
protected

Definition at line 176 of file UFOManipulator.h.

double osgGA::UFOManipulator::_t0
protected

Definition at line 166 of file UFOManipulator.h.

double osgGA::UFOManipulator::_upSpeed
protected

Definition at line 149 of file UFOManipulator.h.

float osgGA::UFOManipulator::_viewAngle
protected

Definition at line 138 of file UFOManipulator.h.

double osgGA::UFOManipulator::_viewOffsetDelta
protected

Definition at line 160 of file UFOManipulator.h.

double osgGA::UFOManipulator::_yawOffset
protected

Definition at line 164 of file UFOManipulator.h.

double osgGA::UFOManipulator::_yawOffsetRate
protected

Definition at line 163 of file UFOManipulator.h.


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