Open hpinkos opened 7 years ago
@bagnell is there a reason the camera.moveStart
and camera.moveEnd
events are raised in Scene
and camera.changed
is raised in Camera
? It seems like these should use the same logic
To add to the description of this issue. The same behavior is even more obvious with camera.changed event. In fact, the event is not triggered at all when the camera is below the ellipsoid. This is very clearly noticeable when using a terrain provider since it is possible to navigate under the level of the ellipsoid. And to be more specific, this issue occurs with the zoom and the translation navigation but not with the rotation.
The moveStart, moveEnd and changed events are triggered whether the camera is above or below the ellipsoid. (In our use cases we navigate near the surface of the terrain and very often under the ellipsoid.)
var viewer = new Cesium.Viewer('cesiumContainer');
var camera = viewer.camera;
camera.position = new Cesium.Cartesian3(1408166.1338912349, -4136627.945644175, 4630485.211009045);
camera.percentageChanged = 0.001;
camera.changed.addEventListener(
function()
{
var height = Cesium.Cartographic.fromCartesian(camera.position).height;
console.log(height);
}.bind(camera));
Thanks for expanding on this @DannyLebel!
This event is almost never triggered when navigating an indoor 3D tileset. camera.changed
has the same problem.
Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/SwoFMPNm5_g
This is particularly noticeable in 2D
It looks like we are using
EPSILON6
, which is not significant enough when the camera is very close to the ground: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L2349The camera changed event does a much better job because it takes the camera height into consideration: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Camera.js#L336