Skip to content

Commit

Permalink
raise DeveloperError if drillPick handing detected
Browse files Browse the repository at this point in the history
  • Loading branch information
rutsky committed Dec 28, 2016
1 parent 0860630 commit 53738d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,7 @@ define([
limit = Number.MAX_VALUE;
}

var prevPickedResult = null;
var pickedResult = this.pick(windowPosition);
while (defined(pickedResult) && defined(pickedResult.primitive)) {
result.push(pickedResult);
Expand Down Expand Up @@ -2731,7 +2732,16 @@ define([
pickedPrimitives.push(primitive);
}

prevPickedResult = pickedResult;
pickedResult = this.pick(windowPosition);

//>>includeStart('debug', pragmas.debug);
if (pickedResult === prevPickedResult) {
throw new DeveloperError(
'Failed to hide picked object. ' +
'May be result of improperly handled picking pass by one of the objects.');
}
//>>includeEnd('debug');
}

// unhide everything we hid while drill picking
Expand Down

0 comments on commit 53738d9

Please sign in to comment.