NASA-AMMOS / 3DTilesRendererJS

Renderer for 3D Tiles in Javascript using three.js
https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/mars.html
Apache License 2.0
1.6k stars 286 forks source link

Utility: Add utility for automatically updating positions on tile set surface #825

Open gkjohnson opened 3 days ago

gkjohnson commented 3 days ago

Add a utility for querying when tiles change and only perform raycasts when needed. Ie when a tile that might be hit toggles in visibility. This can be used to automatically settle objects on a tile set surface.

More query capabilities could be provided, as well, when tiles change. Like tiles that fade in and out in a box or sphere bounds, etc. Useful for any kinds of surface projections.

Should account for multiple tile sets, static geometry from user.

gkjohnson commented 2 days ago

Working draft:

class QueryManager {

  /* Sets the scene that is raycast against */
  setScene( scene: Object3D | Array<Object3D> ): void;

  /* Registers a ray or query to continuously check for updates */
  registerRayQuery( ray: Ray, updateCallback: ( hit: HitInfo ) => {} ): Number;
  registerLatLonQuery( lat: Number, lon: Number, updateCallback: ( hit: HitInfo ) => {} ): Number;

  /* Function for unregistering the callback */
  unregisterQuery( index: Number ): void;

}

Query logic update:

Problems:

Perhaps we can limit the capability to only static objects.