]> git.localhorst.tv Git - blank.git/blobdiff - src/app.cpp
random walk test controller
[blank.git] / src / app.cpp
index 4a890d56a61f0cdc10bf5b7a7d9b5cfc3661d256..cfb16822897a01027da39d62c3624da6fe7fd52b 100644 (file)
@@ -17,12 +17,21 @@ Application::Application()
 , cam()
 , world()
 , interface(world)
+, test_controller(MakeTestEntity(world))
 , running(false) {
        GLContext::EnableVSync();
 
        glClearColor(0.0, 0.0, 0.0, 1.0);
 }
 
+Entity &Application::MakeTestEntity(World &world) {
+       Entity &e = world.AddEntity();
+       e.Position({ 0.0f, 0.0f, 0.0f });
+       e.SetShape(world.BlockTypes()[1]->shape, { 1.0f, 1.0f, 0.0f });
+       e.AngularVelocity(glm::quat(glm::vec3{ 0.00001f, 0.000006f, 0.000013f }));
+       return e;
+}
+
 
 void Application::RunN(size_t n) {
        Uint32 last = SDL_GetTicks();
@@ -116,6 +125,7 @@ void Application::HandleEvents() {
 
 void Application::Update(int dt) {
        interface.Update(dt);
+       test_controller.Update(dt);
        world.Update(dt);
 }