Exemple #1
0
 // ---------------------------------
 static private void MouseEndTrackBall(int x, int y)
 {
     // y = camera.viewHeight - y;
     if (gTrackball)
     { // if we are currently tracking, end trackball
         if (gTrackBallRotation[0] != 0.0)
         {
             TrackBall.addToRotationTrackball(gTrackBallRotation, view.worldRotation);
         }
         gTrackBallRotation[0] = gTrackBallRotation[1] = gTrackBallRotation[2] = gTrackBallRotation[3] = 0.0f;
     }
 }
Exemple #2
0
 static public void mouseDragged(int button, int x, int y)
 {
     //y = camera.viewHeight - y;
     if (button > 0)
     {
         if (TrackBall.gTrackball)
         {
             TrackBall.rollToTrackball(x, y, ref gTrackBallRotation);
         }
         else if (TrackBall.gDolly)
         {
             mouseDolly(x, y);
         }
         else if (TrackBall.gPan)
         {
             mousePan(x, y);
         }
     }
 }
Exemple #3
0
 //-----------------------------------------------------------------------------
 static public void mouseDown(int mousex, int mousey) // trackball
 {
     if (gDolly)                                      // send to pan
     {
         MouseDollyStart(mousex, mousey);
     }
     else if (gPan) // send to dolly
     {
         MousePanStart(mousex, mousey);
     }
     else
     {
         // y = camera.viewHeight - y;
         gDolly     = false; // no dolly
         gPan       = false; // no pan
         gTrackball = true;
         TrackBall.startTrackball(mousex, mousey, 0, 0, view.Width, view.Height);
     }
 }
Exemple #4
0
 // ---------------------------------
 static public void mouseUp()
 {
     if (gDolly)
     { // end dolly
         gDolly = false;
     }
     else if (gPan)
     { // end pan
         gPan = false;
     }
     else if (gTrackball)
     { // end trackball
         gTrackball = false;
         if (gTrackBallRotation[0] != 0.0)
         {
             TrackBall.addToRotationTrackball(gTrackBallRotation, view.worldRotation);
         }
         gTrackBallRotation[0] = gTrackBallRotation[1] = gTrackBallRotation[2] = gTrackBallRotation[3] = 0.0f;
     }
 }