00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <OSGConfig.h>
00040 #include <OSGBaseTypes.h>
00041 #include <OSGMatrix.h>
00042 #include <OSGMatrixUtility.h>
00043 #include <OSGNodePtr.h>
00044 #include <OSGCamera.h>
00045 #include <OSGTransform.h>
00046
00047 #include "OSGNavigator.h"
00048
00049 OSG_USING_NAMESPACE
00050
00051
00052
00053
00054
00152
00153
00154 Navigator::Navigator():
00155 _rRotationAngle(0.04908739f),
00156 _rMotionFactor(1.f),
00157 _currentState(IDLE),
00158 _currentMode(TRACKBALL),
00159 _absolute(true),
00160 _vp(NullFC),
00161 _cartN(NullFC),
00162 _moved(false),
00163 _clickCenter(true),
00164 _clickNoIntersect(false),
00165 _lastX(0),
00166 _lastY(0),
00167 _ip(0,0,0)
00168 {
00169 }
00170
00171
00172
00173 Navigator::~Navigator()
00174 {
00175 }
00176
00177
00178
00181 void Navigator::buttonPress(Int16 button, Int16 x, Int16 y)
00182 {
00183 _lastX = x; _lastY = y;
00184 _moved = false;
00185
00186 switch (_currentMode)
00187 {
00188 case NONE:
00189 _currentState = IDLE;
00190 break;
00191
00192 case TRACKBALL:
00193
00194 switch (button)
00195 {
00196 case LEFT_MOUSE : _currentState = ROTATING;
00197 break;
00198
00199 case RIGHT_MOUSE : _currentState = TRANSLATING_Z;
00200 break;
00201
00202 case MIDDLE_MOUSE: _currentState = TRANSLATING_XY;
00203 getIntersectionPoint(x,y);
00204 break;
00205
00206 case UP_MOUSE : _currentState = IDLE;
00207 _trackball.translateZ(-_rMotionFactor);
00208 break;
00209
00210 case DOWN_MOUSE : _currentState = IDLE;
00211 _trackball.translateZ(_rMotionFactor);
00212 break;
00213
00214 default: FNOTICE(("Navigator: buttonPress, unknown button\n"));
00215 break;
00216 }
00217 break;
00218
00219 case FLY:
00220
00221 switch (button)
00222 {
00223 case LEFT_MOUSE : _currentState = TRANSLATING_ZPLUS;
00224 break;
00225
00226 case MIDDLE_MOUSE: _currentState = ROTATING;
00227 break;
00228
00229 case RIGHT_MOUSE : _currentState = TRANSLATING_ZMINUS;
00230 break;
00231
00232 case UP_MOUSE : _currentState = IDLE;
00233 _flyer.forward(-_rMotionFactor);
00234 break;
00235
00236 case DOWN_MOUSE : _currentState = IDLE;
00237 _flyer.forward(_rMotionFactor);
00238 break;
00239
00240 default: FNOTICE(("Navigator: buttonPress, unknown button\n"));
00241 break;
00242 }
00243 break;
00244
00245 case WALK:
00246
00247 switch (button)
00248 {
00249 case LEFT_MOUSE : _currentState = TRANSLATING_ZPLUS;
00250 break;
00251
00252 case MIDDLE_MOUSE: _currentState = ROTATING;
00253 break;
00254
00255 case RIGHT_MOUSE : _currentState = TRANSLATING_ZMINUS;
00256 break;
00257
00258 case UP_MOUSE : _currentState = IDLE;
00259 _walker.forward(-_rMotionFactor);
00260 break;
00261
00262 case DOWN_MOUSE : _currentState = IDLE;
00263 _walker.forward(_rMotionFactor);
00264 break;
00265
00266 default: FNOTICE(("Navigator: buttonPress, unknown button\n"));
00267 break;
00268 }
00269 break;
00270
00271 default:
00272
00273 FNOTICE(("Navigator: buttonPress, unknown mode\n"));
00274 break;
00275 }
00276 }
00277
00280 void Navigator::buttonRelease(Int16 , Int16 x, Int16 y)
00281 {
00282 switch (_currentMode)
00283 {
00284 case NONE: break;
00285
00286 case TRACKBALL: if (!_moved && _clickCenter)
00287 {
00288 IntersectAction * act = IntersectAction::create();
00289 Line line;
00290 _vp->getCamera()->calcViewRay(line, x, y, *_vp);
00291
00292 Pnt3f lp1 = line.getPosition();
00293 Vec3f ld1 = line.getDirection();
00294
00295 act->setLine(line);
00296 act->apply(_vp->getRoot());
00297 if (act->didHit())
00298 {
00299 Pnt3f p1 = act->getHitPoint();
00300 _trackball.setAt(p1);
00301 }
00302
00303 delete act;
00304 }
00305 break;
00306
00307 case FLY: break;
00308 case WALK: break;
00309
00310 default: FNOTICE(("Navigator: buttonRelease, unknown mode\n"));
00311 break;
00312 }
00313 _currentState=IDLE;
00314 }
00315
00318 void Navigator::keyPress(Int16 key, Int16 , Int16 )
00319 {
00320 switch (_currentMode)
00321 {
00322 case NONE:
00323 break;
00324
00325 case TRACKBALL:
00326
00327 switch (key)
00328 {
00329 case LEFT : break;
00330 case RIGHT : break;
00331 case FORWARDS : _trackball.translateZ(-_rMotionFactor); break;
00332 case BACKWARDS : _trackball.translateZ(_rMotionFactor); break;
00333 default : FNOTICE(("Navigator: keyPress, unknown key\n"));
00334 }
00335 break;
00336
00337 case FLY:
00338
00339 switch (key)
00340 {
00341 case LEFTROT : _flyer.rotate(-_rRotationAngle, 0); break;
00342 case RIGHTROT : _flyer.rotate( _rRotationAngle, 0); break;
00343 case LEFT : _flyer.right( _rMotionFactor); break;
00344 case RIGHT : _flyer.right(-_rMotionFactor); break;
00345 case FORWARDS : _flyer.forward(-_rMotionFactor); break;
00346 case BACKWARDS : _flyer.forward( _rMotionFactor); break;
00347 default : FNOTICE(("Navigator: keyPress, unknown key\n"));
00348 }
00349 break;
00350
00351 case WALK:
00352
00353 switch (key)
00354 {
00355 case LEFTROT : _walker.rotate(-_rRotationAngle, 0); break;
00356 case RIGHTROT : _walker.rotate( _rRotationAngle, 0); break;
00357 case LEFT : _walker.right( _rMotionFactor); break;
00358 case RIGHT : _walker.right(-_rMotionFactor); break;
00359 case FORWARDS : _walker.forward(-_rMotionFactor); break;
00360 case BACKWARDS : _walker.forward( _rMotionFactor); break;
00361 default : FNOTICE(("Navigator: keyPress, unknown key\n"));
00362 }
00363 break;
00364
00365 default:
00366
00367 FNOTICE(("Navigator: keyPress, unknown mode\n"));
00368 break;
00369 }
00370 }
00371
00374 void Navigator::moveTo(Int16 x, Int16 y)
00375 {
00376 _moved = true;
00377
00378 Real32 width = Real32(_vp->getPixelWidth());
00379 Real32 height = Real32(_vp->getPixelHeight());
00380
00381 if(width <= 0 || height <= 0)
00382 return;
00383
00384 WindowPtr par = _vp->getParent();
00385 Real32 winHeight;
00386
00387 if(par != NullFC)
00388 winHeight = (Real32)par->getHeight();
00389 else
00390 winHeight = height;
00391
00392 Real32 fromX = (2.0f * (_lastX - _vp->getPixelLeft())- width)/ width;
00393 Real32 fromY = (2.0f * (winHeight - _lastY - _vp->getPixelBottom())
00394 - height) / height;
00395 Real32 toX = (2.0f * (x - _vp->getPixelLeft()) - width) / width;
00396 Real32 toY = (2.0f * (winHeight - y - _vp->getPixelBottom())
00397 - height)/height;
00398
00399 switch (_currentMode)
00400 {
00401 case NONE:
00402 FNOTICE(("Navigator: moveTo NONE mode\n"));
00403 break;
00404
00405 case TRACKBALL:
00406
00407 switch (_currentState)
00408 {
00409 case ROTATING :_trackball.rotate(fromX, fromY, toX, toY);
00410 break;
00411
00412 case TRANSLATING_XY:{
00413 Real32 distanceX = 0,distanceY = 0;
00414 calcDeltas(Int16(_lastX), Int16(_lastY), x, y,
00415 distanceX, distanceY);
00416 _trackball.translateXY(distanceX, distanceY);
00417 }
00418 break;
00419
00420 case TRANSLATING_Z: {
00421 Real32 distance = osgSgn(toY-fromY)*
00422 100.f *
00423 osgpow(osgabs(toY-fromY),2.f);
00424 _trackball.translateZ(distance * _rMotionFactor);
00425 }
00426 break;
00427
00428 default :;
00429 }
00430
00431 break;
00432
00433 case FLY:
00434
00435 {
00436 Real32 distanceX = -(fromX-toX);
00437 Real32 distanceY = (fromY-toY);
00438 _flyer.rotate(distanceX, distanceY);
00439
00440 switch (_currentState)
00441 {
00442 case TRANSLATING_ZPLUS: _flyer.forward(-_rMotionFactor);
00443 break;
00444
00445 case TRANSLATING_ZMINUS: _flyer.forward(_rMotionFactor);
00446 break;
00447
00448 case ROTATING: break;
00449
00450 default: ;
00451 }
00452 }
00453 break;
00454
00455 case WALK:
00456
00457 {
00458 Real32 distanceX = -(fromX-toX);
00459 Real32 distanceY = (fromY-toY);
00460 _walker.rotate(distanceX, distanceY);
00461
00462 switch (_currentState)
00463 {
00464 case TRANSLATING_ZPLUS: _walker.forward(-_rMotionFactor);
00465 break;
00466
00467 case TRANSLATING_ZMINUS: _walker.forward(_rMotionFactor);
00468 break;
00469
00470 case ROTATING: break;
00471
00472 default: ;
00473 }
00474 }
00475 break;
00476
00477 default:
00478
00479 FNOTICE(("Navigator: moveTo, unknown mode\n"));
00480 break;
00481 }
00482 _lastX = x;
00483 _lastY = y;
00484 }
00485
00488 void Navigator::idle(Int16 buttons, Int16 x, Int16 y)
00489 {
00490 switch (_currentMode)
00491 {
00492 case NONE:
00493 case TRACKBALL:
00494 break;
00495 case FLY:
00496 case WALK:
00497 if (buttons)
00498 moveTo(x,y);
00499 break;
00500 }
00501 }
00502
00506 void Navigator::updateCameraTransformation()
00507 {
00508 theMatrix.setIdentity();
00509 if(_absolute && _cartN != NullFC && _cartN->getParent() != NullFC)
00510 {
00511 _cartN->getParent()->getToWorld(theMatrix);
00512 theMatrix.inverse(theMatrix);
00513 }
00514
00515 switch(_currentMode)
00516 {
00517 case NONE: theMatrix.mult(_NoneMatrix); break;
00518 case TRACKBALL: theMatrix.mult(_trackball.getMatrix()); break;
00519 case FLY: theMatrix.mult(_flyer .getMatrix()); break;
00520 case WALK: theMatrix.mult(_walker .getMatrix()); break;
00521 default: FNOTICE(("Navigator: updateCamTrans, unknown mode\n"));
00522 break;
00523 }
00524
00525 if(_cartN != NullFC)
00526 {
00527 TransformPtr t = TransformPtr::dcast(_cartN->getCore());
00528 if(t == NullFC)
00529 {
00530 FWARNING (("Navigator: updateCamTrans, core is not TransformPtr\n"));
00531 }
00532 else
00533 {
00534
00535 if(t->getMatrix() != theMatrix)
00536 {
00537 beginEditCP(t);
00538 t->setMatrix(theMatrix);
00539 endEditCP(t);
00540 }
00541 }
00542 }
00543 else
00544 {
00545 FFATAL (("!_cartN in Navigator::updateCameraTrans\n"));
00546 }
00547 }
00548
00549
00550
00553 void Navigator::setMode(Navigator::Mode new_mode)
00554 {
00555 if (_currentMode == new_mode) return;
00556
00557 _currentMode = new_mode;
00558 }
00559
00562 void Navigator::setRotationAngle(Real32 new_angle)
00563 {
00564 _rRotationAngle = new_angle;
00565 }
00566
00569 void Navigator::setMotionFactor(Real32 new_factor)
00570 {
00571 _rMotionFactor = new_factor;
00572 }
00573
00576 void Navigator::setViewport(ViewportPtr new_viewport)
00577 {
00578 _vp=new_viewport;
00579 _walker.setGround(_vp->getRoot());
00580 _walker.setWorld (_vp->getRoot());
00581 }
00582
00585 void Navigator::setNoneMatrix(Pnt3f new_from, Pnt3f new_at, Vec3f new_up)
00586 {
00587 bool b = MatrixLookAt(_NoneMatrix, new_at, new_at+(new_at-new_from), new_up);
00588
00589 if (b) FNOTICE(("Navigator: set(.,.,.) failed\n"));
00590 }
00591
00594 void Navigator::setFrom(Pnt3f new_from)
00595 {
00596 switch (_currentMode)
00597 {
00598 case NONE:
00599 setNoneMatrix( new_from,
00600 (Pnt3f)(_NoneMatrix[3]-_NoneMatrix[2]),
00601 (Vec3f) _NoneMatrix[1] );
00602 break;
00603 case TRACKBALL: _trackball.setFrom(new_from); break;
00604 case FLY: _flyer .setFrom(new_from); break;
00605 case WALK: _walker .setFrom(new_from); break;
00606 default: FNOTICE(("Navigator: setFrom, unknown mode"));
00607 break;
00608 }
00609 }
00610
00613 void Navigator::setAt(Pnt3f new_at)
00614 {
00615 switch (_currentMode)
00616 {
00617 case NONE:
00618 setNoneMatrix((Pnt3f)_NoneMatrix[3], new_at, (Vec3f)_NoneMatrix[1]);
00619 break;
00620 case TRACKBALL: _trackball.setAt(new_at); break;
00621 case FLY: _flyer .setAt(new_at); break;
00622 case WALK: _walker .setAt(new_at); break;
00623 default: FNOTICE(("Navigator: setAt, unknown mode"));
00624 break;
00625 }
00626 }
00627
00630 void Navigator::setDistance(Real32 new_distance)
00631 {
00632 switch (_currentMode)
00633 {
00634 case NONE: break;
00635
00636 case TRACKBALL: _trackball.setDistance(new_distance);
00637 break;
00638
00639 case FLY: _flyer.forward(new_distance);
00640 break;
00641
00642 case WALK: _walker.forward(new_distance);
00643 break;
00644
00645 default: FNOTICE(("Navigator: setDistance, unknown mode"));
00646 break;
00647 }
00648 }
00649
00650
00653 void Navigator::setUp(Vec3f new_up)
00654 {
00655 switch (_currentMode)
00656 {
00657 case NONE:
00658 setNoneMatrix((Pnt3f) _NoneMatrix[3],
00659 (Pnt3f)(_NoneMatrix[3]-_NoneMatrix[2]),
00660 new_up );
00661 break;
00662
00663 case TRACKBALL: _trackball.setUp(new_up);
00664 break;
00665
00666 case FLY: _flyer.setUp(new_up);
00667 break;
00668
00669 case WALK: _walker.setUp(new_up);
00670 break;
00671
00672 default: FNOTICE(("Navigator: setUp, unknown mode"));
00673 break;
00674 }
00675 }
00676
00679 void Navigator::set(Pnt3f new_from, Pnt3f new_at, Vec3f new_up)
00680 {
00681 switch (_currentMode)
00682 {
00683 case NONE: setNoneMatrix(new_from, new_at, new_up);
00684 break;
00685
00686 case TRACKBALL: _trackball.set(new_from, new_at, new_up);
00687 break;
00688
00689 case FLY: _flyer.set(new_from, new_at, new_up);
00690 break;
00691
00692 case WALK: _walker.set(new_from, new_at, new_up);
00693 break;
00694
00695 default: FNOTICE(("Navigator: set, unknown mode"));
00696 break;
00697 }
00698 }
00699
00702 void Navigator::set(const Matrix & new_matrix)
00703 {
00704 switch (_currentMode)
00705 {
00706 case NONE:
00707
00708
00709 _NoneMatrix = new_matrix;
00710 break;
00711
00712 case TRACKBALL: _trackball.set(new_matrix);
00713 break;
00714
00715 case FLY: _flyer.set(new_matrix);
00716 break;
00717
00718 case WALK: _walker.set(new_matrix);
00719 break;
00720
00721 default: FNOTICE(("Navigator: set(Matrix), unknown mode"));
00722 break;
00723 }
00724 }
00725
00726
00729 void Navigator::setCameraTransformation(const NodePtr & new_cartn)
00730 {
00731 if (new_cartn == NullFC)
00732 {
00733 FWARNING (("Set _cartN in Navigator to NullFC\n"));
00734 }
00735
00736 _cartN = new_cartn;
00737 }
00738
00739
00740
00743 const Matrix &Navigator::getMatrix(void)
00744 {
00745 switch (_currentMode)
00746 {
00747 case NONE: return _NoneMatrix;
00748 case TRACKBALL: return _trackball.getMatrix();
00749 case FLY: return _flyer .getMatrix();
00750 case WALK: return _walker .getMatrix();
00751 default: FNOTICE(("Navigator: getMatrix, unknown mode"));
00752 break;
00753 }
00754
00755 return Matrix::identity();
00756 }
00757
00760 const Pnt3f &Navigator::getFrom(void)
00761 {
00762 static Pnt3f returnValue(0.f, 0.f, 0.f);
00763 returnValue = (Pnt3f)_NoneMatrix[3];
00764
00765 switch (_currentMode)
00766 {
00767 case NONE: return returnValue;
00768 case TRACKBALL: return _trackball.getFrom();
00769 case FLY: return _flyer .getFrom();
00770 case WALK: return _walker .getFrom();
00771 default: FNOTICE(("Navigator: getFrom, unknown mode"));
00772 break;
00773 }
00774
00775 return returnValue;
00776 }
00777
00780 const Pnt3f &Navigator::getAt(void)
00781 {
00782 static Pnt3f returnValue(0.f, 0.f, 0.f);
00783 returnValue = (Pnt3f)(_NoneMatrix[3] - _NoneMatrix[2]);
00784
00785 switch (_currentMode)
00786 {
00787 case NONE: return returnValue;
00788 case TRACKBALL: return _trackball.getAt();
00789 case FLY: return _flyer .getAt();
00790 case WALK: return _walker .getAt();
00791 default: FNOTICE(("Navigator: getAt, unknown mode"));
00792 break;
00793 }
00794
00795 return returnValue;
00796 }
00797
00800 const Vec3f &Navigator::getUp(void)
00801 {
00802 static Vec3f returnValue(0.f, 0.f, 0.f);
00803 returnValue = (Vec3f)_NoneMatrix[1];
00804
00805 switch (_currentMode)
00806 {
00807 case NONE: return returnValue;
00808 case TRACKBALL: return _trackball.getUp();
00809 case FLY: return _flyer .getUp();
00810 case WALK: return _walker .getUp();
00811 default: FNOTICE(("NavigUpor: getUp, unknown mode"));
00812 break;
00813 }
00814
00815 return returnValue;
00816 }
00817
00820 Real32 Navigator::getDistance(void)
00821 {
00822 Real32 distance = 0.0f;
00823 switch (_currentMode)
00824 {
00825 case NONE: break;
00826
00827 case TRACKBALL: distance = _trackball.getDistance();
00828 break;
00829
00830 case FLY: break;
00831
00832 case WALK: break;
00833
00834 default: FNOTICE(("Navigator: setDistance, unknown mode"));
00835 break;
00836 }
00837
00838 return distance;
00839 }
00840
00843 Navigator::State Navigator::getState(void)
00844 {
00845 return _currentState;
00846 }
00847
00850 Navigator::Mode Navigator::getMode(void)
00851 {
00852 return _currentMode;
00853 }
00854
00857 Real32 Navigator::getRotationAngle(void)
00858 {
00859 return _rRotationAngle;
00860 }
00861
00864 Real32 Navigator::getMotionFactor(void)
00865 {
00866 return _rMotionFactor;
00867 }
00868
00871 bool Navigator::getAbsolute(void)
00872 {
00873 return _absolute;
00874 }
00875
00878 bool Navigator::getClickCenter(void)
00879 {
00880 return _clickCenter;
00881 }
00882
00885 bool Navigator::getClickNoIntersect(void)
00886 {
00887 return _clickNoIntersect;
00888 }
00889
00892 bool Navigator::setClickCenter(bool state)
00893 {
00894 bool old = _clickCenter;
00895
00896 _clickCenter = state;
00897 return old;
00898 }
00899
00902 bool Navigator::setAbsolute(bool state)
00903 {
00904 bool old = _absolute;
00905
00906 _absolute = state;
00907 return old;
00908 }
00909
00912 bool Navigator::setClickNoIntersect(bool state)
00913 {
00914 bool old = _clickNoIntersect;
00915
00916 _clickNoIntersect = state;
00917 return old;
00918 }
00919
00923 static void calcCCtoWCMatrix(Matrix &cctowc, const Matrix &view,
00924 const ViewportPtr port)
00925 {
00926 Matrix proj, projtrans;
00927
00928 port->getCamera()->getProjection( proj, port->getPixelWidth(),
00929 port->getPixelHeight());
00930 port->getCamera()->getProjectionTranslation( projtrans,
00931 port->getPixelWidth(),
00932 port->getPixelHeight());
00933
00934 Matrix wctocc = proj;
00935 wctocc.mult( projtrans );
00936 wctocc.mult( view );
00937
00938 cctowc.invertFrom( wctocc );
00939 }
00940
00945 void Navigator::getIntersectionPoint(Int16 x, Int16 y)
00946 {
00947
00948 IntersectAction * act = IntersectAction::create();
00949 Line line;
00950
00951 _vp->getCamera()->calcViewRay(line, x, y, *_vp);
00952
00953 if(_clickNoIntersect)
00954 {
00955 Real32 u = (_dir.dot(Pnt3f(0.0f, 0.0f, 0.0f) - line.getPosition())) /
00956 (_dir.dot(line.getDirection()));
00957 _ip = line.getPosition() + u * line.getDirection();
00958 return;
00959 }
00960
00961 act->setLine(line);
00962 act->apply(_vp->getRoot());
00963
00964 Matrix cctowc,view;
00965 Int16 width = _vp->getPixelWidth();
00966 Int16 height = _vp->getPixelHeight();
00967
00968 _vp->getCamera()->getViewing(view, width, height);
00969
00970 calcCCtoWCMatrix(cctowc, view, _vp);
00971
00972 Pnt3f at,to;
00973
00974 cctowc.multFullMatrixPnt( Pnt3f( 0, 0, 0.5f ), to );
00975 cctowc.multFullMatrixPnt( Pnt3f( 0, 0, 1 ), at );
00976
00977 _dir = to - at;
00978
00979 if (act->didHit())
00980 {
00981 _ip = act->getHitPoint();
00982 }
00983 else
00984 {
00985 Real32 u = (_dir.dot(Pnt3f(0.0f, 0.0f, 0.0f) - line.getPosition())) /
00986 (_dir.dot(line.getDirection()));
00987 _ip = line.getPosition() + u * line.getDirection();
00988 }
00989
00990 delete act;
00991 }
00992
00997 void Navigator::calcDeltas(Int16 , Int16 , Int16 toX, Int16 toY,
00998 Real32 &distanceX, Real32 &distanceY)
00999 {
01000 Matrix view;
01001
01002 view=_trackball.getMatrix();
01003
01004 Pnt3f from( view[3][0], view[3][1], view[3][2] );
01005
01006 view.invert();
01007 Matrix cctowc;
01008 calcCCtoWCMatrix(cctowc, view, _vp);
01009
01010 Real32 rx = ( toX / (Real32) _vp->getPixelWidth() ) * 2.f - 1.f,
01011 ry = 1.f - ( toY / (Real32) _vp->getPixelHeight() ) * 2.f;
01012
01013 Pnt3f at;
01014 cctowc.multFullMatrixPnt( Pnt3f( rx, ry, 1 ), at );
01015
01016 Line line2;
01017 line2.setValue(from, at-from);
01018
01019 Real32 u = (_dir.dot(_ip-line2.getPosition())) /
01020 (_dir.dot(line2.getDirection()));
01021
01022 Pnt3f p2 = line2.getPosition() + u * line2.getDirection();
01023
01024 Vec3f transl;
01025 transl[0] = -p2[0] + _ip[0];
01026 transl[1] = -p2[1] + _ip[1];
01027 transl[2] = -p2[2] + _ip[2];
01028
01029 view.multMatrixVec(transl);
01030
01031 distanceX = transl[0];
01032 distanceY = transl[1];
01033 }
01034
01035
01036
01037
01038
01039 #ifdef __sgi
01040 #pragma set woff 1174
01041 #endif
01042
01043 #ifdef OSG_LINUX_ICC
01044 #pragma warning( disable : 177 )
01045 #endif
01046
01047 namespace
01048 {
01049 static Char8 cvsid_cpp [] = "@(#)$Id: ";
01050 static Char8 cvsid_hpp [] = OSGNAVIGATOR_HEADER_CVSID;
01051
01052
01053 static Char8 cvsid_fields_hpp[] = OSGNAVIGATOR_HEADER_CVSID;
01054 }