Giter Site home page Giter Site logo

Comments (4)

bialpio avatar bialpio commented on May 29, 2024

Is there anything preventing you to store plane objects into a map now? Plane objects don’t carry an ID, but there is no reason why the application couldn’t add it:

let map = …;  // map to store the planes
let plane = …;   // plane obtained from some xrFrame.worldInformation

plane.id = getNextId(); // function that creates UUID or something
map.set(plane.id, plane);

This is possible because we guarantee that plane in frame N is represented by the same plane object in frame N+1, so the application won’t lose additional properties that it added to plane objects.

from real-world-geometry.

blairmacintyre avatar blairmacintyre commented on May 29, 2024

Unpacking a bit.

Plane objects don't carry an ID

Do you mean ARCore plane objects, or the design you posted here? Your design proposal is just that, a proposal, so plane objects could carry an id; the point of my post was to suggest that. Why would we force every app to include code like that if they don't need to, if it's obviously useful?

This is possible because we guarantee that plane in frame N is represented by the same plane object in frame N+1, so the application won’t lose additional properties that it added to plane objects.

I don't recall seeing this in the proposal, and it seems like a pretty significant guarantee. It may very well be that we want to make that guarantee, but it's not obvious we do.

Is it typically the case that objects returned from native APIs have such a guarantee, and that these objects can have data added to them?

from real-world-geometry.

bialpio avatar bialpio commented on May 29, 2024

Do you mean ARCore plane objects, or the design you posted here?

Both (ARCore does not expose plane ID, although the address it returns is unique).

Why would we force every app to include code like that if they don't need to, if it's obviously useful?

My understanding is that it is not really useful due to the guarantee about maintaining the identity of the plane objects. Exposing IDs might be useful to introduce a way to decorate plane objects with additional data (by inserting the additional data to a map keyed with plane ID), but this is not needed if we just allow attaching objects to them (ex. plane.context = {... object with everything you might want to store with a plane ...}. I don’t really see another use for an ID, but I might be missing something here. Added benefit is that the application does not need to maintain the “plane ID to something” map.

Is it typically the case that objects returned from native APIs have such a guarantee, and that these objects can have data added to them?

I don’t think JavaScript cares about where the object came from, apps can add properties to it at runtime. As for other examples that already give this guarantee, anything that is annotated as [SameObject] has that guarantee - one example is XRSession’s renderState (https://immersive-web.github.io/webxr/#xrsession-interface).

from real-world-geometry.

bialpio avatar bialpio commented on May 29, 2024

Closing stale issue - I'm leaning towards omitting placing IDs since the objects we're returning can be updated in place (so triple-equals comparison will work when checking if object we got in rAF1 is the same as the one in rAF2).

from real-world-geometry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.