Skip to content
New issue

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

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

Already on GitHub? # to your account

Picking on TileLayer should return more informations #1037

Closed
3 tasks
gliegard opened this issue Feb 20, 2019 · 1 comment
Closed
3 tasks

Picking on TileLayer should return more informations #1037

gliegard opened this issue Feb 20, 2019 · 1 comment

Comments

@gliegard
Copy link
Contributor

Picking on the TileLayer should returns

  • point
  • distance
  • face (with face.normal)

like other picking method.

Context

In StreetControls, it was hard to implement picking to detect ground.
I did a workaround using method view.getPickingPositionFromDepth to get to picked point on tile layer, and then compute the distance. But code would be clearer if the picking method for TileLayer was homogeneous with other picking method. For example :

this.view.pickObjectsAt(event, 0, this.buildingsLayer);

works normally, and return all picking information (point, distance, face, object...)

0: {distance: 10.782635729449, point: Vector3, object: Mesh, face: Face3, faceIndex: 5471, …}
1: {distance: 20.35449612122636, point: Vector3, object: Mesh, face: Face3, faceIndex: 5469, …}
2: {distance: 20.42226457707133, point: Vector3, object: Mesh, face: Face3, faceIndex: 5404, …}
3: {distance: 23.65226947256359, point: Vector3, object: Mesh, face: Face3, faceIndex: 5394, …}

this.view.pickObjectsAt(event, 0, this.view.tileLayer);

0: {object: TileMesh, layer: GlobeLayer}

Steps to Reproduce

In StreetControl, method pick,
Add log to see what view.pickObjectAt returns in each case, for building layer or for tile layer.

console.log(intersectsBuildings);
console.log(intersectsGround);

Expected Behavior

0: {distance: 10.782635729449, point: Vector3, object: Mesh, face: Face3, faceIndex: 5471, …}

Actual Behavior

0: {object: TileMesh, layer: GlobeLayer}

Possible Cause/Fix/Solution

Picking.pickTilesAt need to be improved

@jailln
Copy link
Contributor

jailln commented Oct 14, 2022

I modified the picking methods in #1881 so that their return is more homogeneous. Let me know if it fixes this issue.

@jailln jailln closed this as completed Nov 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants