Giter Club home page Giter Club logo

Comments (4)

xeolabs avatar xeolabs commented on August 19, 2024

Yeah this isn't even implemented within the renderer (Renderer.js), yet it's still documented on the Scene.pick method.

To mask which objects get picked, the best way, before picking, would be for application code to

1.save which scene objects are not pickable
2. iterate over the scene objects and set pickable true on those objects that you want to pick, and false for others
3. do the pick
4. restore the state saved in (1)

The thing is, setting pickable on all scene objects could be expensive for big models, if done continuously, on each pick, if continuously picking,

Therefore I think it's best to put that in the hands of the application code, which might set those pickable flags one time before doing many of picking operations, and then restore those pickable flags after all the picking is finished.

Then I would remove the includeEntities parameter from Scene.pick() documentation.

Does that make sense?

from xeokit-sdk.

g-rodigy avatar g-rodigy commented on August 19, 2024

1.save which scene objects are not pickable

What mean save scene? Iterate objecst and set pickable to false/true on load model, this is only one way?

from xeokit-sdk.

xeolabs avatar xeolabs commented on August 19, 2024

1.Record the IDs of all objects for which pickable is false
2. Iterate over all objects and set pickable false on the ones you dont want to pick, and true on the ones you do want to pick
3. do the pick, or many picks
4. iterate over all objects, set pickable true, except for the ones whose IDs you recorded in (1), which you set false

Because xeokit relies on batching the objects in order to achieve performance rendering for large numbers of objects, we must enable/disable picking for the objects like this. It's a performance trade off we can't avoid.

(1-2) is setting up for masked picking, (4) is cleaning up after masked picking.

from xeokit-sdk.

xeolabs avatar xeolabs commented on August 19, 2024

Removed includeEntities and excludeEntities from documentation - they were not supposed to be there: 535130c

from xeokit-sdk.

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.