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

Cesium - one object in two tiles - question about batchId #721

Open
JacekTomaszewski opened this issue Nov 10, 2022 · 1 comment
Open

Cesium - one object in two tiles - question about batchId #721

JacekTomaszewski opened this issue Nov 10, 2022 · 1 comment

Comments

@JacekTomaszewski
Copy link

Hello,
I’m generating tileset with object splitted between two tiles. They are represented as two different objects (2x Cesium3DTileFeature), having the same batchId & featureId, but they are placed on different 3DTile.

1
2

Is it achievable to merge them to one object? Or is it any mechanism in cesium or extension to treat them as one object, for example at picking?

@javagl
Copy link
Contributor

javagl commented Nov 21, 2022

Generally, and a bit roughly speaking, the question of "What is one 'feature'?" can be answered with "Everything that has the same feature ID". On a slightly more technical level, I could ask some questions: Where and how are you assigning the IDs? Are you creating these as B3DM- or glTF files? Are you using the 3D Metadata format (with EXT_structural_metadata?)

In terms of the expected behavior: I think that there is no built-in mechanism in CesiumJS to create a single (truly unique) instance of Cesium3DTileFeature for all objects that have the same feature ID. (For a variety of reasons - I could describe them on a conceptual level, and others might go deeper into technical details here).

If your goal, on the side of the application, is to have a single object for each feature ID, then it will probably be necessary to implement this sort of mapping manually in the application itself. For example, when referring to picking, it sounds like the goal is to have something like

  const picked = viewer.scene.pick(movement.endPosition);
  const feature = obtainFeature(picked);
  const myUniqueObject = getUniqueObject(feature.featureId);
  ...

where getUniqueObject makes sure that there is one object for each featureId (even when this featureId may the the same for different Cesium3DTileFeature objects). If this is the intention, then there are some architectural questions related to that, but I'd like to make sure that I understood the question correctly so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants