From 96a43a8095612e777e6349c28ba35a17f2c5c053 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Thu, 5 Jun 2014 13:07:40 -0400 Subject: [PATCH 1/3] Add material support for DynamicPath Replaced `color`, `outlineColor`, and `outlineWidth` in `DynamicPath` with a `material` property. This allows data sources to use materials other than PolylineOutline for paths. CZML is not impacted by this change and doesn't have this ability yet, that will be addressed in a future pull. --- CHANGES.md | 1 + Source/DynamicScene/CzmlDataSource.js | 36 ++++++++++++++++--- Source/DynamicScene/DynamicPath.js | 28 +++------------ Source/DynamicScene/DynamicPathVisualizer.js | 22 +++--------- Specs/DynamicScene/CzmlDataSourceSpec.js | 16 ++++----- Specs/DynamicScene/DynamicPathSpec.js | 36 ++++++------------- .../DynamicScene/DynamicPathVisualizerSpec.js | 15 ++++---- 7 files changed, 68 insertions(+), 86 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3951886ed8bc..845b4d68fc94 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Beta Releases * Renamed `Simon1994PlanetaryPositions` functions `ComputeSunPositionInEarthInertialFrame` and `ComputeMoonPositionInEarthInertialFrame` to `computeSunPositionInEarthInertialFrame` and `computeMoonPositionInEarthInertialFrame`, respectively. * Replaced `Scene.scene2D.projection` property with read-only `Scene.mapProjection`. Set this with the `mapProjection` option for the `Viewer`, `CesiumWidget`, or `Scene` constructors. * `Scene` constructor function now takes an `options` parameter instead of individual parameters. + * Replaced `color`, `outlineColor`, and `outlineWidth` in `DynamicPath` with a `material` property. * Added `Cesium.VERSION` to the combined `Cesium.js` file. * Fixed support for embedded resources in glTF models. diff --git a/Source/DynamicScene/CzmlDataSource.js b/Source/DynamicScene/CzmlDataSource.js index b43835ca02f3..d9da13a722ea 100644 --- a/Source/DynamicScene/CzmlDataSource.js +++ b/Source/DynamicScene/CzmlDataSource.js @@ -1159,14 +1159,42 @@ define([ dynamicObject.path = path = new DynamicPath(); } - processPacketData(Color, path, 'color', pathData.color, interval, sourceUri); - processPacketData(Number, path, 'width', pathData.width, interval, sourceUri); - processPacketData(Color, path, 'outlineColor', pathData.outlineColor, interval, sourceUri); - processPacketData(Number, path, 'outlineWidth', pathData.outlineWidth, interval, sourceUri); + //Since CZML does not support PolylineOutlineMaterial, we map it's properties into one. + var materialToProcess = path.material; + if (defined(interval)) { + var materialInterval; + var composite = materialToProcess; + if (!(composite instanceof CompositeMaterialProperty)) { + composite = new CompositeMaterialProperty(); + path.material = composite; + if (defined(materialToProcess)) { + materialInterval = Iso8601.MAXIMUM_INTERVAL.clone(); + materialInterval.data = materialToProcess; + composite.intervals.addInterval(materialInterval); + } + } + materialInterval = composite.intervals.findInterval(interval.start, interval.stop, interval.isStartIncluded, interval.isStopIncluded); + if (defined(materialInterval)) { + materialToProcess = materialInterval.data; + } else { + materialToProcess = new PolylineOutlineMaterialProperty(); + materialInterval = interval.clone(); + materialInterval.data = materialToProcess; + composite.intervals.addInterval(materialInterval); + } + } else if (!(materialToProcess instanceof PolylineOutlineMaterialProperty)) { + materialToProcess = new PolylineOutlineMaterialProperty(); + path.material = materialToProcess; + } + processPacketData(Boolean, path, 'show', pathData.show, interval, sourceUri); + processPacketData(Number, path, 'width', pathData.width, interval, sourceUri); processPacketData(Number, path, 'resolution', pathData.resolution, interval, sourceUri); processPacketData(Number, path, 'leadTime', pathData.leadTime, interval, sourceUri); processPacketData(Number, path, 'trailTime', pathData.trailTime, interval, sourceUri); + processPacketData(Color, materialToProcess, 'color', pathData.color, interval, sourceUri); + processPacketData(Color, materialToProcess, 'outlineColor', pathData.outlineColor, interval, sourceUri); + processPacketData(Number, materialToProcess, 'outlineWidth', pathData.outlineWidth, interval, sourceUri); } function processPoint(dynamicObject, packet, dynamicObjectCollection, sourceUri) { diff --git a/Source/DynamicScene/DynamicPath.js b/Source/DynamicScene/DynamicPath.js index 0911b7566b5f..c35a9a4351a6 100644 --- a/Source/DynamicScene/DynamicPath.js +++ b/Source/DynamicScene/DynamicPath.js @@ -56,25 +56,11 @@ define([ }, /** - * Gets or sets the {@link Color} {@link Property} specifying the the path's color. + * Gets or sets the {@link MaterialProperty} specifying the appearance of the path. * @memberof DynamicPath.prototype - * @type {Property} - */ - color : createDynamicPropertyDescriptor('color'), - - /** - * Gets or sets the {@link Color} {@link Property} specifying the the path's outline color. - * @memberof DynamicPath.prototype - * @type {Property} - */ - outlineColor : createDynamicPropertyDescriptor('outlineColor'), - - /** - * Gets or sets the numeric {@link Property} specifying the the path's outline width. - * @memberof DynamicPath.prototype - * @type {Property} + * @type {MaterialProperty} */ - outlineWidth : createDynamicPropertyDescriptor('outlineWidth'), + material : createDynamicPropertyDescriptor('material'), /** * Gets or sets the boolean {@link Property} specifying the path's visibility. @@ -122,11 +108,9 @@ define([ if (!defined(result)) { result = new DynamicPath(); } - result.color = this.color; + result.material = this.material; result.width = this.width; result.resolution = this.resolution; - result.outlineColor = this.outlineColor; - result.outlineWidth = this.outlineWidth; result.show = this.show; result.leadTime = this.leadTime; result.trailTime = this.trailTime; @@ -146,11 +130,9 @@ define([ } //>>includeEnd('debug'); - this.color = defaultValue(this.color, source.color); + this.material = defaultValue(this.material, source.material); this.width = defaultValue(this.width, source.width); this.resolution = defaultValue(this.resolution, source.resolution); - this.outlineColor = defaultValue(this.outlineColor, source.outlineColor); - this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth); this.show = defaultValue(this.show, source.show); this.leadTime = defaultValue(this.leadTime, source.leadTime); this.trailTime = defaultValue(this.trailTime, source.trailTime); diff --git a/Source/DynamicScene/DynamicPathVisualizer.js b/Source/DynamicScene/DynamicPathVisualizer.js index 6c2825a0c9ea..00790974d3e6 100644 --- a/Source/DynamicScene/DynamicPathVisualizer.js +++ b/Source/DynamicScene/DynamicPathVisualizer.js @@ -15,6 +15,7 @@ define([ '../Scene/SceneMode', './CompositePositionProperty', './ConstantPositionProperty', + './MaterialProperty', './SampledPositionProperty', './TimeIntervalCollectionPositionProperty' ], function( @@ -33,6 +34,7 @@ define([ SceneMode, CompositePositionProperty, ConstantPositionProperty, + MaterialProperty, SampledPositionProperty, TimeIntervalCollectionPositionProperty) { "use strict"; @@ -340,7 +342,6 @@ define([ return; } - var uniforms; if (!defined(pathVisualizerIndex)) { var unusedIndexes = this._unusedIndexes; var length = unusedIndexes.length; @@ -360,13 +361,12 @@ define([ material = Material.fromType(Material.PolylineOutlineType); polyline.material = material; } - uniforms = material.uniforms; + var uniforms = material.uniforms; Color.clone(Color.WHITE, uniforms.color); Color.clone(Color.BLACK, uniforms.outlineColor); uniforms.outlineWidth = 0; } else { polyline = this._polylineCollection.get(pathVisualizerIndex); - uniforms = polyline.material.uniforms; } polyline.show = true; @@ -381,21 +381,7 @@ define([ } polyline.positions = subSample(positionProperty, sampleStart, sampleStop, time, this._referenceFrame, maxStepSize, polyline.positions); - - property = dynamicPath._color; - if (defined(property)) { - uniforms.color = property.getValue(time, uniforms.color); - } - - property = dynamicPath._outlineColor; - if (defined(property)) { - uniforms.outlineColor = property.getValue(time, uniforms.outlineColor); - } - - property = dynamicPath._outlineWidth; - if (defined(property)) { - uniforms.outlineWidth = property.getValue(time); - } + polyline.material = MaterialProperty.getValue(time, dynamicPath._material, polyline.material); property = dynamicPath._width; if (defined(property)) { diff --git a/Specs/DynamicScene/CzmlDataSourceSpec.js b/Specs/DynamicScene/CzmlDataSourceSpec.js index 60b2fb79033b..719bba60a2d3 100644 --- a/Specs/DynamicScene/CzmlDataSourceSpec.js +++ b/Specs/DynamicScene/CzmlDataSourceSpec.js @@ -1305,11 +1305,11 @@ defineSuite([ var dynamicObject = dataSource.dynamicObjects.getObjects()[0]; expect(dynamicObject.path).toBeDefined(); - expect(dynamicObject.path.color.getValue(Iso8601.MINIMUM_VALUE)).toEqual(new Color(0.1, 0.1, 0.1, 0.1)); + expect(dynamicObject.path.material.color.getValue(Iso8601.MINIMUM_VALUE)).toEqual(new Color(0.1, 0.1, 0.1, 0.1)); expect(dynamicObject.path.width.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.width); expect(dynamicObject.path.resolution.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.resolution); - expect(dynamicObject.path.outlineColor.getValue(Iso8601.MINIMUM_VALUE)).toEqual(new Color(0.2, 0.2, 0.2, 0.2)); - expect(dynamicObject.path.outlineWidth.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.outlineWidth); + expect(dynamicObject.path.material.outlineColor.getValue(Iso8601.MINIMUM_VALUE)).toEqual(new Color(0.2, 0.2, 0.2, 0.2)); + expect(dynamicObject.path.material.outlineWidth.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.outlineWidth); expect(dynamicObject.path.leadTime.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.leadTime); expect(dynamicObject.path.trailTime.getValue(Iso8601.MINIMUM_VALUE)).toEqual(pathPacket.path.trailTime); expect(dynamicObject.path.show.getValue(Iso8601.MINIMUM_VALUE)).toEqual(true); @@ -1342,19 +1342,17 @@ defineSuite([ var dynamicObject = dataSource.dynamicObjects.getObjects()[0]; expect(dynamicObject.path).toBeDefined(); - expect(dynamicObject.path.color.getValue(validTime)).toEqual(new Color(0.1, 0.1, 0.1, 0.1)); expect(dynamicObject.path.width.getValue(validTime)).toEqual(pathPacket.path.width); expect(dynamicObject.path.resolution.getValue(validTime)).toEqual(pathPacket.path.resolution); - expect(dynamicObject.path.outlineColor.getValue(validTime)).toEqual(new Color(0.2, 0.2, 0.2, 0.2)); - expect(dynamicObject.path.outlineWidth.getValue(validTime)).toEqual(pathPacket.path.outlineWidth); expect(dynamicObject.path.leadTime.getValue(validTime)).toEqual(pathPacket.path.leadTime); expect(dynamicObject.path.trailTime.getValue(validTime)).toEqual(pathPacket.path.trailTime); expect(dynamicObject.path.show.getValue(validTime)).toEqual(true); + expect(dynamicObject.path.material.getValue(validTime).color).toEqual(new Color(0.1, 0.1, 0.1, 0.1)); + expect(dynamicObject.path.material.getValue(validTime).outlineColor).toEqual(new Color(0.2, 0.2, 0.2, 0.2)); + expect(dynamicObject.path.material.getValue(validTime).outlineWidth).toEqual(pathPacket.path.outlineWidth); - expect(dynamicObject.path.color.getValue(invalidTime)).toBeUndefined(); + expect(dynamicObject.path.material.getValue(invalidTime)).toBeUndefined(); expect(dynamicObject.path.width.getValue(invalidTime)).toBeUndefined(); - expect(dynamicObject.path.outlineColor.getValue(invalidTime)).toBeUndefined(); - expect(dynamicObject.path.outlineWidth.getValue(invalidTime)).toBeUndefined(); expect(dynamicObject.path.leadTime.getValue(invalidTime)).toBeUndefined(); expect(dynamicObject.path.trailTime.getValue(invalidTime)).toBeUndefined(); expect(dynamicObject.path.show.getValue(invalidTime)).toBeUndefined(); diff --git a/Specs/DynamicScene/DynamicPathSpec.js b/Specs/DynamicScene/DynamicPathSpec.js index 9f8df8a4d1d7..b17f71c3edd6 100644 --- a/Specs/DynamicScene/DynamicPathSpec.js +++ b/Specs/DynamicScene/DynamicPathSpec.js @@ -1,21 +1,19 @@ /*global defineSuite*/ defineSuite([ 'DynamicScene/DynamicPath', - 'Core/Color', + 'DynamicScene/ColorMaterialProperty', 'DynamicScene/ConstantProperty' ], function( DynamicPath, - Color, + ColorMaterialProperty, ConstantProperty) { "use strict"; /*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/ it('merge assigns unassigned properties', function() { var source = new DynamicPath(); - source.color = new ConstantProperty(Color.WHITE); + source.material = new ColorMaterialProperty(); source.width = new ConstantProperty(1); - source.outlineColor = new ConstantProperty(Color.WHITE); - source.outlineWidth = new ConstantProperty(1); source.show = new ConstantProperty(true); source.leadTime = new ConstantProperty(1); source.trailTime = new ConstantProperty(1); @@ -23,10 +21,8 @@ defineSuite([ var target = new DynamicPath(); target.merge(source); - expect(target.color).toBe(source.color); + expect(target.material).toBe(source.material); expect(target.width).toBe(source.width); - expect(target.outlineColor).toBe(source.outlineColor); - expect(target.outlineWidth).toBe(source.outlineWidth); expect(target.show).toBe(source.show); expect(target.leadTime).toBe(source.leadTime); expect(target.trailTime).toBe(source.trailTime); @@ -35,39 +31,31 @@ defineSuite([ it('merge does not assign assigned properties', function() { var source = new DynamicPath(); - source.color = new ConstantProperty(Color.WHITE); + source.material = new ColorMaterialProperty(); source.width = new ConstantProperty(1); - source.outlineColor = new ConstantProperty(Color.WHITE); - source.outlineWidth = new ConstantProperty(1); source.show = new ConstantProperty(true); source.leadTime = new ConstantProperty(1); source.trailTime = new ConstantProperty(1); source.resolution = new ConstantProperty(1); - var color = new ConstantProperty(Color.WHITE); + var color = new ColorMaterialProperty(); var width = new ConstantProperty(1); - var outlineColor = new ConstantProperty(Color.WHITE); - var outlineWidth = new ConstantProperty(1); var show = new ConstantProperty(true); var leadTime = new ConstantProperty(1); var trailTime = new ConstantProperty(1); var resolution = new ConstantProperty(1); var target = new DynamicPath(); - target.color = color; + target.material = color; target.width = width; - target.outlineColor = outlineColor; - target.outlineWidth = outlineWidth; target.show = show; target.leadTime = leadTime; target.trailTime = trailTime; target.resolution = resolution; target.merge(source); - expect(target.color).toBe(color); + expect(target.material).toBe(color); expect(target.width).toBe(width); - expect(target.outlineColor).toBe(outlineColor); - expect(target.outlineWidth).toBe(outlineWidth); expect(target.show).toBe(show); expect(target.leadTime).toBe(leadTime); expect(target.trailTime).toBe(trailTime); @@ -76,20 +64,16 @@ defineSuite([ it('clone works', function() { var source = new DynamicPath(); - source.color = new ConstantProperty(Color.WHITE); + source.material = new ColorMaterialProperty(); source.width = new ConstantProperty(1); - source.outlineColor = new ConstantProperty(Color.WHITE); - source.outlineWidth = new ConstantProperty(1); source.show = new ConstantProperty(true); source.leadTime = new ConstantProperty(1); source.trailTime = new ConstantProperty(1); source.resolution = new ConstantProperty(1); var result = source.clone(); - expect(result.color).toBe(source.color); + expect(result.material).toBe(source.material); expect(result.width).toBe(source.width); - expect(result.outlineColor).toBe(source.outlineColor); - expect(result.outlineWidth).toBe(source.outlineWidth); expect(result.show).toBe(source.show); expect(result.leadTime).toBe(source.leadTime); expect(result.trailTime).toBe(source.trailTime); diff --git a/Specs/DynamicScene/DynamicPathVisualizerSpec.js b/Specs/DynamicScene/DynamicPathVisualizerSpec.js index bb1484f4182c..8026b7adf4f4 100644 --- a/Specs/DynamicScene/DynamicPathVisualizerSpec.js +++ b/Specs/DynamicScene/DynamicPathVisualizerSpec.js @@ -11,6 +11,7 @@ defineSuite([ 'DynamicScene/ConstantProperty', 'DynamicScene/DynamicObjectCollection', 'DynamicScene/DynamicPath', + 'DynamicScene/PolylineOutlineMaterialProperty', 'DynamicScene/SampledPositionProperty', 'DynamicScene/TimeIntervalCollectionPositionProperty', 'Specs/createScene', @@ -27,6 +28,7 @@ defineSuite([ ConstantProperty, DynamicObjectCollection, DynamicPath, + PolylineOutlineMaterialProperty, SampledPositionProperty, TimeIntervalCollectionPositionProperty, createScene, @@ -111,10 +113,11 @@ defineSuite([ var path = testObject.path = new DynamicPath(); path.show = new ConstantProperty(true); - path.color = new ConstantProperty(new Color(0.8, 0.7, 0.6, 0.5)); + path.material = new PolylineOutlineMaterialProperty(); + path.material.color = new ConstantProperty(new Color(0.8, 0.7, 0.6, 0.5)); + path.material.outlineColor = new ConstantProperty(new Color(0.1, 0.2, 0.3, 0.4)); + path.material.outlineWidth = new ConstantProperty(2.5); path.width = new ConstantProperty(12.5); - path.outlineColor = new ConstantProperty(new Color(0.1, 0.2, 0.3, 0.4)); - path.outlineWidth = new ConstantProperty(2.5); path.leadTime = new ConstantProperty(25); path.trailTime = new ConstantProperty(10); @@ -131,9 +134,9 @@ defineSuite([ expect(primitive.width).toEqual(testObject.path.width.getValue(updateTime)); var material = primitive.material; - expect(material.uniforms.color).toEqual(testObject.path.color.getValue(updateTime)); - expect(material.uniforms.outlineColor).toEqual(testObject.path.outlineColor.getValue(updateTime)); - expect(material.uniforms.outlineWidth).toEqual(testObject.path.outlineWidth.getValue(updateTime)); + expect(material.uniforms.color).toEqual(testObject.path.material.color.getValue(updateTime)); + expect(material.uniforms.outlineColor).toEqual(testObject.path.material.outlineColor.getValue(updateTime)); + expect(material.uniforms.outlineWidth).toEqual(testObject.path.material.outlineWidth.getValue(updateTime)); path.show = new ConstantProperty(false); visualizer.update(updateTime); From 681a2d118b9b08804cf74c871d415f4fc627abe1 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Thu, 5 Jun 2014 14:31:51 -0400 Subject: [PATCH 2/3] Changes after review. --- Source/DynamicScene/CzmlDataSource.js | 4 ++-- Source/DynamicScene/DynamicPath.js | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/DynamicScene/CzmlDataSource.js b/Source/DynamicScene/CzmlDataSource.js index d9da13a722ea..8b19a5814488 100644 --- a/Source/DynamicScene/CzmlDataSource.js +++ b/Source/DynamicScene/CzmlDataSource.js @@ -1159,7 +1159,7 @@ define([ dynamicObject.path = path = new DynamicPath(); } - //Since CZML does not support PolylineOutlineMaterial, we map it's properties into one. + //Since CZML does not support PolylineOutlineMaterial, we map its properties into one. var materialToProcess = path.material; if (defined(interval)) { var materialInterval; @@ -1321,7 +1321,7 @@ define([ dynamicObject.polyline = polyline = new DynamicPolyline(); } - //Since CZML does not support PolylineOutlineMaterial, we map it's properties into one. + //Since CZML does not support PolylineOutlineMaterial, we map its properties into one. var materialToProcess = polyline.material; if (defined(interval)) { var materialInterval; diff --git a/Source/DynamicScene/DynamicPath.js b/Source/DynamicScene/DynamicPath.js index c35a9a4351a6..c5cd06da2631 100644 --- a/Source/DynamicScene/DynamicPath.js +++ b/Source/DynamicScene/DynamicPath.js @@ -21,12 +21,8 @@ define([ * @constructor */ var DynamicPath = function() { - this._color = undefined; - this._colorSubscription = undefined; - this._outlineColor = undefined; - this._outlineColorSubscription = undefined; - this._outlineWidth = undefined; - this._outlineWidthSubscription = undefined; + this._material = undefined; + this._materialSubscription = undefined; this._show = undefined; this._showSubscription = undefined; this._width = undefined; From 575dac64da07892ecf07fd5f1201f3bbca397ffc Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Thu, 5 Jun 2014 15:35:29 -0400 Subject: [PATCH 3/3] Added a test for custom materials. --- .../DynamicScene/DynamicPathVisualizerSpec.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Specs/DynamicScene/DynamicPathVisualizerSpec.js b/Specs/DynamicScene/DynamicPathVisualizerSpec.js index 8026b7adf4f4..1f509fc032b7 100644 --- a/Specs/DynamicScene/DynamicPathVisualizerSpec.js +++ b/Specs/DynamicScene/DynamicPathVisualizerSpec.js @@ -11,6 +11,7 @@ defineSuite([ 'DynamicScene/ConstantProperty', 'DynamicScene/DynamicObjectCollection', 'DynamicScene/DynamicPath', + 'DynamicScene/PolylineGlowMaterialProperty', 'DynamicScene/PolylineOutlineMaterialProperty', 'DynamicScene/SampledPositionProperty', 'DynamicScene/TimeIntervalCollectionPositionProperty', @@ -28,6 +29,7 @@ defineSuite([ ConstantProperty, DynamicObjectCollection, DynamicPath, + PolylineGlowMaterialProperty, PolylineOutlineMaterialProperty, SampledPositionProperty, TimeIntervalCollectionPositionProperty, @@ -143,6 +145,42 @@ defineSuite([ expect(primitive.show).toEqual(testObject.path.show.getValue(updateTime)); }); + it('A custom material can be used.', function() { + var times = [new JulianDate(0, 0), new JulianDate(1, 0)]; + var updateTime = new JulianDate(0.5, 0); + var positions = [new Cartesian3(1234, 5678, 9101112), new Cartesian3(5678, 1234, 1101112)]; + + var dynamicObjectCollection = new DynamicObjectCollection(); + visualizer = new DynamicPathVisualizer(scene, dynamicObjectCollection); + + expect(scene.primitives.length).toEqual(0); + + var testObject = dynamicObjectCollection.getOrCreateObject('test'); + var position = new SampledPositionProperty(); + testObject.position = position; + position.addSamples(times, positions); + + var path = testObject.path = new DynamicPath(); + path.show = new ConstantProperty(true); + path.material = new PolylineGlowMaterialProperty(); + path.material.color = new ConstantProperty(new Color(0.8, 0.7, 0.6, 0.5)); + path.material.glowPower = new ConstantProperty(0.2); + path.width = new ConstantProperty(12.5); + path.leadTime = new ConstantProperty(25); + path.trailTime = new ConstantProperty(10); + + visualizer.update(updateTime); + + expect(scene.primitives.length).toEqual(1); + + var polylineCollection = scene.primitives.get(0); + var primitive = polylineCollection.get(0); + + var material = primitive.material; + expect(material.uniforms.color).toEqual(testObject.path.material.color.getValue(updateTime)); + expect(material.uniforms.glowPower).toEqual(testObject.path.material.glowPower.getValue(updateTime)); + }); + it('clear hides primitives.', function() { var times = [new JulianDate(0, 0), new JulianDate(1, 0)]; var updateTime = new JulianDate(0.5, 0);