There is a problem with drillPickFromRayMostDetailed
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
### What happened?
When I load a 3dtileset using a new PrimitiveCollection, I can't pick the coordinates on the 3dtileset using drillPickFromRayMostDetailed. However, when I load the 3dtileset directly using the viewer.scene.primitives.add() method, I can pick the coordinates.
The following method fails to pick the coordinates.
```
const collection = new Cesium.PrimitiveCollection();
scene.primitives.add(collection); // Add collection
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
collection .add(tileset);
scene.drillPickFromRayMostDetailed(ray) => no Cesium3dtileset
```
Adding the 3dtileset directly using `viewer.scene.primitives.add` works.
```
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
scene.primitives.add(tileset );
scene.drillPickFromRayMostDetailed(ray) => yes Cesium3dtileset
```
### Reproduction steps
1.
2.
3.
...
### Sandcastle example
_No response_
### Environment
Browser:
CesiumJS Version:
Operating System:
### AI acknowledgment
- [ ] I used AI to generate this issue report.
- [ ] (If the above is checked) I have reviewed the AI-generated content before submitting.
Contributor guide
Research direction
Start by reproducing the two snippets with Cesium3DTileset, PrimitiveCollection, and scene.drillPickFromRayMostDetailed(ray), since no Sandcastle example or environment details are provided. Trace how drillPickFromRayMostDetailed traverses primitives and compare nested collection handling with direct scene.primitives.add(); done means the nested tileset is returned without breaking direct picking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100