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

Browser hangs when picking GroundPolylineGeometry is picked with drill pick #6907

Closed
ggetz opened this issue Aug 10, 2018 · 3 comments
Closed

Comments

@ggetz
Copy link
Contributor

ggetz commented Aug 10, 2018

Submitted on the forum: https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html#c=dVRrT9swFP0rVr8slYqTNqUPVtAqYIwNUbSy7QNFk5vcpgbHjmynVTbx33edkL4Gqaok9jnn+txHfJ+cg+F5SqvbLx4nYAk3xPCUC6aJVTXiJ4c16BaZ53Ymfd+BrOZpCjGJ1VpSQq5L5lNuLGFkXUktFGosgYQXJBFqDh8rrkUOGCIVUmQk8hhKFJM8ZZYr2SL4kIAuiAEBUblUMpmMiUKofg1gWiiiKzWnChk4hCzl7JLr+Chj2hYl+ZtU0bPKLRF8rpku6EyuWK1ETomE9Vv58D5E5du5kpZxCfpDE21U3ARUClYX19JYJiPYV7k62PX+ziTBq2aRkz20VrmM75QoBEapuTXHXZky3OXCILE+KLrDJyZDutAqvYBEA5ix1qzwHrZMdx2122067B4HQb8/7PS77Xa3RcIe7fR74aDXHwwG3XY3bL1FCoaDMAi64bDTG/aQFNCgPxwch71eux92j7tbzmNzRwAza5d41g4NqsWXepdZbB5sJXBWdhxGSmA5t+7c62EWxzW3dFxCvF08nXwf315dNl9DzuRLVa+qztREIIEmVbKxgzGjKzCUxbH3bjE2uMMK1mdyNh4OFx9rs1kGTJftsVfwWr089XgD8jZJEkKt73j0zGVygtOWg/Oybb6UZZcrkPYLToXAkdjrvWmEjSCnGYtgF+TtZSFiKGQqxQM1asBeyyy343L8vEUuq4dUrSBFXNPVDX82woZUAihojZX4Op3cUoMVkglfFFt0GcS6v+/fK5JpcMHIkiFOJlj41MGIG083uwvlzLsdlyFHc44zTAbEk/kTfhMM+t0zE2suhEvXJiitB8YFf2m9l5r7IgN6c/n5/vePO4dstBojYwsBZ1UdPvE0U9qSXAuPUt9CmgmGrevPczyOpZEpUzjya9Io5ivC49NZ4+DLMWuQSDBjcGeRCzHlf2DWOBv5iN+jCcVi9D5ZgRascJBl++ymWqSUjnx8/Z9llRJzpncU/wE

The following sandcastle examples hangs when the polyline is picked:

var widget = new Cesium.CesiumWidget('cesiumContainer');

var geometryInstance = new Cesium.GeometryInstance({
    geometry : new Cesium.GroundPolylineGeometry({
        positions : Cesium.Cartesian3.fromDegreesArray([
            -111.94500779274114, 36.27638678884143,
            -111.90983004392696, 30.07985366173454
        ]),
        width : 2.0
    }),
    attributes : {
        color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.ORANGE)
    }
});

widget.scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
    geometryInstances : [geometryInstance],
    appearance : new Cesium.PolylineColorAppearance(),
    allowPicking: true
}));

var mapEventHandler = new Cesium.ScreenSpaceEventHandler(widget.scene.canvas);

mapEventHandler.setInputAction(function(movement) {

	console.error(JSON.stringify(movement));
	
	//To prevent hanging comment out the following line
	var pickedObjects = widget.scene.drillPick(movement.position);
}, Cesium.ScreenSpaceEventType.LEFT_UP);

@likangning93 any ideas?

@mramato
Copy link
Contributor

mramato commented Aug 10, 2018

Drill picking works by doing a pick, adding that item to the result array, then hiding that item and picking again (until there's nothing left to pick). Since this geometry does not have a show instance attribute, it attempts to hide the entire primitive by setting primitive.show = false on line 3805 of Scene.js. For some reason, this does not hide the primitive which is causing an infinite loop

The odd thing here is that primitive.show false works great if you set it yourself (you can add a button to the sandcastle example to show this). It's only inside drillPick where re-rendering isn't reflecting the new value. I think there is a bug in Scene.pick that is not correctly re-rendering the pick buffer if it involves ground geometry.

CC @bagnell knows this code best, I'm sure it's a trivial fix.

@hpinkos
Copy link
Contributor

hpinkos commented Aug 16, 2018

@OmarShehata @ggetz can you find the forum post this was reported in? Can you tell them it's been fixed please?

@ggetz
Copy link
Contributor Author

ggetz commented Aug 16, 2018

Whoops, sorry forgot the forum link. I'll let him know.

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