Cesium - one object in two tiles - question about batchId
JacekTomaszewski opened this issue · 1 comments
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.
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?
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.