MCPcopy Create free account
hub / github.com/alecthomas/entityx / update

Method update

examples/example.cc:126–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124// Updates a body's position and rotation.
125struct BodySystem : public ex::System<BodySystem> {
126 void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override {
127 ex::ComponentHandle<Body> body;
128 for (ex::Entity entity : es.entities_with_components(body)) {
129 body->position += body->direction * static_cast<float>(dt);
130 body->rotation += body->rotationd * dt;
131 }
132 };
133};
134
135

Callers 1

mainFunction · 0.45

Calls 1

Tested by

no test coverage detected