CesiumGS / CesiumGS/cesium

Camera inertia activates even though ScreenSpaceCameraController is disabled

Open
#5,341 3 comments 0 reactions 0 assignees View on GitHub
category - camera type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

I would expect the following code to make the globe stay put since `screenSpaceCameraController` is disabled between pressing on the mouse button and releasing it. However, while the globe doesn't drag normally, if you flick it the camera inertia causes the globe to move at the end.

![flick](https://cloud.githubusercontent.com/assets/3451886/26208091/3fd791c6-3bb7-11e7-982f-3c6c0cbb6452.gif)

``` javascript
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var canvas = scene.canvas;

canvas.addEventListener('pointerdown', function() {
scene.screenSpaceCameraController.enableInputs = false;
}, true);

canvas.addEventListener('pointerup', function() {
scene.screenSpaceCameraController.enableInputs = true;
}, true);
```

Contributor guide

Open the contributing guide

Research direction

Start with the minimal Viewer reproduction and trace how scene.screenSpaceCameraController.enableInputs is handled during pointerdown, pointerup, and camera inertia. Confirm the expected behavior by checking that re-enabling inputs after a flick does not allow the globe to continue moving from pending inertia.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.