First off, thanks for adding entity terrain clamping in Cesium 1.23! That's a great addition which has been needed for a while!
I am adding an entity to terrain in Cesium 1.23 with the following code:
var myNewEntity = myCesiumViewer.entities.add({
id: someId,
name: "someName",
polygon: {
material: Cesium.Color.RED.withAlpha(0.4),
hierarchy: Cesium.Cartesian3.fromDegreesArray(someCoordArray),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
}
});
Then I fly to that entity with the following code:
myCesiumViewer.flyTo(myNewEntity);
The camera flies to the polygon coordinates but does not respect the terrain height. The camera goes down through the ground.
I was previously using perPositionHieght on PolygonGraphics to simulate clamp to ground functionality. Specifying perPositionHeight (or height or extrudedHeight) on PolygonGraphics makes the viewer.flyTo() respect the height of the entity, but of course it negates the new CLAMP_TO_GROUND/GroundPrimitive rendering of the entity (which is awesome and which I'd like to use).
Can you guys make CesiumViewer.flyTo(entity) respect the height of entities that use the new "heightReference: Cesium.HeightReference.CLAMP_TO_GROUND" property?
Thanks and Regards,
Jamie