CesiumGS / CesiumGS/cesium

Camera inertia still in effect after setView

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

Description

Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/5o3nTz7EJn8

If you flick the camera and then hit 'f' to set the view, the camera moves after the view is set because the inertia is carried over.

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

var canvas = viewer.canvas;
canvas.setAttribute('tabindex', '0'); // needed to put focus on the canvas
canvas.onclick = function() {
canvas.focus();
};

document.addEventListener('keydown', function(e) {
if (e.keyCode === 'F'.charCodeAt(0)){
viewer.camera.setView({
destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
});
}
}, false);
```

Contributor guide

Open the contributing guide

Research direction

Start with the supplied JavaScript reproduction and inspect viewer.camera.setView alongside the camera inertia behavior it triggers. Done means setting the view after a camera flick leaves the camera at the requested destination without subsequent movement from carried-over inertia.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.