summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWim Vriend <facetracknoir@gmail.com>2011-04-26 19:16:55 +0000
committerWim Vriend <facetracknoir@gmail.com>2011-04-26 19:16:55 +0000
commit306af7ae1457bc0b12d7c3e9b5a2b8873e208708 (patch)
tree1b161c38a2de161d2aeae37f51e94a72e028f46b
parent16fc21fdc3d849de801064b06c507cb504ae314c (diff)
Start on Mouse Look
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@77 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r--FTNoIR_Tracker_Base/ftnoir_tracker_base.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/FTNoIR_Tracker_Base/ftnoir_tracker_base.h b/FTNoIR_Tracker_Base/ftnoir_tracker_base.h
index df7ec2c4..f06a726f 100644
--- a/FTNoIR_Tracker_Base/ftnoir_tracker_base.h
+++ b/FTNoIR_Tracker_Base/ftnoir_tracker_base.h
@@ -1,3 +1,31 @@
+/********************************************************************************
+* FaceTrackNoIR This program is a private project of the some enthusiastic *
+* gamers from Holland, who don't like to pay much for *
+* head-tracking. *
+* *
+* Copyright (C) 2010 Wim Vriend (Developing) *
+* Ron Hendriks (Researching and Testing) *
+* *
+* Homepage *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU General Public License as published by the *
+* Free Software Foundation; either version 3 of the License, or (at your *
+* option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but *
+* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
+* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
+* more details. *
+* *
+* You should have received a copy of the GNU General Public License along *
+* with this program; if not, see <http://www.gnu.org/licenses/>. *
+* This class implements a tracker-base *
+*********************************************************************************/
+/*
+ Modifications (last one on top):
+ 20110415 - WVR: Added overloaded operator - and -=
+*/
#ifndef FTNOIR_TRACKER_BASE_H
#define FTNOIR_TRACKER_BASE_H
@@ -19,6 +47,16 @@ struct THeadPoseData {
//
class T6DOF {
public:
+ T6DOF( double x, double y, double z,
+ double yaw, double pitch, double roll ) {
+ position.x = x;
+ position.y = y;
+ position.z = z;
+ position.yaw = yaw;
+ position.pitch = pitch;
+ position.roll = roll;
+ }
+
void initHeadPoseData(){
position.x = 0.0f;
position.y = 0.0f;
@@ -27,6 +65,23 @@ public:
position.pitch = 0.0f;
position.roll = 0.0f;
}
+ T6DOF operator-( T6DOF &other ) {
+ return T6DOF(position.x - other.position.x, position.y - other.position.y, position.z - other.position.z,
+ position.yaw - other.position.yaw, position.pitch - other.position.pitch, position.roll - other.position.roll);
+ }
+ T6DOF operator-=( T6DOF &other ) {
+ return T6DOF(position.x - other.position.x, position.y - other.position.y, position.z - other.position.z,
+ position.yaw - other.position.yaw, position.pitch - other.position.pitch, position.roll - other.position.roll);
+ }
+ T6DOF operator+( T6DOF &other ) {
+ return T6DOF(position.x + other.position.x, position.y + other.position.y, position.z + other.position.z,
+ position.yaw + other.position.yaw, position.pitch + other.position.pitch, position.roll + other.position.roll);
+ }
+ T6DOF operator+=( T6DOF &other ) {
+ return T6DOF(position.x + other.position.x, position.y + other.position.y, position.z + other.position.z,
+ position.yaw + other.position.yaw, position.pitch + other.position.pitch, position.roll + other.position.roll);
+ }
+
THeadPoseData position;
};