Open gkjohnson opened 1 month 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.
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.