diff options
author | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-06-12 14:53:43 +1000 |
---|---|---|
committer | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-06-12 14:53:43 +1000 |
commit | 0669a40347ffa233bc6042b0f65d244509a61394 (patch) | |
tree | 36a4577bdaa1ed28ca1ad222a54777012dd2dda8 /opentrack-api/trackers.cpp | |
parent | 72540e0a96a3120a5d02271e714aba29e136ab78 (diff) | |
parent | 7454496476ba17ea622781d280606161581c9544 (diff) |
Merge branch 'master' of https://github.com/opentrack/opentrack into dev/ewma2
Resolved conflicts manually in files:
ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp
ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
Diffstat (limited to 'opentrack-api/trackers.cpp')
-rw-r--r-- | opentrack-api/trackers.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/opentrack-api/trackers.cpp b/opentrack-api/trackers.cpp new file mode 100644 index 00000000..5027ec1d --- /dev/null +++ b/opentrack-api/trackers.cpp @@ -0,0 +1,38 @@ +#include "opentrack-guts.h" +#include "opentrack.h" + +extern "C" { + +opentrack_tracker OPENTRACK_EXPORT opentrack_make_tracker(opentrack ctx, const char* name) +{ + for (int i = 0; i < ctx->meta_list.size(); i++) + { + auto meta = ctx->meta_list.at(i); + if (ctx->meta_list.at(i).path == name) + { + ITracker* foo = static_cast<ITracker*>(meta.lib->Constructor()); + return foo; + } + } + return NULL; +} + +void OPENTRACK_EXPORT opentrack_finalize_tracker(opentrack_tracker tracker) +{ + delete tracker; +} + +void OPENTRACK_EXPORT opentrack_tracker_start(opentrack self, opentrack_tracker tracker) +{ + // hot damn, this is problematic! + // need to pass QFrame from somewhere + return tracker->StartTracker(&self->fake_frame); +} + +void OPENTRACK_EXPORT opentrack_tracker_tick(opentrack_tracker tracker, double* headpose) +{ + tracker->GetHeadPoseData(headpose); + QApplication::processEvents(0, 5); +} + +} |