GithubHelp home page GithubHelp logo

Comments (5)

skypjack avatar skypjack commented on August 24, 2024 1

Yeah, I don't see how an example for the wrong tool can help.
You first need to read the documentation for that tool. Then you want to understand if it's a good fit for your problem. Finally, an example will tell you more about the API and the correct usage.
My gut feeling is that you don't know what a group is for. I can write thousands example but they won't help here. For example:

this doesn't work and I don't know how to delare cameras as a group of camera components

Why do you think a group is the way to go? Perhaps because the name group sounds quite close to what you would call the class you need? I strongly suspect EnTT groups are not what you're looking for because they do a different thing (carefully describred in the documentation).

Let's try a different approach. What problem are you facing? Can you describe it in details?
Once we know what you want to solve and understand what the right tool is, writing an example will be easier and faster than writing an example for a tool that isn't what you're looking for.

from entt.

skypjack avatar skypjack commented on August 24, 2024

I mean, you can find how groups work and what their purpose is in the documentation. Have you already checked it? What you're trying to do tells me that you didn't probably.
In this case, I don't know how an example could help. You would never find an example regarding groups to do what you want and you would still open an issue saying that the examples are not clear.
The documentation is there for a reason. That's the first thing to read. Later, when we know what the tools are for, then an example can be useful. My two cents. 🤷‍♂️

from entt.

MariwanJ avatar MariwanJ commented on August 24, 2024

Sorry, but documentation without examples is hard to read. For me, could be personal. I must see some examples before understanding the documentations. If you have time, please add some examples for each api you have. that will help a lot.

from entt.

Innokentiy-Alaytsev avatar Innokentiy-Alaytsev commented on August 24, 2024

First, your code snippet is wrong. entt::basic_group is a template class and I'm not sure that you can construct a group from a view.

Second, I believe your approach with shared pointers is not viable at least for EnTT. Entities are simple numbers with no other payload attached to them (unless you define your own entity type). If you need to store entities, just store them.

Third, what do you mean by "if you have entities that you use often, you wouldn't choose to mix them with thousands of other entities"? If you need to filter entities by trait, attach a tag-like component to them and use views for accessing them (or groups if you find out that the added performance worth it considering the "price" of using groups). If you have "few" entities that you use and you don't want to use components for filtering them, then, again, just store them in a struct or any container.

As for examples, read Micheles blog regarding EnTT and ECS, look through unit tests, look at the projects that are linked in README as using EnTT.

from entt.

skypjack avatar skypjack commented on August 24, 2024

Adding examples is on the roadmap, no need to keep another issue around for that.
On the other side, I assume that the original problem was solved somehow since the issue is starving.
I'll close this issue as invalid but feel free to comment further if you have still problems. Thanks. 👍

from entt.

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.