Skip to content

Commit

Permalink
Merge pull request #4255 from AnalyticalGraphicsInc/dynamic-geometry
Browse files Browse the repository at this point in the history
Fix dynamic entity geometry on terrain
  • Loading branch information
Hannah authored Aug 30, 2016
2 parents 0909d00 + 86225e1 commit 548b999
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Change Log
* Added `GeocoderViewModel.keepExpanded` which when set to true will always keep the Geocoder in its expanded state.
* Added support for `INT` and `UNSIGNED_INT` in `ComponentDatatype`.
* Added `ComponentDatatype.fromName` for getting a `ComponentDatatype` from its name.
* Fixed a crash caused by draping dynamic geometry over terrain. [#4255](https://github.com/AnalyticalGraphicsInc/cesium/pull/4255)

### 1.24 - 2016-08-01

Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/GeometryVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ define([
}

this._groundColorBatch = new StaticGroundGeometryColorBatch(groundPrimitives);
this._dynamicBatch = new DynamicGeometryBatch(primitives);
this._dynamicBatch = new DynamicGeometryBatch(primitives, groundPrimitives);

this._batches = this._outlineBatches.concat(this._closedColorBatches, this._closedMaterialBatches, this._openColorBatches, this._openMaterialBatches, this._groundColorBatch, this._dynamicBatch);

Expand Down
26 changes: 26 additions & 0 deletions Specs/DataSources/GeometryVisualizerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,32 @@ defineSuite([
visualizer.destroy();
});

it('Creates and removes dynamic geometry on terrain ', function() {
var objects = new EntityCollection();
var visualizer = new GeometryVisualizer(EllipseGeometryUpdater, scene, objects);

var ellipse = new EllipseGraphics();
ellipse.semiMajorAxis = new SampledProperty(Number);
ellipse.semiMajorAxis.addSample(time, 2);
ellipse.semiMinorAxis = new ConstantProperty(1);
ellipse.material = new ColorMaterialProperty();

var entity = new Entity();
entity.position = new ConstantPositionProperty(new Cartesian3(1234, 5678, 9101112));
entity.ellipse = ellipse;
objects.add(entity);

scene.initializeFrame();
expect(visualizer.update(time)).toBe(true);
scene.render(time);
objects.remove(entity);
scene.initializeFrame();
expect(visualizer.update(time)).toBe(true);
scene.render(time);
expect(scene.primitives.length).toBe(0);
visualizer.destroy();
});

it('Constructor throws without type', function() {
var objects = new EntityCollection();
expect(function() {
Expand Down

0 comments on commit 548b999

Please sign in to comment.