Skip to content

Commit

Permalink
Reset camera on double click
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleBakker committed Sep 22, 2023
1 parent 9c632b7 commit 002adb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x-IMU3-GUI/Source/Windows/ThreeDViewWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ void ThreeDViewWindow::mouseDrag(const juce::MouseEvent& mouseEvent)
lastMousePosition = mouseEvent.getPosition();
}

void ThreeDViewWindow::mouseDoubleClick(const juce::MouseEvent&)
{
settings.cameraAzimuth = ThreeDView::Settings().cameraAzimuth.load();
settings.cameraElevation = ThreeDView::Settings().cameraElevation.load();
settings.cameraOrbitDistance = ThreeDView::Settings().cameraOrbitDistance.load();
}

void ThreeDViewWindow::mouseWheelMove(const juce::MouseEvent&, const juce::MouseWheelDetails& wheel)
{
settings.cameraOrbitDistance = juce::jlimit(1.0f, 4.0f, settings.cameraOrbitDistance + (0.5f * -wheel.deltaY));
Expand Down
2 changes: 2 additions & 0 deletions x-IMU3-GUI/Source/Windows/ThreeDViewWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ThreeDViewWindow : public Window,

void mouseDrag(const juce::MouseEvent& mouseEvent) override;

void mouseDoubleClick(const juce::MouseEvent& mouseEvent) override;

void mouseWheelMove(const juce::MouseEvent&, const juce::MouseWheelDetails& wheel) override;

private:
Expand Down

0 comments on commit 002adb3

Please sign in to comment.