#include <OSGFlyNavigator.h>
Inheritance diagram for osg::FlyNavigator:

Public Member Functions | |
Constructors | |
| * | FlyNavigator () |
Destructors | |
| *virtual | ~FlyNavigator () |
Get | |
| *Matrix & | getMatrix (void) |
| Pnt3f & | getFrom (void) |
| Pnt3f & | getAt (void) |
| Vec3f & | getUp (void) |
Set | |
| *void | setFrom (Pnt3f new_from) |
| void | setAt (Pnt3f new_at) |
| void | setUp (Vec3f new_up) |
| void | set (Pnt3f new_from, Pnt3f new_at, Vec3f new_up) |
| void | set (Matrix new_matrix) |
Flyer Transformations | |
| *void | rotate (Real32 deltaX, Real32 deltaY) |
| Real32 | forward (Real32 step) |
| Real32 | right (Real32 step) |
Protected Attributes | |
Members | |
| *Pnt3f | _rFrom |
| Pnt3f | _rAt |
| Vec3f | _vUp |
| Matrix | _tMatrix |
Definition at line 55 of file OSGFlyNavigator.h.
|
|
Definition at line 83 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, _tMatrix, _vUp, osg::TransformationMatrix< ValueTypeT >::setIdentity(), and osg::VecStorage3< ValueTypeT >::setValues(). 00084 { 00085 _rFrom .setValues(0,0,0); 00086 _rAt .setValues(0,0,1); 00087 _vUp .setValues(0,1,0); 00088 _tMatrix.setIdentity(); 00089 }
|
|
|
Definition at line 94 of file OSGFlyNavigator.cpp.
|
|
|
Get the current transformation matrix. Definition at line 102 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, _tMatrix, _vUp, and osg::MatrixLookAt(). Referenced by osg::Navigator::getMatrix().
|
|
|
Get the from point. Definition at line 110 of file OSGFlyNavigator.cpp. References _rFrom. Referenced by osg::Navigator::getFrom(). 00111 { 00112 return _rFrom; 00113 }
|
|
|
Get the at point. Definition at line 117 of file OSGFlyNavigator.cpp. References _rAt. Referenced by osg::Navigator::getAt(). 00118 { 00119 return _rAt; 00120 }
|
|
|
Get the up vector. Definition at line 124 of file OSGFlyNavigator.cpp. References _vUp. Referenced by osg::Navigator::getUp(). 00125 { 00126 return _vUp; 00127 }
|
|
|
Set the from point, the point where the viewer is (i.e the center of all transformations). Definition at line 135 of file OSGFlyNavigator.cpp. References _rFrom. Referenced by osg::Navigator::setFrom(). 00136 { 00137 _rFrom=new_from; 00138 }
|
|
|
Sets the target point at which the viewer is looking. Definition at line 142 of file OSGFlyNavigator.cpp. References _rAt. Referenced by osg::Navigator::setAt(). 00143 { 00144 _rAt=new_At; 00145 }
|
|
|
Sets the up vector, i.e. the direction that point up on the screen. Definition at line 149 of file OSGFlyNavigator.cpp. References _vUp. Referenced by osg::Navigator::setUp(). 00150 { 00151 _vUp=new_up; 00152 }
|
|
||||||||||||||||
|
Set the position and the orientation at once. Definition at line 156 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, and _vUp. Referenced by osg::Navigator::set(), and set().
|
|
|
Set the position and the orientation at once using a matrix. Definition at line 165 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, _vUp, and set(). 00166 { 00167 _rFrom= (Pnt3f) new_matrix[3]; 00168 _rAt = (Pnt3f)(new_matrix[3] - new_matrix[2]); 00169 _vUp = (Vec3f) new_matrix[1]; 00170 set(_rFrom, _rAt, _vUp); 00171 }
|
|
||||||||||||
|
Rotate the viewer deltaX around the up axis and deltaY around the left/right axis. deltaX and deltaY should be between -Pi and Pi. Reimplemented in osg::WalkNavigator. Definition at line 178 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, _vUp, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::crossThis(), osg::QuaternionBase< ValueTypeT >::getValue(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::TransformationMatrix< ValueTypeT >::setIdentity(), osg::TransformationMatrix< ValueTypeT >::setTranslate(), and osg::QuaternionBase< ValueTypeT >::setValueAsAxisRad(). Referenced by osg::Navigator::keyPress(), osg::Navigator::moveTo(), and osg::WalkNavigator::rotate(). 00179 { 00180 // rotate around the up vector 00181 Matrix final,temp; 00182 Quaternion q; 00183 00184 q.setValueAsAxisRad(_vUp,-deltaX); 00185 q.getValue(temp); 00186 00187 final.setIdentity(); 00188 final.setTranslate(_rFrom); 00189 final.mult(temp); 00190 00191 temp.setIdentity(); 00192 temp.setTranslate(-_rFrom[0],-_rFrom[1],-_rFrom[2]); 00193 00194 final.mult(temp); 00195 final.multMatrixPnt(_rAt); 00196 00197 // rotate around the side vector 00198 Vec3f lv = _rAt-_rFrom; 00199 lv.normalize(); 00200 00201 Vec3f sv = lv; 00202 sv.crossThis(_vUp); 00203 sv.normalize(); 00204 q.setValueAsAxisRad(sv,-deltaY); 00205 q.getValue(temp); 00206 00207 final.setIdentity(); 00208 final.setTranslate(_rFrom); 00209 final.mult(temp); 00210 00211 temp.setIdentity(); 00212 temp.setTranslate(-_rFrom[0],-_rFrom[1],-_rFrom[2]); 00213 00214 final.mult(temp); 00215 final.multMatrixPnt(_rAt); 00216 }
|
|
|
Flies forward, i.e. translation step units along the view vector. Reimplemented in osg::WalkNavigator. Definition at line 220 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, osg::TransformationMatrix< ValueTypeT >::multMatrixPnt(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::TransformationMatrix< ValueTypeT >::setIdentity(), and osg::TransformationMatrix< ValueTypeT >::setTranslate(). Referenced by osg::Navigator::buttonPress(), osg::Navigator::keyPress(), osg::Navigator::moveTo(), and osg::Navigator::setDistance(). 00221 { 00222 Vec3f lv; 00223 lv = _rFrom-_rAt; 00224 lv.normalize(); 00225 lv *= (step); 00226 Matrix transl; 00227 transl.setIdentity(); 00228 transl.setTranslate(lv); 00229 transl.multMatrixPnt(_rAt); 00230 transl.multMatrixPnt(_rFrom); 00231 return 0.0; 00232 }
|
|
|
Strafes to the right, i.e. translates along the side vector. Reimplemented in osg::WalkNavigator. Definition at line 236 of file OSGFlyNavigator.cpp. References _rAt, _rFrom, _vUp, osg::VectorInterface< ValueTypeT, StorageInterfaceT >::crossThis(), osg::TransformationMatrix< ValueTypeT >::multMatrixPnt(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize(), osg::TransformationMatrix< ValueTypeT >::setIdentity(), and osg::TransformationMatrix< ValueTypeT >::setTranslate(). Referenced by osg::Navigator::keyPress(). 00237 { 00238 Vec3f sv; 00239 sv = _rFrom-_rAt; 00240 sv.crossThis(_vUp); 00241 sv.normalize(); 00242 sv *= (step); 00243 Matrix transl; 00244 transl.setIdentity(); 00245 transl.setTranslate(sv); 00246 transl.multMatrixPnt(_rAt); 00247 transl.multMatrixPnt(_rFrom); 00248 return 0.0; 00249 }
|
|
|
The from point, i.e. the viewer position. Referenced by FlyNavigator(), osg::WalkNavigator::forward(), forward(), getFrom(), getMatrix(), osg::WalkNavigator::right(), right(), rotate(), set(), and setFrom(). |
|
|
The at point, i.e. the target position. Referenced by FlyNavigator(), osg::WalkNavigator::forward(), forward(), getAt(), getMatrix(), osg::WalkNavigator::right(), right(), rotate(), set(), and setAt(). |
|
|
The up vector. Referenced by FlyNavigator(), osg::WalkNavigator::forward(), getMatrix(), getUp(), osg::WalkNavigator::right(), right(), rotate(), set(), and setUp(). |
|
|
The transformation matrix for this navigator. Referenced by FlyNavigator(), and getMatrix(). |
1.4.3