From 3c30242ee5f92ee5174cd2d91f3ee4f1e91d7785 Mon Sep 17 00:00:00 2001 From: GO63-samara Date: Sun, 21 Jun 2020 22:15:20 +0400 Subject: Hamilton filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new Hamilton filter. Hamilton Filter Key Features: - Instead of square, round (spherical) floating dead zones and smoothing areas are applied. Due to this, the angular size of these zones does not change when the Pitch angle changes. Diagonally rotations is as easy as moving along the Yaw and Pitch axes. - Rotations are not filtered by independent coordinates, but comprehensively, in 3D space. Rotations and movements are more natural. There are no view jumps at the borders of +/- 180 degrees. - The possibility of increasing the smoothing of rotations when zooming (when the head is approaching the monitor, that is, when increasing the -Z coordinate) is introduced. This makes it possible to more accurately aim and monitor remote targets. A full description of the Hamilton filter is available in Russian here: https://sites.google.com/site/diyheadtracking/home/opentrack/opentrack-hamilton-filter The Hamilton filter was tested by the Russian community, received positive reviews: https://forum.il2sturmovik.ru/topic/5061-opentrack-актуальная-информация-по-проекту-решение-проблем-вопросы/page/24/ https://forums.eagle.ru/showthread.php?t=23280&page=249 --- filter-hamilton/CMakeLists.txt | 1 + ...02\321\200\320\276\320\271\320\272\320\270.txt" | 7 + filter-hamilton/ftnoir_filter_hamilton.cpp | 75 ++ filter-hamilton/ftnoir_filter_hamilton.h | 74 ++ filter-hamilton/ftnoir_filter_hamilton_dialog.cpp | 64 ++ filter-hamilton/ftnoir_hamilton_filtercontrols.ui | 940 +++++++++++++++++++++ filter-hamilton/hamilton-tools.cpp | 137 +++ filter-hamilton/hamilton-tools.h | 27 + filter-hamilton/lang/nl_NL.ts | 74 ++ filter-hamilton/lang/ru_RU.ts | 74 ++ filter-hamilton/lang/stub.ts | 74 ++ filter-hamilton/lang/zh_CN.ts | 74 ++ 12 files changed, 1621 insertions(+) create mode 100644 filter-hamilton/CMakeLists.txt create mode 100644 "filter-hamilton/OT\320\275\320\260\321\201\321\202\321\200\320\276\320\271\320\272\320\270.txt" create mode 100644 filter-hamilton/ftnoir_filter_hamilton.cpp create mode 100644 filter-hamilton/ftnoir_filter_hamilton.h create mode 100644 filter-hamilton/ftnoir_filter_hamilton_dialog.cpp create mode 100644 filter-hamilton/ftnoir_hamilton_filtercontrols.ui create mode 100644 filter-hamilton/hamilton-tools.cpp create mode 100644 filter-hamilton/hamilton-tools.h create mode 100644 filter-hamilton/lang/nl_NL.ts create mode 100644 filter-hamilton/lang/ru_RU.ts create mode 100644 filter-hamilton/lang/stub.ts create mode 100644 filter-hamilton/lang/zh_CN.ts diff --git a/filter-hamilton/CMakeLists.txt b/filter-hamilton/CMakeLists.txt new file mode 100644 index 00000000..8d4d71b0 --- /dev/null +++ b/filter-hamilton/CMakeLists.txt @@ -0,0 +1 @@ +otr_module(filter-hamilton) diff --git "a/filter-hamilton/OT\320\275\320\260\321\201\321\202\321\200\320\276\320\271\320\272\320\270.txt" "b/filter-hamilton/OT\320\275\320\260\321\201\321\202\321\200\320\276\320\271\320\272\320\270.txt" new file mode 100644 index 00000000..c2181d81 --- /dev/null +++ "b/filter-hamilton/OT\320\275\320\260\321\201\321\202\321\200\320\276\320\271\320\272\320\270.txt" @@ -0,0 +1,7 @@ + Max radius : 20,00 2,5 + Smoothing : 2,07 + Dead Zone : 0,00 0,2 + Zoom : 4,00 +Max distance : 17,00 1,5 mm + Smoothing : 0,60 + Dead Zone : 0,26 1 mm diff --git a/filter-hamilton/ftnoir_filter_hamilton.cpp b/filter-hamilton/ftnoir_filter_hamilton.cpp new file mode 100644 index 00000000..be3faa7f --- /dev/null +++ b/filter-hamilton/ftnoir_filter_hamilton.cpp @@ -0,0 +1,75 @@ +/* Copyright (c) 2020, GO63-samara + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_filter_hamilton.h" +#include +#include +#include "api/plugin-api.hpp" +#include "hamilton-tools.h" + +hamilton::hamilton() = default; + +void hamilton::filter(const double *input, double *output) +{ + tQuat quat_input = QuatFromYPR( &input[Yaw] ); + + if (first_run) + { + first_run = false; + quat_last = quat_input; + pos_last = {input[TX], input[TY], input[TZ]}; + for (int i=0; i<6; i++) output[i] = input[i]; + return; + } + + // positions: + const double pos_max {s.kMaxDist}; + const double pos_deadzone{s.kDeadZoneDist}; + const double pos_pow {s.kPowDist}; + + double dist = VectorDistance( &input[TX], pos_last); + + double alpha = (dist - pos_deadzone) / (pos_max + pos_deadzone + EPSILON); + alpha = fmin(alpha, 1.0); + alpha = fmax(alpha, 0.0); + alpha = pow (alpha, pos_pow); + alpha = alpha * (dist - pos_deadzone) / (dist + EPSILON); + + pos_last = Lerp(pos_last, input, alpha); + + output[TX] = pos_last.v[0]; + output[TY] = pos_last.v[1]; + output[TZ] = pos_last.v[2]; + + // zoom smoothing: + const double pow_zoom {s.kPowZoom}; + const double max_z {s.kMaxZ}; + double rot_zoom = pow_zoom; + + if (output[TZ] > 0) rot_zoom = 0; + else rot_zoom *= -output[TZ] / (max_z + EPSILON); + rot_zoom = fmin( rot_zoom, pow_zoom ); + + // rotations: + const double rot_max {s.kMaxRot}; + const double rot_pow {s.kPowRot}; + const double rot_deadzone{s.kDeadZoneRot}; + + double angle = AngleBetween(quat_input, quat_last); + + alpha = (angle - rot_deadzone) / (rot_max + rot_deadzone + EPSILON); + alpha = fmin(alpha, 1.0); + alpha = fmax(alpha, 0.0); + alpha = pow (alpha, rot_pow + rot_zoom); + alpha = alpha * (angle - rot_deadzone) / (angle + EPSILON); + + quat_last = Slerp(quat_last, quat_input, alpha); + + QuatToYPR(quat_last, &output[Yaw] ); +} + +OPENTRACK_DECLARE_FILTER(hamilton, dialog_hamilton, hamiltonDll) diff --git a/filter-hamilton/ftnoir_filter_hamilton.h b/filter-hamilton/ftnoir_filter_hamilton.h new file mode 100644 index 00000000..0756c216 --- /dev/null +++ b/filter-hamilton/ftnoir_filter_hamilton.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2020, GO63-samara + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#pragma once + +#include "api/plugin-api.hpp" +#include "ui_ftnoir_hamilton_filtercontrols.h" +#include +#include +#include "options/options.hpp" +//#include "compat/timer.hpp" +#include "hamilton-tools.h" + +using namespace options; + +struct settings : opts { + value kMaxRot, kPowRot, kDeadZoneRot, + kMaxDist, kPowDist, kDeadZoneDist, + kPowZoom, kMaxZ; + settings() : + opts ("hamilton-filter"), + kMaxRot (b, "max-radius-smoothing", { .01, .001, 25.0 }), + kPowRot (b, "smoothing-power-rot", { .01, .001, 4.0 }), + kDeadZoneRot (b, "dead-zone-radius-rot", { .01, .001, 0.5 }), + kMaxDist (b, "max-distance-smoothing",{ .01, .001, 20.0 }), + kPowDist (b, "smoothing-power-dist", { .01, .001, 4.0 }), + kDeadZoneDist(b, "dead-zone-radius-dist", { .01, .001, 0.5 }), + kPowZoom (b, "smoothing-power-zoom", { .01, .001, 4.0 }), + kMaxZ (b, "max-z", { .01, .001, 100.0 }) + {} +}; + +class hamilton : public IFilter +{ +public: + hamilton(); + void filter(const double *input, double *output) override; + void center() override { first_run = true; } + module_status initialize() override { return status_ok(); } +private: + tQuat quat_last; + tVector pos_last; + settings s; + bool first_run = true; +}; + +class dialog_hamilton: public IFilterDialog +{ + Q_OBJECT +public: + dialog_hamilton(); + void register_filter(IFilter*) override {} + void unregister_filter() override {} + +private: + Ui::UICdialog_hamilton ui; + settings s; + +private slots: + void doOK(); + void doCancel(); +}; + +class hamiltonDll : public Metadata +{ + Q_OBJECT + + QString name() { return tr("Hamilton"); } + QIcon icon() { return QIcon(":/images/filter-16.png"); } +}; diff --git a/filter-hamilton/ftnoir_filter_hamilton_dialog.cpp b/filter-hamilton/ftnoir_filter_hamilton_dialog.cpp new file mode 100644 index 00000000..11f4c067 --- /dev/null +++ b/filter-hamilton/ftnoir_filter_hamilton_dialog.cpp @@ -0,0 +1,64 @@ +/* Copyright (c) 2020, GO63-samara + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "ftnoir_filter_hamilton.h" +#include +#include +#include +#include "api/plugin-api.hpp" +#include "ui_ftnoir_hamilton_filtercontrols.h" + +dialog_hamilton::dialog_hamilton() +{ + ui.setupUi(this); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + + tie_setting(s.kMaxRot, ui.maxRot); + tie_setting(s.kMaxRot, ui.lbMaxRot, [](double x) + { return QStringLiteral("%1\xB0").arg(x, 0, 'f', 2);}); + + tie_setting(s.kPowRot, ui.powRot); + tie_setting(s.kPowRot, ui.lbPowRot, [](double x) + { return QStringLiteral("%1").arg(x, 0, 'f', 2);}); + + tie_setting(s.kDeadZoneRot, ui.dzRot); + tie_setting(s.kDeadZoneRot, ui.lbDZRot, [](double x) + { return QStringLiteral("%1\xB0").arg(x, 0, 'f', 2);}); + + tie_setting(s.kPowZoom, ui.powZoom); + tie_setting(s.kPowZoom, ui.lbPowZoom, [](double x) + { return QStringLiteral("%1").arg(x, 0, 'f', 2);}); + + tie_setting(s.kMaxZ, ui.maxZ); + tie_setting(s.kMaxZ, ui.lbMaxZ, [](double x) + { return QStringLiteral("%1").arg(x, 0, 'f', 2);}); + + tie_setting(s.kMaxDist, ui.maxDist); + tie_setting(s.kMaxDist, ui.lbMaxDist, [](double x) + { return QStringLiteral("%1cm").arg(x, 0, 'f', 2);}); + + tie_setting(s.kPowDist, ui.powDist); + tie_setting(s.kPowDist, ui.lbPowDist, [](double x) + { return QStringLiteral("%1").arg(x, 0, 'f', 2);}); + + tie_setting(s.kDeadZoneDist, ui.dzDist); + tie_setting(s.kDeadZoneDist, ui.lbDZDist, [](double x) + { return QStringLiteral("%1cm").arg(x, 0, 'f', 2);}); +} + +void dialog_hamilton::doOK() +{ + s.b->save(); + close(); +} + +void dialog_hamilton::doCancel() +{ + close(); +} diff --git a/filter-hamilton/ftnoir_hamilton_filtercontrols.ui b/filter-hamilton/ftnoir_hamilton_filtercontrols.ui new file mode 100644 index 00000000..71cdb6da --- /dev/null +++ b/filter-hamilton/ftnoir_hamilton_filtercontrols.ui @@ -0,0 +1,940 @@ + + + UICdialog_hamilton + + + Qt::NonModal + + + true + + + + 0 + 0 + 514 + 491 + + + + + 0 + 0 + + + + + 0 + 485 + + + + + 50 + false + + + + Hamilton filter settings + + + + :/images/filter-16.png:/images/filter-16.png + + + Qt::LeftToRight + + + false + + + + + + + + + + 0 + 0 + + + + + 496 + 150 + + + + + 8 + 50 + false + + + + Rotations: + + + false + + + + + 103 + 30 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + 0 + + + 250 + + + 1 + + + 50 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 50 + + + + + + 7 + 30 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Max distance: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 424 + 30 + 61 + 20 + + + + + 45 + 0 + + + + + + + 10,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 7 + 110 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Dead Zone: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 110 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + 0 + + + 50 + + + 1 + + + 5 + + + 1 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 10 + + + + + + 424 + 110 + 61 + 20 + + + + + 45 + 0 + + + + + + + 0,01 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 70 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + false + + + 0 + + + 400 + + + 1 + + + 50 + + + 200 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 100 + + + + + + 430 + 70 + 45 + 20 + + + + + 45 + 0 + + + + + + + 2,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 7 + 70 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Smoothing: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + Positions: + + + + + 103 + 30 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + 0 + + + 200 + + + 1 + + + 50 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 50 + + + + + + 7 + 70 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Smoothing: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 70 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + false + + + 0 + + + 400 + + + 1 + + + 50 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 100 + + + + + + 7 + 110 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Dead Zone: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 430 + 70 + 51 + 20 + + + + + 40 + 0 + + + + 1,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 7 + 30 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Max distance: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 110 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + 0 + + + 50 + + + 1 + + + 10 + + + 2 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 10 + + + + + + 420 + 30 + 71 + 20 + + + + + 45 + 0 + + + + 10,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 420 + 110 + 71 + 20 + + + + + 45 + 0 + + + + 0,02 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + 0 + 0 + + + + + 0 + 100 + + + + Zoom smoothing: + + + + + 434 + 30 + 45 + 20 + + + + + 45 + 0 + + + + 2,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 30 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + false + + + 0 + + + 400 + + + 1 + + + 50 + + + 200 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 100 + + + + + + 7 + 30 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Smoothing : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 103 + 60 + 311 + 20 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + false + + + 0 + + + 1000 + + + 1 + + + 50 + + + 150 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 100 + + + + + + 7 + 60 + 91 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Max Z: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 434 + 60 + 45 + 20 + + + + + 45 + 0 + + + + 15,00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + true + + + + + + + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/filter-hamilton/hamilton-tools.cpp b/filter-hamilton/hamilton-tools.cpp new file mode 100644 index 00000000..4f9ad046 --- /dev/null +++ b/filter-hamilton/hamilton-tools.cpp @@ -0,0 +1,137 @@ +#pragma once + +#include "hamilton-tools.h" +#include + +double VectorLength(const tVector v) +{ + return(sqrt(v.v[0]*v.v[0] + v.v[1]*v.v[1] + v.v[2]*v.v[2])); +} + +double sqr(const double v) { return(v*v); } + +double VectorDistance(const double v1[], const tVector v2) +{ + return(sqrt(sqr(v2.v[0]-v1[0])+sqr(v2.v[1]-v1[1])+sqr(v2.v[2]-v1[2]))); +} + +tVector Lerp(const tVector s, const double d[], const double alpha) +{ + tVector V; + V.v[0] = s.v[0] + (d[0] - s.v[0]) * alpha; + V.v[1] = s.v[1] + (d[1] - s.v[1]) * alpha; + V.v[2] = s.v[2] + (d[2] - s.v[2]) * alpha; + return(V); +} + +tQuat QuatFromAngleAxe(const double angle, const tVector axe) +{ + double a = TO_RAD * 0.5 * angle; + double d = sin(a) / VectorLength(axe); + return ( tQuat ( + axe.v[0] * d, + axe.v[1] * d, + axe.v[2] * d, + cos(a) + ) + ); +} + +tQuat QuatMultiply(const tQuat qL, const tQuat qR) +{ + tQuat Q; + Q.x = qL.w*qR.x + qL.x*qR.w + qL.y*qR.z - qL.z*qR.y; + Q.y = qL.w*qR.y + qL.y*qR.w + qL.z*qR.x - qL.x*qR.z; + Q.z = qL.w*qR.z + qL.z*qR.w + qL.x*qR.y - qL.y*qR.x; + Q.w = qL.w*qR.w - qL.x*qR.x - qL.y*qR.y - qL.z*qR.z; + return(Q); +} + +double AngleBetween(const tQuat S, const tQuat D) +{ + return( TO_DEG * 2*acos(fabs(S.x*D.x + S.y*D.y + S.z*D.z + S.w*D.w)) ); +} + +tQuat QuatFromYPR(const double YPR[]) +{ + tQuat Q, Qp, Qy; + Q = QuatFromAngleAxe( -YPR[2], {0, 0, 1} ); //Roll, Z axe + Qp = QuatFromAngleAxe( -YPR[1], {1, 0, 0} ); //Pitch, X axe + Qy = QuatFromAngleAxe( -YPR[0], {0, 1, 0} ); //Yaw, Y axe + + Q = QuatMultiply(Qp, Q); + return(QuatMultiply(Qy, Q)); +} + +void Normalize(tQuat Q) +{ + double m = sqrt(Q.x*Q.x + Q.y*Q.y + Q.z*Q.z + Q.w*Q.w); + if (m > EPSILON) + { + m = 1 / m; + Q.x = Q.x * m; + Q.y = Q.y * m; + Q.z = Q.z * m; + Q.w = Q.w * m; + } + else Q = tQuat(0, 0, 0, 1); +} + +tQuat Slerp(const tQuat S, const tQuat D, const double alpha) +{ + // calc cosine of half angle + double cosin = S.x*D.x + S.y*D.y + S.z*D.z + S.w*D.w; + + // select nearest rotation direction + tQuat Q; + if (cosin < 0) + { + cosin = - cosin; + Q.x = - D.x; + Q.y = - D.y; + Q.z = - D.z; + Q.w = - D.w; + } + else Q = D; + + // calculate coefficients + double scale0, scale1; + if ((1.0 - cosin) > EPSILON) + { + double omega = acos(cosin); + double sinus = 1 / sin(omega); + scale0 = sin((1.0 - alpha) * omega) * sinus; + scale1 = sin(alpha * omega)* sinus; + } + else + { + scale0 = 1.0 - alpha; + scale1 = alpha; + } + + Q.x = scale0 * S.x + scale1 * Q.x; + Q.y = scale0 * S.y + scale1 * Q.y; + Q.z = scale0 * S.z + scale1 * Q.z; + Q.w = scale0 * S.w + scale1 * Q.w; + + Normalize(Q); + + return( Q ); +} + +void QuatToYPR(const tQuat Q, double YPR[]) +{ + const double xx = Q.x * Q.x; + const double xy = Q.x * Q.y; + const double xz = Q.x * Q.z; + const double xw = Q.x * Q.w; + const double yy = Q.y * Q.y; + const double yz = Q.y * Q.z; + const double yw = Q.y * Q.w; + const double zz = Q.z * Q.z; + const double zw = Q.z * Q.w; + + YPR[0] = TO_DEG * ( -atan2( 2 * ( xz + yw ), 1 - 2 * ( xx + yy ) )); + YPR[1] = TO_DEG * ( asin ( 2 * ( yz - xw ) )); + YPR[2] = TO_DEG * ( -atan2( 2 * ( xy + zw ), 1 - 2 * ( xx + zz ) )); +} diff --git a/filter-hamilton/hamilton-tools.h b/filter-hamilton/hamilton-tools.h new file mode 100644 index 00000000..2e288225 --- /dev/null +++ b/filter-hamilton/hamilton-tools.h @@ -0,0 +1,27 @@ +#pragma once + +#include "compat/math.hpp" +constexpr double TO_RAD = (M_PI / 180); +constexpr double TO_DEG = (180 / M_PI); +constexpr double EPSILON = 1e-30; + +struct tVector +{ + double v[3]; + tVector(double X = 0, double Y = 0, double Z = 0) {v[0]=X; v[1]=Y; v[2]=Z;} + tVector(double V[]) {v[0]=V[0]; v[1]=V[1]; v[2]=V[2];} +}; + +struct tQuat +{ + double x, y, z, w; + tQuat(double X = 0, double Y = 0, double Z = 0, double W = 1) + {x = X; y = Y; z = Z; w = W;} +}; + +double VectorDistance(const double v1[], const tVector v2); +tVector Lerp (const tVector s, const double d[], const double alpha); +tQuat QuatFromYPR (const double YPR[]); +double AngleBetween (const tQuat S, const tQuat D); +tQuat Slerp (const tQuat S, const tQuat D, const double alpha); +void QuatToYPR (const tQuat Q, double YPR[]); diff --git a/filter-hamilton/lang/nl_NL.ts b/filter-hamilton/lang/nl_NL.ts new file mode 100644 index 00000000..b03e4c0b --- /dev/null +++ b/filter-hamilton/lang/nl_NL.ts @@ -0,0 +1,74 @@ + + + + + UICdialog_hamilton + + Rotations: + + + + Smoothing : + + + + Positions: + + + + Max distance: + + + + Zoom smoothing: + + + + Hamilton filter settings + + + + Max Z: + + + + 10,00 + + + + 0,01 + + + + 2,00 + + + + 1,00 + + + + 0,02 + + + + Dead Zone: + + + + Smoothing: + + + + 15,00 + + + + + hamiltonDll + + Hamilton + + + + diff --git a/filter-hamilton/lang/ru_RU.ts b/filter-hamilton/lang/ru_RU.ts new file mode 100644 index 00000000..dfbb2268 --- /dev/null +++ b/filter-hamilton/lang/ru_RU.ts @@ -0,0 +1,74 @@ + + + + + UICdialog_hamilton + + Rotations: + + + + Smoothing : + + + + Positions: + + + + Max distance: + + + + Zoom smoothing: + + + + Hamilton filter settings + + + + Max Z: + + + + 10,00 + + + + 0,01 + + + + 2,00 + + + + 1,00 + + + + 0,02 + + + + Dead Zone: + + + + Smoothing: + + + + 15,00 + + + + + hamiltonDll + + Hamilton + + + + diff --git a/filter-hamilton/lang/stub.ts b/filter-hamilton/lang/stub.ts new file mode 100644 index 00000000..a8af9f98 --- /dev/null +++ b/filter-hamilton/lang/stub.ts @@ -0,0 +1,74 @@ + + + + + UICdialog_hamilton + + Rotations: + + + + Smoothing : + + + + Positions: + + + + Max distance: + + + + Zoom smoothing: + + + + Hamilton filter settings + + + + Max Z: + + + + 10,00 + + + + 0,01 + + + + 2,00 + + + + 1,00 + + + + 0,02 + + + + Dead Zone: + + + + Smoothing: + + + + 15,00 + + + + + hamiltonDll + + Hamilton + + + + diff --git a/filter-hamilton/lang/zh_CN.ts b/filter-hamilton/lang/zh_CN.ts new file mode 100644 index 00000000..a8af9f98 --- /dev/null +++ b/filter-hamilton/lang/zh_CN.ts @@ -0,0 +1,74 @@ + + + + + UICdialog_hamilton + + Rotations: + + + + Smoothing : + + + + Positions: + + + + Max distance: + + + + Zoom smoothing: + + + + Hamilton filter settings + + + + Max Z: + + + + 10,00 + + + + 0,01 + + + + 2,00 + + + + 1,00 + + + + 0,02 + + + + Dead Zone: + + + + Smoothing: + + + + 15,00 + + + + + hamiltonDll + + Hamilton + + + + -- cgit v1.2.3