updated example in the README file (close #209)
This commit is contained in:
@@ -113,7 +113,7 @@ struct velocity {
|
||||
float dy;
|
||||
};
|
||||
|
||||
void update(entt::registry<> ®istry) {
|
||||
void update(entt::registry ®istry) {
|
||||
auto view = registry.view<position, velocity>();
|
||||
|
||||
for(auto entity: view) {
|
||||
@@ -128,8 +128,8 @@ void update(entt::registry<> ®istry) {
|
||||
}
|
||||
}
|
||||
|
||||
void update(std::uint64_t dt, entt::registry<> ®istry) {
|
||||
registry.view<position, velocity>().each([dt](const auto, auto &pos, auto &vel) {
|
||||
void update(std::uint64_t dt, entt::registry ®istry) {
|
||||
registry.view<position, velocity>().each([dt](auto &pos, auto &vel) {
|
||||
// gets all the components of the view at once ...
|
||||
|
||||
pos.x += vel.dx * dt;
|
||||
|
||||
2
TODO
2
TODO
@@ -18,6 +18,6 @@
|
||||
* empty components model allows for shared components and prefabs unity-like
|
||||
- each with entity return the shared component multiple times, one per entity that refers to it
|
||||
- each components only return actual component, so shared components are returned only once
|
||||
* add a sort of "fast each" for when users know they are not to add/remove components, it can use directly raw access and improve even further performance
|
||||
* types defined at runtime that refer to the same compile-time type (but to different pools) are possible, the library is almost there
|
||||
* add take functionality, eg registry.take(entity, other); where it takes the entity and all its components from registry and move them to other
|
||||
* add unset for context variables
|
||||
|
||||
Reference in New Issue
Block a user