Git Product home page Git Product logo

Comments (2)

ilpincy avatar ilpincy commented on August 18, 2024

[...] This works by using the anchor's index as a key to a std::unordered_map inside a given Dynamics3d physics model. The map then provides the callback function with the positions and orientations that I need to send back to the space.

This looks to me like a sensible approach. If the number of elements in the map is not large, you might find that using a custom bucket-based implementation is faster. I'd go down this road only in a second moment, and if really necessary.

Perhaps it is possible to relax the requirements of / overload RegisterAnchorMethod to take a function object? At the moment this is not possible:
I designed the callback to strictly be a method of the physics model. This makes it more memory efficient and easier to write. Using a functor would be more flexible, but less efficient.

If you are really concerned about speed, you might experiment with having a single, standard callback for every anchor (callback as it is defined now), but then within the callback dispatch on the right functor defined by you. This kinda defeats the purpose of the anchors as they are designed now, but it could work.

from argos3.

allsey87 avatar allsey87 commented on August 18, 2024

Ok, I will use the std::unordered_map approach for now. Thanks for the feedback!

from argos3.

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.