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

Improve CameraControl touch dolly/pan #415

Merged
merged 1 commit into from
Aug 15, 2020
Merged

Conversation

Amoki
Copy link
Contributor

@Amoki Amoki commented Aug 14, 2020

But when doing a zoom, a pick is done at each tick, and the pick costs ~60% of the time (cf. flame graph).
Capture d’écran de 2020-08-14 16-54-15

Checking the distance only once when the two fingers are touching the screen and keeping it until a finger leaves the screen seems a good UX and is more performant.

cameraUpdater doesn't pick anything itself anymore, each handler must explicitly pick before a dolly.

Touch events were triggered for every pixel, implying 150 updates of 1 pixel instead of 1 update of 150px. This led to very slow dolly.

I retored my viewer.cameraControl.touchDollyRate = 0.2; to avoid too fast dolly.

Pan and dolly can also be done simultaneously: it's way more smooth and a better UX overall.

@xeolabs xeolabs changed the title improve touch dolly/pan Improve CameraControl touch dolly/pan Aug 15, 2020
@xeolabs xeolabs added this to the 1.3.9 milestone Aug 15, 2020
@xeolabs xeolabs added the enhancement New feature or request label Aug 15, 2020
@xeolabs xeolabs merged commit b7bcd98 into xeokit:master Aug 15, 2020
@xeolabs
Copy link
Member

xeolabs commented Aug 15, 2020

@Amoki thanks very much!

@Amoki Amoki deleted the touch-improvment branch September 13, 2022 16:21
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

Successfully merging this pull request may close these issues.

2 participants