- e.AngularVelocity(rot);
- Controller *ctrl;
- if (random()) {
- ctrl = new RandomWalk(e, random.Next<std::uint64_t>());
- e.Name("walker");
- } else {
- ctrl = new Chaser(world, e, reference);
- e.Name("chaser");
- }
- controllers.emplace_back(ctrl);
+ e.SetController(new AIController(world, e));
+ e.Name("spawned");
+ e.Ref();
+ entities.emplace_back(&e);