diff --git a/Apps/Sandcastle/gallery/Z-Indexing Geometry.html b/Apps/Sandcastle/gallery/Z-Indexing Geometry.html index 1ec0d4e8e578..a2c43724c3f5 100644 --- a/Apps/Sandcastle/gallery/Z-Indexing Geometry.html +++ b/Apps/Sandcastle/gallery/Z-Indexing Geometry.html @@ -35,8 +35,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-110.0, 20.0, -100.5, 30.0), material : Cesium.Color.RED, - zIndex: 1, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 1 } }); @@ -44,8 +43,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-112.0, 25.0, -102.5, 35.0), material : '../images/Cesium_Logo_Color.jpg', - zIndex: 2, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 2 } }); @@ -53,8 +51,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-110.0, 31.0, -100.5, 41.0), material : Cesium.Color.BLUE, - zIndex: 3, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 3 } }); @@ -62,8 +59,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-99.5, 20.0, -90.0, 30.0), material : '../images/Cesium_Logo_Color.jpg', - zIndex: 3, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 3 } }); @@ -71,8 +67,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-97.5, 25.0, -88.0, 35.0), material : Cesium.Color.GREEN, - zIndex: 2, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 2 } }); @@ -80,8 +75,7 @@ rectangle : { coordinates : Cesium.Rectangle.fromDegrees(-99.5, 31.0, -90.0, 41.0), material : Cesium.Color.BLUE, - zIndex: 1, - classificationType : Cesium.ClassificationType.TERRAIN + zIndex: 1 } }); diff --git a/Apps/Sandcastle/gallery/Z-Indexing Geometry.jpg b/Apps/Sandcastle/gallery/Z-Indexing Geometry.jpg index 3da960f0ad21..caae2ada52e6 100644 Binary files a/Apps/Sandcastle/gallery/Z-Indexing Geometry.jpg and b/Apps/Sandcastle/gallery/Z-Indexing Geometry.jpg differ diff --git a/CHANGES.md b/CHANGES.md index 419c1a9b29f5..82a7419f2a85 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ Change Log * Added `PostProcessStageComposite` for multi-stage post-processes like depth of field. * Added a new Sandcastle label `Post Processing` to showcase the different built-in post-process stages. * Added `Rectangle.equalsEpsilon` for comparing the equality of two rectangles [#6533](https://github.com/AnalyticalGraphicsInc/cesium/pull/6533) + * Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/AnalyticalGraphicsInc/cesium/pull/6362) ##### Fixes :wrench: * Fixed a bug causing custom TilingScheme classes to not be able to use a GeographicProjection. [#6524](https://github.com/AnalyticalGraphicsInc/cesium/pull/6524) @@ -30,6 +31,7 @@ Change Log ##### Breaking Changes :mega: * Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) +* The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.TERRAIN`. If you wish the geometry to color both terrain and 3D tiles, pass in the option `classificationType: Cesium.ClassificationType.BOTH`. ##### Additions :tada: * Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393) diff --git a/Source/DataSources/CorridorGraphics.js b/Source/DataSources/CorridorGraphics.js index f42ff4c6a082..a1a7e3e9c8b5 100644 --- a/Source/DataSources/CorridorGraphics.js +++ b/Source/DataSources/CorridorGraphics.js @@ -210,7 +210,7 @@ define([ * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground. * @memberof CorridorGraphics.prototype * @type {Property} - * @default ClassificationType.BOTH + * @default ClassificationType.TERRAIN */ classificationType : createPropertyDescriptor('classificationType'), diff --git a/Source/DataSources/EllipseGraphics.js b/Source/DataSources/EllipseGraphics.js index afce93014cf0..bdb5e5f99fd0 100644 --- a/Source/DataSources/EllipseGraphics.js +++ b/Source/DataSources/EllipseGraphics.js @@ -232,7 +232,7 @@ define([ * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground. * @memberof EllipseGraphics.prototype * @type {Property} - * @default ClassificationType.BOTH + * @default ClassificationType.TERRAIN */ classificationType : createPropertyDescriptor('classificationType'), diff --git a/Source/DataSources/GeometryUpdater.js b/Source/DataSources/GeometryUpdater.js index 07900f7130ab..611b2ee0b869 100644 --- a/Source/DataSources/GeometryUpdater.js +++ b/Source/DataSources/GeometryUpdater.js @@ -43,7 +43,7 @@ define([ var defaultOutlineColor = new ConstantProperty(Color.BLACK); var defaultShadows = new ConstantProperty(ShadowMode.DISABLED); var defaultDistanceDisplayCondition = new ConstantProperty(new DistanceDisplayCondition()); - var defaultClassificationType = new ConstantProperty(ClassificationType.BOTH); + var defaultClassificationType = new ConstantProperty(ClassificationType.TERRAIN); /** * An abstract class for updating geometry entites. diff --git a/Source/DataSources/PolygonGraphics.js b/Source/DataSources/PolygonGraphics.js index f66d92a4d005..99c5243d86fe 100644 --- a/Source/DataSources/PolygonGraphics.js +++ b/Source/DataSources/PolygonGraphics.js @@ -233,7 +233,7 @@ define([ * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground. * @memberof PolygonGraphics.prototype * @type {Property} - * @default ClassificationType.BOTH + * @default ClassificationType.TERRAIN */ classificationType : createPropertyDescriptor('classificationType'), diff --git a/Source/DataSources/RectangleGraphics.js b/Source/DataSources/RectangleGraphics.js index b4880a42fb8d..290de41f8569 100644 --- a/Source/DataSources/RectangleGraphics.js +++ b/Source/DataSources/RectangleGraphics.js @@ -212,7 +212,7 @@ define([ * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. * @memberof RectangleGraphics.prototype * @type {Property} - * @default ClassificationType.BOTH + * @default ClassificationType.TERRAIN */ classificationType : createPropertyDescriptor('classificationType'), diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index db75632e4f3a..f1c60d1e2acd 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -103,7 +103,7 @@ define([ * @param {Boolean} [options.releaseGeometryInstances=true] When true, the primitive does not keep a reference to the input geometryInstances to save memory. * @param {Boolean} [options.allowPicking=true] When true, each geometry instance will only be pickable with {@link Scene#pick}. When false, GPU memory is saved. * @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first. - * @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified. + * @param {ClassificationType} [options.classificationType=ClassificationType.TERRAIN] Determines whether terrain, 3D Tiles or both will be classified. * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be true on * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be false. @@ -208,9 +208,9 @@ define([ * * @type {ClassificationType} * - * @default ClassificationType.BOTH + * @default ClassificationType.TERRAIN */ - this.classificationType = defaultValue(options.classificationType, ClassificationType.BOTH); + this.classificationType = defaultValue(options.classificationType, ClassificationType.TERRAIN); /** * This property is for debugging only; it is not for production use nor is it optimized. *

diff --git a/Specs/Scene/GroundPrimitiveSpec.js b/Specs/Scene/GroundPrimitiveSpec.js index c1d4b9efafdc..e8ab745fe93a 100644 --- a/Specs/Scene/GroundPrimitiveSpec.js +++ b/Specs/Scene/GroundPrimitiveSpec.js @@ -542,7 +542,8 @@ defineSuite([ primitive = new GroundPrimitive({ geometryInstances : rectangleInstance, - asynchronous : false + asynchronous : false, + classificationType: ClassificationType.BOTH }); scene.camera.setView({ destination : rectangle }); @@ -582,7 +583,8 @@ defineSuite([ primitive = new GroundPrimitive({ geometryInstances : rectangleInstance, - asynchronous : false + asynchronous : false, + classificationType: ClassificationType.BOTH }); scene.camera.setView({ destination : rectangle });