diff --git a/editor/mainglwidget.cpp b/editor/mainglwidget.cpp index ec09ac9..10b65b0 100644 --- a/editor/mainglwidget.cpp +++ b/editor/mainglwidget.cpp @@ -212,9 +212,7 @@ void MainGLWidget::handleLinearTransform(QMouseEvent* evt) { // Apply snapping in the current frame glm::vec3 diff = centerPoint - (glm::vec3)editorToolHandles->adornee->lock()->position(); - // printf("\n=======\nPre-snap: (%f, %f, %f)\n", diff.x, diff.y, diff.z); if (snappingFactor()) diff = frame.Rotation() * (glm::round(glm::vec3(frame.Inverse().Rotation() * diff) / snappingFactor()) * snappingFactor()); - // printf("Post-snap: (%f, %f, %f)\n", diff.x, diff.y, diff.z); Data::Vector3 oldSize = part->size; @@ -318,6 +316,13 @@ void MainGLWidget::handleCursorChange(QMouseEvent* evt) { setCursor(Qt::ArrowCursor); } +void MainGLWidget::wheelEvent(QWheelEvent* evt) { + camera.processMovement(evt->angleDelta().y() < 0 ? DIRECTION_BACKWARDS : DIRECTION_FORWARD, 0.25f); + + if (mainWindow()->editSoundEffects && QFile::exists("./assets/excluded/SWITCH3.wav")) + QSound::play("./assets/excluded/SWITCH3.wav"); +} + void MainGLWidget::mouseMoveEvent(QMouseEvent* evt) { handleCameraRotate(evt); handleObjectDrag(evt); diff --git a/editor/mainglwidget.h b/editor/mainglwidget.h index 786ce31..de11771 100644 --- a/editor/mainglwidget.h +++ b/editor/mainglwidget.h @@ -28,6 +28,7 @@ protected: void handleCursorChange(QMouseEvent* evt); std::optional raycastHandle(glm::vec3 pointDir); + void wheelEvent(QWheelEvent* evt) override; void mouseMoveEvent(QMouseEvent* evt) override; void mousePressEvent(QMouseEvent* evt) override; void mouseReleaseEvent(QMouseEvent* evt) override; diff --git a/editor/mainwindow.cpp b/editor/mainwindow.cpp index d9c5f77..be8f0ac 100644 --- a/editor/mainwindow.cpp +++ b/editor/mainwindow.cpp @@ -131,7 +131,6 @@ MainWindow::MainWindow(QWidget *parent) connect(ui->actionToggleEditSounds, &QAction::triggered, this, [&](bool state) { editSoundEffects = state; - printf("%d\n", editSoundEffects); ui->actionToggleEditSounds->setIcon(QIcon::fromTheme(editSoundEffects ? "audio-volume-high" : "audio-volume-muted")); }); ui->actionToggleEditSounds->setChecked(true);