Hello Cesium community
Does anyone know of any method to make the camera collide with a 3D Tile that has opacity less than 1 (transparent)?
The camera only collides with totally solid objects, but I need to know if someone has managed to make the camera collide with 3DTile objects that represent for example glass buildings.
The solution depends on your application. If you require highly accurate collision detection then the following idea might not work. Could you please share a little bit more about your intended use case? What functionality are you looking for?
Cesium3DTile has a member boundingSphere. The bonding sphere is a metric derived from the tile’s bounding volume. The Camera object has the function distanceToBoundingSphere(boundingSphere) which returns the distance from the camera to the front of the bounding sphere. If this distance is roughly 0, then we can assume that the camera is colliding with the tile. A similar idea was suggested in this forum post:
Let me know if you have any questions or concerns.
Tanks @sam.rothstein , I will check these options.
distanceToBoundingSphere(boundingSphere) may work fine to me, because I don’t require highly accurate collision detection.