OpenSceneGraph 3.6.5
UFOManipulator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGGA_UFO_MANIPULATOR_DEF
15#define OSGGA_UFO_MANIPULATOR_DEF 1
16
17#include <iostream>
18
20#include <osg/Node>
21#include <osg/Matrix>
22
53
54namespace osgGA {
55
57{
58
59 public:
62
66 virtual const char* className() const;
67
71 virtual void setByMatrix( const osg::Matrixd &matrix ) ;
72
76 virtual void setByInverseMatrix( const osg::Matrixd &invmat);
77
79 virtual osg::Matrixd getMatrix() const;
80
83
87 virtual void setNode(osg::Node* node);
88
90 virtual const osg::Node* getNode() const;
91
93 virtual osg::Node* getNode();
94
97 virtual void computeHomePosition();
98
101 void home(double);
102
103 virtual void init(const GUIEventAdapter& ,GUIActionAdapter&);
104
107
109 void getUsage(osg::ApplicationUsage& usage) const;
110
113
114
115 void setMinHeight( double in_min_height ) { _minHeightAboveGround = in_min_height; }
116 double getMinHeight() const { return _minHeightAboveGround; }
117
118 void setMinDistance( double in_min_dist ) { _minDistanceInFront = in_min_dist; }
119 double getMinDistance() const { return _minDistanceInFront; }
120
121 void setForwardSpeed( double in_fs ) { _forwardSpeed = in_fs; }
122 double getForwardSpeed() const { return _forwardSpeed; }
123
124 void setSideSpeed( double in_ss ) { _sideSpeed = in_ss; }
125 double getSideSpeed() const { return _sideSpeed; }
126
127 void setRotationSpeed( double in_rot_speed ) { _directionRotationRate = in_rot_speed; }
128 double getRotationSpeed() const { return _directionRotationRate; }
129
130
131 protected:
132
134
135 bool intersect(const osg::Vec3d& start, const osg::Vec3d& end, osg::Vec3d& intersection) const;
136
141
144
148 double _upSpeed;
151
153
158
164
165 double _t0;
166 double _dt;
169
170
171 bool _shift;
172 bool _ctrl;
174
176
177 void _stop();
181
183};
184
185}
186
187#endif
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
Definition ApplicationUsage:26
Definition Matrixd:27
Base class for all internal nodes in the scene graph.
Definition Node:72
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
CameraManipulator is an abstract base class defining the interface, and a certain amount of default f...
Definition CameraManipulator:40
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
double _viewOffsetDelta
Definition UFOManipulator:159
bool _decelerateOffsetRate
Definition UFOManipulator:173
double getRotationSpeed() const
Definition UFOManipulator:128
void home(double)
Move the camera to the default position.
void setForwardSpeed(double in_fs)
Definition UFOManipulator:121
virtual void computeHomePosition()
Computes the home position based on the extents and scale of the scene graph rooted at node.
double _speedEpsilon
Definition UFOManipulator:145
osg::observer_ptr< osg::Node > _node
Definition UFOManipulator:137
UFOManipulator()
Default constructor.
virtual const osg::Node * getNode() const
Get the root node of the subgraph this manipulator is driving the eye through (const)
virtual void setByMatrix(const osg::Matrixd &matrix)
Set the current position with a matrix.
osg::Matrixd _offset
Definition UFOManipulator:140
bool _ctrl
Definition UFOManipulator:172
double _directionRotationRate
Definition UFOManipulator:155
double _directionRotationEpsilon
Definition UFOManipulator:154
virtual void setByInverseMatrix(const osg::Matrixd &invmat)
Set the current position with the inverse matrix.
bool _shift
Definition UFOManipulator:171
virtual void home(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &)
Sets the viewpoint matrix to the home position.
void getCurrentPositionAsLookAt(osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up)
Report the current position as LookAt vectors.
osg::Matrixd _inverseMatrix
Definition UFOManipulator:139
double _directionRotationDeceleration
Definition UFOManipulator:157
double getMinHeight() const
Definition UFOManipulator:116
double _pitchOffset
Definition UFOManipulator:161
virtual osg::Node * getNode()
Get the root node of the subgraph this manipulator is driving the eye through.
double _t0
Definition UFOManipulator:165
double getMinDistance() const
Definition UFOManipulator:119
void _keyUp(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
double _yawOffsetRate
Definition UFOManipulator:162
double _dt
Definition UFOManipulator:166
void _frame(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
virtual osg::Matrixd getMatrix() const
Get the current viewmatrix.
double getForwardSpeed() const
Definition UFOManipulator:122
double _minDistanceInFront
Definition UFOManipulator:143
double _sideSpeed
Definition UFOManipulator:147
virtual void setNode(osg::Node *node)
Set the subgraph this manipulator is driving the eye through.
void setSideSpeed(double in_ss)
Definition UFOManipulator:124
void setMinHeight(double in_min_height)
Definition UFOManipulator:115
void getUsage(osg::ApplicationUsage &usage) const
Reports Usage parameters to the application.
osg::Vec3d _direction
Definition UFOManipulator:167
bool _straightenOffset
Definition UFOManipulator:175
virtual const char * className() const
return className
void _keyDown(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
double getSideSpeed() const
Definition UFOManipulator:125
osg::Vec3d _position
Definition UFOManipulator:168
double _pitchOffsetRate
Definition UFOManipulator:160
void setRotationSpeed(double in_rot_speed)
Definition UFOManipulator:127
void setMinDistance(double in_min_dist)
Definition UFOManipulator:118
double _speedDecelerationFactor
Definition UFOManipulator:150
double _speedAccelerationFactor
Definition UFOManipulator:149
bool intersect(const osg::Vec3d &start, const osg::Vec3d &end, osg::Vec3d &intersection) const
double _upSpeed
Definition UFOManipulator:148
double _yawOffset
Definition UFOManipulator:163
virtual void init(const GUIEventAdapter &, GUIActionAdapter &)
Start/restart the manipulator.
double _forwardSpeed
Definition UFOManipulator:146
double _directionRotationAcceleration
Definition UFOManipulator:156
double _minHeightAboveGround
Definition UFOManipulator:142
virtual osg::Matrixd getInverseMatrix() const
Get the current inverse view matrix.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Handles incoming osgGA events.
osg::Matrixd _matrix
Definition UFOManipulator:138
bool _decelerateUpSideRate
Definition UFOManipulator:152
#define OSGGA_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.