immersive-web / hit-test

Home Page:https://immersive-web.github.io/hit-test/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can HitResult have an id for the underlying geometry it hit?

blairmacintyre opened this issue · comments

For most platforms, the result of a hit test will likely be against some native plane or mesh that the system knows about.

When a hit intersects with a piece of system geometry, it would be very useful to have an id so that future hits can be tested to see if they are intersecting the same underlying object. For example, I want to use hitTest to drag a reticle with my finger, but want to restrict the reticle to stay on the same piece of geometry as when the drag started, if possible.

We could define the ID as optional (i.e., if a hit is against something that has not been added to the system world model, such as ARKit hitting against a feature point that isn't in a plane yet), and systems that don't break down the world into stable pieces, they could return a single ID (e.g., "the-one-and-only-world-mesh") at their discretion.

Closing - let's cover it in issue #23.