#include #include #include #include #include TEST(simple_velocity_2d, basic_run) { MM::Scene scene; // setup v system auto& org = scene.ctx().emplace(); org.emplace<&MM::Systems::simple_positional_velocity>("simple_positional_velocity"); org.emplace<&MM::Systems::simple_rotational_velocity>("simple_rotational_velocity"); auto graph = org.graph(); // setup delta auto& time_ctx = scene.ctx().emplace(1.f/60.f, 1.f); time_ctx.tickDelta = 1.f/60.f * time_ctx.deltaFactor; // setup test entity auto e = scene.create(); auto& p = scene.emplace(e); auto& r = scene.emplace(e); auto& vp = scene.emplace(e); auto& vr = scene.emplace(e); p.pos = { 0.f, 0.f }; r.rot = 0.f; vp.pos_vel = { 1.f, 1.f }; vr.rot_vel = 0.f; // run all systems for (auto&& vert : graph) { vert.callback()(vert.data(), scene); } ASSERT_EQ(p.pos.x, 1.f * 1.f/60.f); }