From 306af7ae1457bc0b12d7c3e9b5a2b8873e208708 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Tue, 26 Apr 2011 19:16:55 +0000 Subject: Start on Mouse Look git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@77 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Tracker_Base/ftnoir_tracker_base.h | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'FTNoIR_Tracker_Base') 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 . * +* 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; }; -- cgit v1.2.3