From 53738d969854956207cec4e6f96286ffbe9000fc Mon Sep 17 00:00:00 2001 From: Vladimir Rutsky Date: Wed, 28 Dec 2016 19:50:44 +0300 Subject: [PATCH] raise DeveloperError if drillPick handing detected --- Source/Scene/Scene.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 221e9d5869dd..6d2d76c06786 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -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); @@ -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