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

Add width and height parameters to Scene.drillPick #6363

Closed
wants to merge 2 commits into from
Closed
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
9 changes: 6 additions & 3 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -3579,7 +3579,7 @@ define([
* @example
* var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
*/
Scene.prototype.drillPick = function(windowPosition, limit) {
Scene.prototype.drillPick = function(windowPosition, limit, width, height) {
// PERFORMANCE_IDEA: This function calls each primitive's update for each pass. Instead
// we could update the primitive once, and then just execute their commands for each pass,
// and cull commands for picked primitives. e.g., base on the command's owner.
Expand All @@ -3599,7 +3599,10 @@ define([
limit = Number.MAX_VALUE;
}

var pickedResult = this.pick(windowPosition);
var drillRectangleWidth = defaultValue(width, 3.0);
var drillRectangleHeight = defaultValue(height, drillRectangleWidth);

var pickedResult = this.pick(windowPosition, drillRectangleWidth, drillRectangleHeight);
while (defined(pickedResult) && defined(pickedResult.primitive)) {
result.push(pickedResult);
if (0 >= --limit) {
Expand Down Expand Up @@ -3627,7 +3630,7 @@ define([
pickedPrimitives.push(primitive);
}

pickedResult = this.pick(windowPosition);
pickedResult = this.pick(windowPosition, drillRectangleWidth, drillRectangleHeight);
}

// unhide everything we hid while drill picking
Expand Down