diff options
author | Wim Vriend <facetracknoir@gmail.com> | 2012-09-14 17:13:39 +0000 |
---|---|---|
committer | Wim Vriend <facetracknoir@gmail.com> | 2012-09-14 17:13:39 +0000 |
commit | 7db1d177f944de01f7fb7a78b16a8a3df22e9746 (patch) | |
tree | 2098868089e74cedb9c37d187d5b6703cc76c388 /FaceTrackNoIR/tracker.cpp | |
parent | 481fe3ad24c784441743c40510c9c15b78e2171d (diff) |
Added notifyCenter method for Arduino (and Patrick)
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@138 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FaceTrackNoIR/tracker.cpp')
-rw-r--r-- | FaceTrackNoIR/tracker.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/FaceTrackNoIR/tracker.cpp b/FaceTrackNoIR/tracker.cpp index c0470758..b9497fde 100644 --- a/FaceTrackNoIR/tracker.cpp +++ b/FaceTrackNoIR/tracker.cpp @@ -471,15 +471,23 @@ T6DOF gameoutput_camera(0,0,0,0,0,0); //
// If Center is pressed, copy the current values to the offsets.
//
- if (Tracker::confid && Tracker::do_center) {
+ if (Tracker::do_center) {
+
MessageBeep (MB_ICONASTERISK);
+ pTracker->notifyCenter(); // Send 'center' to the tracker
- offset_camera.position.x = getSmoothFromList( &X.rawList );
- offset_camera.position.y = getSmoothFromList( &Y.rawList );
- offset_camera.position.z = getSmoothFromList( &Z.rawList );
- offset_camera.position.pitch = getSmoothFromList( &Pitch.rawList );
- offset_camera.position.yaw = getSmoothFromList( &Yaw.rawList );
- offset_camera.position.roll = getSmoothFromList( &Roll.rawList );
+ //
+ // Only copy valid values
+ //
+ if (Tracker::confid) {
+
+ offset_camera.position.x = getSmoothFromList( &X.rawList );
+ offset_camera.position.y = getSmoothFromList( &Y.rawList );
+ offset_camera.position.z = getSmoothFromList( &Z.rawList );
+ offset_camera.position.pitch = getSmoothFromList( &Pitch.rawList );
+ offset_camera.position.yaw = getSmoothFromList( &Yaw.rawList );
+ offset_camera.position.roll = getSmoothFromList( &Roll.rawList );
+ }
Tracker::do_center = false;
}
|