Skip to content

Commit

Permalink
Merge pull request #6017 from AnalyticalGraphicsInc/drill-pick
Browse files Browse the repository at this point in the history
Fix drill picking ground primitives
  • Loading branch information
Tom Fili authored Nov 30, 2017
2 parents 8fedf99 + 46f921c commit 70aa664
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Change Log
* Added ability to support touch event in Imagery Layers Split Sandcastle example. [#5948](https://github.com/AnalyticalGraphicsInc/cesium/pull/5948)
* Added a new `@experimental` tag to the documentation. A small subset of the Cesium API tagged as such are subject to breaking changes without deprecation. See the [Coding Guide](https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/CodingGuide#deprecation-and-breaking-changes) for further explanation. [#6010](https://github.com/AnalyticalGraphicsInc/cesium/pull/6010)
* Moved terrain and imagery credits to a lightbox that pops up when you click a link in the onscreen credits [#3013](https://github.com/AnalyticalGraphicsInc/cesium/issues/3013)
* Fixed a bug where drill picking a polygon clamped to ground would cause the browser to hang. [#5971](https://github.com/AnalyticalGraphicsInc/cesium/issues/5971)

### 1.39 - 2017-11-01

Expand Down
1 change: 1 addition & 0 deletions Source/Scene/ClassificationPrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ define([

if (classificationPrimitive._primitive.allowPicking) {
var vsPick = ShaderSource.createPickVertexShaderSource(vs);
vsPick = Primitive._appendShowToShader(primitive, vsPick);
vsPick = Primitive._updatePickColorAttribute(vsPick);

var pickVS = new ShaderSource({
Expand Down
19 changes: 19 additions & 0 deletions Specs/Scene/ClassificationPrimitiveSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,25 @@ defineSuite([
});
});

it('drill picking', function() {
if (!ClassificationPrimitive.isSupported(scene)) {
return;
}

primitive = new ClassificationPrimitive({
geometryInstances : boxInstance,
asynchronous : false
});

verifyClassificationPrimitiveRender(primitive, boxColor);

expect(scene).toDrillPickAndCall(function(pickedObjects) {
expect(pickedObjects.length).toEqual(2);
expect(pickedObjects[0].primitive).toEqual(primitive);
expect(pickedObjects[1].primitive).toEqual(depthPrimitive._primitive);
});
});

it('does not pick when allowPicking is false', function() {
if (!ClassificationPrimitive.isSupported(scene)) {
return;
Expand Down

0 comments on commit 70aa664

Please sign in to comment.