From 13472e7f80680f6f042937d77858b1bb18b39844 Mon Sep 17 00:00:00 2001 From: bobsayshilol Date: Mon, 12 Dec 2022 20:14:47 +0000 Subject: [PATCH] [TEMP] Add a hack to enable this from the latest mediapose-vr release Setting a -ve "additional smoothing" will enable the velocity based tracking and >1 will disable it again, and this will persist until you change it to a value outside of [0,1). --- driver_files/src/Driver/TrackerDevice.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/driver_files/src/Driver/TrackerDevice.cpp b/driver_files/src/Driver/TrackerDevice.cpp index cacabae0..a44a362c 100644 --- a/driver_files/src/Driver/TrackerDevice.cpp +++ b/driver_files/src/Driver/TrackerDevice.cpp @@ -37,16 +37,19 @@ void ExampleDriver::TrackerDevice::reinit(int msaved, double mtime, double msmoo if (msaved < 5) //prevent having too few values to calculate linear interpolation, and prevent crash on 0 msaved = 5; - if (msmooth < 0) + if (msmooth < 0) { msmooth = 0; - else if (msmooth > 0.99) + use_velocity = true; + } else if (msmooth > 0.99) { msmooth = 0.99; + use_velocity = false; + } prev_positions.clear(); prev_positions.resize(msaved); max_time = mtime; smoothing = msmooth; - use_velocity = velocity; + //use_velocity = velocity; Log("Settings changed! " + std::to_string(msaved) + ' ' + std::to_string(mtime) + ' ' + std::to_string(msmooth) + ' ' + std::to_string(velocity)); }