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 1 commit
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
Next Next commit
Add width and height parameters to Scene.drillPick
sir-chaos authored Mar 22, 2018
commit 9456716fdea4bc08a4e61ecf2e31f19b4f2a6ec2
9 changes: 6 additions & 3 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
@@ -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.
@@ -3598,8 +3598,11 @@ define([
if (!defined(limit)) {
limit = Number.MAX_VALUE;
}

var drillRectangleWidth = defaultValue(width, 3.0);
var drillRectangleHeight = defaultValue(height, drillRectangleWidth);

var pickedResult = this.pick(windowPosition);
var pickedResult = this.pick(windowPosition, drillRectangleWidth, drillRectangleHeight);
while (defined(pickedResult) && defined(pickedResult.primitive)) {
result.push(pickedResult);
if (0 >= --limit) {
@@ -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