Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the scroll wheel to control the camera speed in examples #11921

Merged

Conversation

Kanabenki
Copy link
Contributor

Objective

Solution

  • Make the movement speed of the CameraController adjustable with the scroll wheel as mentioned here. The speed use an exponential progression (10% increase per scroll tick by default) to allow adapting the speed to different scales.
  • For the scene_viewer example, make the default speed proportional to the size of the scene using what's computed for the default camera placement. This gives a good enough default to fly over the scene from the outside. I don't think there's a good way to get a default speed fitting for all scenes since some are meant to be viewed from outside while other are traversable environments.

@Kanabenki Kanabenki added C-Examples An addition or correction to our examples C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 17, 2024
@alice-i-cecile
Copy link
Member

@DGriffin91 your review here would work well too :)

Copy link
Contributor

@DGriffin91 DGriffin91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an easy way to test Line vs Pixel scrolling but otherwise LGTM

@Kanabenki
Copy link
Contributor Author

I don't have an easy way to test Line vs Pixel scrolling but otherwise LGTM

I'm interested if someone has an input device that uses pixel scroll since I don't, to check that the pixel to line ratio I picked seems reasonable.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 18, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 19, 2024
Merged via the queue into bevyengine:main with commit 8de15ae Feb 19, 2024
24 checks passed
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
…ine#11921)

# Objective

- Closes bevyengine#9384.

## Solution

- Make the movement speed of the `CameraController` adjustable with the
scroll wheel as mentioned
[here](bevyengine#9384 (comment)).
The speed use an exponential progression (10% increase per scroll tick
by default) to allow adapting the speed to different scales.
- For the `scene_viewer` example, make the default speed proportional to
the size of the scene using what's computed for the default camera
placement. This gives a good enough default to fly over the scene from
the outside. I don't think there's a good way to get a default speed
fitting for all scenes since some are meant to be viewed from outside
while other are traversable environments.
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
…ine#11921)

# Objective

- Closes bevyengine#9384.

## Solution

- Make the movement speed of the `CameraController` adjustable with the
scroll wheel as mentioned
[here](bevyengine#9384 (comment)).
The speed use an exponential progression (10% increase per scroll tick
by default) to allow adapting the speed to different scales.
- For the `scene_viewer` example, make the default speed proportional to
the size of the scene using what's computed for the default camera
placement. This gives a good enough default to fly over the scene from
the outside. I don't think there's a good way to get a default speed
fitting for all scenes since some are meant to be viewed from outside
while other are traversable environments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples An addition or correction to our examples C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make scene_viewer movement speed proportional to scene size
3 participants