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

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

Open
gkjohnson opened this issue Oct 22, 2024 · 1 comment
Milestone

Comments

@gkjohnson
Copy link
Contributor

gkjohnson commented Oct 22, 2024

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 gkjohnson added this to the v0.3.41 milestone Oct 22, 2024
@gkjohnson
Copy link
Contributor Author

gkjohnson commented Oct 23, 2024

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:

  • Perform initial query
  • If a tile geometry was hit then check for tile visibility change and requery
  • If a new tile is added then check if its bounds would intersect the ray and requery

Problems:

  • Dynamic objects cannot be accounted for without querying every frame.
  • If there are multiple tile sets we need to query against all of them as soon as they're added to check if tiles are hidden or shown.

Perhaps we can limit the capability to only static objects.

@gkjohnson gkjohnson modified the milestones: v0.3.41, v0.3.42 Oct 30, 2024
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

1 participant