Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix drill picking ground primitives #6017

Merged
merged 4 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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