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

Optimize CameraControl proximity-dependent dolly speed #429

Closed
xeolabs opened this issue Sep 9, 2020 · 0 comments
Closed

Optimize CameraControl proximity-dependent dolly speed #429

xeolabs opened this issue Sep 9, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@xeolabs
Copy link
Member

xeolabs commented Sep 9, 2020

When CameraControl#followPointer is true, then every time a mouse wheel event is handled, CameraControl does a ray-pick to get the distance to the nearest object on the line-of-sight.

The forward dolly speed is then adjusted, to make it inversely proportional to the distance.

Problem here is that we do the ray pick on every mouse wheel event.

We could instead do the ray-pick once, on the first mouse wheel event since the last mouse move event, saving the picked surface position. Then we can compute the distance as the the distance from our current eye position to that surface point on each subsequent mouse wheel event, until the next mouse move event, then adjusting the dolly speed by that etc.

This must also be done for touch and keyboard dollying.

@xeolabs xeolabs added this to the 1.4.0 milestone Sep 9, 2020
@xeolabs xeolabs self-assigned this Sep 9, 2020
@xeolabs xeolabs added the enhancement New feature or request label Sep 9, 2020
@xeolabs xeolabs changed the title Optimization for CameraControl proximity-dependent dolly speed Optimize CameraControl proximity-dependent dolly speed Sep 10, 2020
@xeolabs xeolabs closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant