CesiumGS / CesiumGS/cesium

`Camera.flyTo` does not suspend controllers registered with `Scene.controllerHost`, so the new modular camera controllers can hijack a flight

Open
#13,772 1 comment 0 reactions 0 assignees View on GitHub
needs triage type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### What happened?

`CameraFlightPath.createTween()` suspends camera input for the duration of a flight by setting `scene.screenSpaceCameraController.enableInputs = false`, restoring it afterwards (see open Issue: #13771, fixed in: #1377).
However, it only ever touches the legacy, monolithic `ScreenSpaceCameraController`. It never suspends controllers registered with the new `Scene.controllerHost` (the `Controller` framework added in #13604, e.g. `ScreenSpaceMapCameraController`, `ScreenSpaceTiltOrbitCameraController`, `ScreenSpaceZoomCameraController`).

The documented migration path to the new framework is:

```js
scene.screenSpaceCameraController.enableInputs = false;
viewer.addController(new Cesium.ScreenSpaceMapCameraController());
```

Once an application follows this path, camera flights lose *all* input suspension: dragging, scrolling, or tilting during a `flyTo()` competes with the flight animation instead of being ignored, because nothing tells the modular controllers a flight is in progress. This is a behavioral regression relative to `ScreenSpaceCameraController`, which has always suspended input for the duration of a flight.

**Expected:** while a camera flight is in progress, no registered controller (legacy or modular) responds to user input. Input should resume normally once the flight completes or is cancelled, without replaying whatever was accumulated during the flight as a sudden camera jump.

**Actual:** modular controllers registered with `Scene.controllerHost` keep processing input throughout the flight and can hijack the camera before it reaches its destination.

### Reproduction steps

1. Open the Sandcastle below. It disables the legacy `screenSpaceCameraController` and registers a `ScreenSpaceMapCameraController` instead.
2. Click **Fly somewhere (3s)**. While the HUD reads `FLYING`, click-and-drag the globe with the left mouse button.
3. Notice the drag pans the camera immediately, fighting the in-progress flight, instead of being ignored the way it would be with the legacy controller and `enableInputs = false`.

### Sandcastle example

https://sandcastle.cesium.com/#c=pVZpj9s2EP0rAwdFZMSm7XiPRF6nRTYHFkjSIklbFFE/0OJIIpYaCiTlo8H+94IU5SPHokVswDKpmTfDR84b5pqsg7XEDRpYAuEGrtHKt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dA4dGlOaRqcT3J1OdFzGuWF8aiORXAz3ubffsxwTeMtdxZx+z4XkZJMIF2yG+yBxK+5xCRYHB19wKfht7Gbu4lO0JiY037/Ldd0odJh+vUX+89X2HuPlnHJU/9/zzpfl3XFpKrlGXxxCtz9UoAHwN683IhZfuBOlYLDRxlnYVOiqcMuJaiAtSILG6NKgtaFqpXtoAbndBTSnwaFS3pPCwOyCdpVePTPar91gYdBWPQW+3Z32jY6QjoeffRd589fNu9cwPkEE0pts0Bml8FAKhTCOCvJF48kGDxd9pNhYfRffRwpBHhTFxepilQ0g9aOLVVE8PQ+qeefp3ye96C96jbbuPZLo7lsv10jujVd5QpNEa288GA2uQtBnPoVfZO3phdaohLGJw7pR3KGdrNr8Fp3v+N7patK7XAm5BimW37gmQ+jLy2xQtEp9kP9gNnh2NRFyfeKmdCiSX9doFN95k2r27E03yRi7mlSzb3jt72j7d/8C

### Environment

Browser: all (reproduced in Chrome and Firefox; not browser-specific)
CesiumJS Version: 1.145.0
Operating System: all

### AI acknowledgment

- [x] I used AI to generate this issue report.
- [x] (If the above is checked) I have reviewed the AI-generated content before submitting.

Contributor guide

Open the contributing guide

Research direction

Start at CameraFlightPath.createTween() and inspect how it toggles scene.screenSpaceCameraController.enableInputs, then trace Scene.controllerHost and the listed modular camera controllers. Reproduce the Sandcastle flight and verify that registered legacy and modular controllers ignore input during the flight, resume after completion or cancellation, and do not cause a camera jump.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.