diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-16 23:32:48 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-16 23:32:59 +0200 |
commit | 16bb3e13dd2a7ed8fa3652e313d592dd81c73a07 (patch) | |
tree | 8bd2f3f275948cf9e19a92a6b9eabe65efbd0b96 /tracker-pt/ftnoir_tracker_pt.h | |
parent | 8fb85f858e85e5d0b2a217d9d31c68206266f987 (diff) |
tracker/pt: declare floating-point type size in one place
We want double precision for POSIT. It's best for the type to be set in
ope place without the need to go over everything while switching it back
and forth during tests.
Machine epsilon for float is very small as per
<https://en.wikipedia.org/wiki/Machine_epsilon>. Also see the absurdly
high epsilon of 1e-4 of POSIT that we've had. With floats, making the
epsilon lower resulted in change deltas flushing to zero. This typically
led to the translation Z value being very unstable in PT.
After the epsilon and data type size changes the Z value is stable.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.h')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index d3b96f1d..c9497df5 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -29,7 +29,7 @@ class TrackerDialog_PT; //----------------------------------------------------------------------------- // Constantly processes the tracking chain in a separate thread -class Tracker_PT : public QThread, public ITracker +class Tracker_PT : public QThread, public ITracker, private pt_types { static constexpr double pi = 3.14159265359; @@ -58,7 +58,7 @@ private: void set_command(Command command); void reset_command(Command command); - bool get_focal_length(float &ret); + bool get_focal_length(f& ret); QMutex camera_mtx; CVCamera camera; @@ -75,7 +75,7 @@ private: volatile bool ever_success; volatile unsigned char commands; - static constexpr float rad2deg = float(180/3.14159265); + static constexpr f rad2deg = f(180/3.14159265); //static constexpr float deg2rad = float(3.14159265/180); }; |