Skip to content

Commit

Permalink
Merge pull request #6608 from likangning93/fixDynamicGeometryOnTerrain
Browse files Browse the repository at this point in the history
fix classification type not getting propagated properly for dynamic entities on terrain
  • Loading branch information
Hannah authored May 22, 2018
2 parents dbc6710 + f6b7a78 commit b6e9273
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Apps/Sandcastle/gallery/Rectangle.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
coordinates: Cesium.Rectangle.fromDegrees(-92.0, 30.0, -76.0, 40.0),
material: '../images/Cesium_Logo_Color.jpg',
rotation: new Cesium.CallbackProperty(getRotationValue, false),
stRotation: new Cesium.CallbackProperty(getRotationValue, false)
stRotation: new Cesium.CallbackProperty(getRotationValue, false),
classificationType : Cesium.ClassificationType.TERRAIN
}
});

Expand Down
3 changes: 2 additions & 1 deletion Source/DataSources/DynamicGeometryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ define([
geometryInstances : this._geometryUpdater.createFillGeometryInstance(time),
appearance : appearance,
asynchronous : false,
shadows : shadows
shadows : shadows,
classificationType : this._geometryUpdater.classificationTypeProperty.getValue(time)
}), Property.getValueOrUndefined(this._geometryUpdater.zIndex, time));
} else {
options.vertexFormat = appearance.vertexFormat;
Expand Down
21 changes: 21 additions & 0 deletions Specs/createGeometryUpdaterGroundGeometrySpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define([
'DataSources/ColorMaterialProperty',
'DataSources/ConstantProperty',
'DataSources/SampledProperty',
'Scene/ClassificationType',
'Scene/GroundPrimitive',
'Scene/PrimitiveCollection'
], function(
Expand All @@ -12,6 +13,7 @@ define([
ColorMaterialProperty,
ConstantProperty,
SampledProperty,
ClassificationType,
GroundPrimitive,
PrimitiveCollection) {
'use strict';
Expand Down Expand Up @@ -154,6 +156,25 @@ define([
dynamicUpdater.destroy();
updater.destroy();
});

it('dynamic updater on terrain propagates classification type', function() {
var entity = createDynamicEntity();
entity[geometryPropertyName].classificationType = ClassificationType.BOTH;

var updater = new Updater(entity, getScene());
var primitives = new PrimitiveCollection();
var groundPrimitives = new PrimitiveCollection();
var dynamicUpdater = updater.createDynamicUpdater(primitives, groundPrimitives);

dynamicUpdater.update(time);

if (GroundPrimitive.isSupported(getScene())) {
expect(groundPrimitives.get(0).classificationType).toEqual(ClassificationType.BOTH);
}

dynamicUpdater.destroy();
updater.destroy();
});
}

return createGeometryUpdaterGroundGeometrySpecs;
Expand Down

0 comments on commit b6e9273

Please sign in to comment.