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

Drill picking polygons causes browser to hang #5971

Closed
juburr opened this issue Nov 8, 2017 · 7 comments
Closed

Drill picking polygons causes browser to hang #5971

juburr opened this issue Nov 8, 2017 · 7 comments

Comments

@juburr
Copy link
Contributor

juburr commented Nov 8, 2017

After upgrading from 1.38 to 1.39, drill picking certain polygons causes the browser to hang in an infinite loop at this spot in the code.

After quite a bit of debugging, I discovered that this happens on polygons that are missing a height attribute, even though the API says it's an optional property. To fix the issue in 1.39 apps, you can explicitly set the height of all polygons to 0.0 (the default). This isn't really a true workaround though, as your polygon will no longer conform to the terrain as it did when you completely omitted the property.

For example, drill-picking the polygon in this Sandcastle example will result in the browser hanging. Add in height: 0.0 and the drill picker will work again (albeit underground if you have terrain enabled).

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

var wyoming = viewer.entities.add({
  name : 'Wyoming',
  show: true,
  polygon : {
    hierarchy : Cesium.Cartesian3.fromDegreesArray([
                              -109.080842,45.002073,
                              -105.91517,45.002073,
                              -104.058488,44.996596,
                              -104.053011,43.002989,
                              -104.053011,41.003906,
                              -105.728954,40.998429,
                              -107.919731,41.003906,
                              -109.04798,40.998429,
                              -111.047063,40.998429,
                              -111.047063,42.000709,
                              -111.047063,44.476286,
                              -111.05254,45.002073]),
    material : Cesium.Color.RED.withAlpha(0.5)
  }
});

viewer.screenSpaceEventHandler.setInputAction(function (movement) {
	var picks = viewer.scene.drillPick(movement.position);
	if (Cesium.defined(picks)) {
		console.log(picks.length);
	}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

viewer.zoomTo(wyoming);

EDIT: This applies to other primitives too -- not just polygons.

@hpinkos
Copy link
Contributor

hpinkos commented Nov 8, 2017

Thanks for reporting this @jburr-nc!

@bagnell was there a change made last release for picking ground primitives?

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 8, 2017

@jburr-nc do you happen to have any bandwidth to git bisect to try to narrow down the commit?

Cesium had a hang here once before: #4783 / #4784

@juburr
Copy link
Contributor Author

juburr commented Nov 8, 2017

@pjcozzi The git bisect result is 8e7b0a6ca479400a747b1dd8173b65a1d00cbe22.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 8, 2017

Good eye, thanks @jburr-nc!

@bagnell please look at this for the next release.

@jburr-nc it may be a week or two before we can get to this so feel free to dig even farther in the meantime if you want 😉

@tfili
Copy link
Contributor

tfili commented Nov 15, 2017

@bagnell Will you be able to look at this for 1.40?

@hpinkos
Copy link
Contributor

hpinkos commented Nov 28, 2017

@bagnell reminder to look at this. We should really try to fix this before the release goes out on Friday

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 30, 2017

@jburr-nc thanks again for the report. This was fixed in #6017 and will be in the Cesium 1.40 release tomorrow.

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

4 participants