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

Camera flight issues #4075

Closed
mramato opened this issue Jun 30, 2016 · 1 comment
Closed

Camera flight issues #4075

mramato opened this issue Jun 30, 2016 · 1 comment

Comments

@mramato
Copy link
Contributor

mramato commented Jun 30, 2016

The below Sandcastle example is a simple save/restore camera view that exposes two issues in Cesium.

  1. Flights that start far away from their destination and end up on the ground will cause the camera to collide with terrain while it is in flight. This causes the camera to end up wherever the terrain was loaded when it collided and not the end destination.
  2. I think the minimum distance is being taken into account differently during camera flights than it does during camera motion. This means if you move the camera close to the ground with a horizon view, save the settings, and then do a flight; you end up in a difference location.
var viewer = new Cesium.Viewer('cesiumContainer');
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
    url : 'https://assets.agi.com/stk-terrain/world',
    requestWaterMask : true,
    requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;

var view;
var camera = viewer.scene.camera;

Sandcastle.addToolbarButton('Store View', function(){
    view = {
        destination : Cesium.Cartesian3.clone(camera.positionWC),
        orientation : {
            heading: camera.heading,
            pitch: camera.pitch,
            roll: camera.roll
        }
    };
});

Sandcastle.addToolbarButton('Load View', function(){
    camera.flyTo(view);
});

Using the above code, fly to San Francisco and create a horizon view right up against the ground. Storing and loading the view won't match.

Stored view
image

Result after flight
image

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 2, 2016

@mramato thanks for narrowing this down.

@bagnell can you take a look soon since this is affecting demos. Perhaps it is as simple as disabling collision detection and minimum distance during flights?

mramato added a commit that referenced this issue Aug 31, 2018
Fixes #6962

I'm not sure if we introduced a regression somewhere or if we just never
noticed, but the desired camera behavior is that it not force the view to
be above terrain if there is still terrain loading.  I also confirmed
that #4075 is still fixed even with this change.
jbo023 pushed a commit to virtualcitySYSTEMS/cesium that referenced this issue Sep 4, 2018
Fixes CesiumGS#6962

I'm not sure if we introduced a regression somewhere or if we just never
noticed, but the desired camera behavior is that it not force the view to
be above terrain if there is still terrain loading.  I also confirmed
that CesiumGS#4075 is still fixed even with this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants