testbed/src/Scene.cpp
bool Scene::mouseMotionEvent(double xMouse, double yMouse, int leftButtonState,
                             int rightButtonState, int middleButtonState,
                             int altKeyState) {

    // Zoom
    if (leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS) {

        float dy = static_cast<float>(yMouse - mLastMouseY);
        float h = static_cast<float>(mWindowHeight);

        // Zoom the camera
        zoom(-dy / h);
    }
    // Translation
    else if (middleButtonState == GLFW_PRESS || rightButtonState == GLFW_PRESS ||
             (leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS)) {
        translate(xMouse, yMouse);
    }
    // Rotation
    else if (leftButtonState == GLFW_PRESS) {
        rotate(xMouse, yMouse);
    }

    // Remember the mouse position
    mLastMouseX = xMouse;
    mLastMouseY = yMouse;

    return true;
}
// Called when a mouse motion event occurs
Called when a mouse motion event occurs
Called when a mouse motion event occurs
bool Scene::mouseMotionEvent(double xMouse, double yMouse, int leftButtonState,
                             int rightButtonState, int middleButtonState,
                             int altKeyState) {
    if (leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS) {
        float dy = static_cast<float>(yMouse - mLastMouseY);
        float h = static_cast<float>(mWindowHeight);
         the camera
        zoom(-dy / h);
    }
    else if (middleButtonState == GLFW_PRESS || rightButtonState == GLFW_PRESS ||
             (leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS)) {
        translate(xMouse, yMouse);
    }
    else if (leftButtonState == GLFW_PRESS) {
        rotate(xMouse, yMouse);
    }
    mLastMouseX = xMouse;
    mLastMouseY = yMouse;
    return true;
}
bool Scene :: mouseMotionEvent ( double xMouse , double yMouse , int leftButtonState , int rightButtonState , int middleButtonState , int altKeyState ) { if ( leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS ) { float dy = static_cast < float > ( yMouse - mLastMouseY ) ; float h = static_cast < float > ( mWindowHeight ) ; zoom ( - dy / h ) ; } else if ( middleButtonState == GLFW_PRESS || rightButtonState == GLFW_PRESS || ( leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS ) ) { translate ( xMouse , yMouse ) ; } else if ( leftButtonState == GLFW_PRESS ) { rotate ( xMouse , yMouse ) ; } mLastMouseX = xMouse ; mLastMouseY = yMouse ; return true ; }
Called when a mouse motion event occurs
Called when a mouse motion event occurs
// Zoom // Zoom the camera // Translation // Rotation // Remember the mouse position