From 372874309543e78b26472f89125d11f8a19f9e88 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 6 Mar 2024 00:05:56 +0100 Subject: test/critter: don't stop iterating on fractional movement --- test/critter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/critter.cpp b/test/critter.cpp index e75be7d9..3f13a87f 100644 --- a/test/critter.cpp +++ b/test/critter.cpp @@ -112,6 +112,7 @@ bool run(world& w, const function_view& make_dt, Ns time{0}; auto last_pos = npc.position(); + auto last_delta = npc.delta; uint32_t i; if (!start.quiet) [[unlikely]] @@ -140,8 +141,9 @@ bool run(world& w, const function_view& make_dt, fm_assert(dt <= Second * 1000); npc.update_movement(index, dt, start.rotation); const auto pos = npc.position(); - const bool same_pos = pos == last_pos; + const bool same_pos = pos == last_pos && npc.delta == last_delta; last_pos = pos; + last_delta = npc.delta; time += dt; @@ -300,7 +302,7 @@ void test_app::test_critter() test1("dt=100 accel=2", constantly(Millisecond * 100.0 ), 2); // test1("dt=16.667 accel=0.5", constantly(Millisecond * 16.667),0.5); // todo! fix this! test1("dt=100 accel=0.5", constantly(Millisecond * 100.0 ), 0.5); - //test1("dt=16.667 ms accel=1", constantly(Millisecond * 16.667), 1); // todo! fix this! + test1("dt=16.667 ms accel=1", constantly(Millisecond * 16.667), 1); // todo! fix this! test2("dt=33.334 accel=1", constantly(Millisecond * 33.334), 1); test2("dt=33.334 accel=2", constantly(Millisecond * 33.334), 2); test2("dt=33.334 accel=5", constantly(Millisecond * 33.334), 5); -- cgit v1.2.3