00001 /* 00002 This file is part of the Virtual Object System of 00003 the Interreality project (http://interreality.org). 00004 00005 Copyright (C) 2002 Reed Hedges 00006 00007 This software was written at the University of Massachusetts with 00008 support from NSF grant #EIA 9703217 00009 00010 This library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU Lesser General Public 00012 License as published by the Free Software Foundation; either 00013 version 2 of the License, or (at your option) any later version. 00014 00015 This library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 Lesser General Public License for more details. 00019 00020 You should have received a copy of the GNU Lesser General Public 00021 License along with this library; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 00024 Reed Hedges <reed@interreality.org> 00025 */ 00026 00027 00028 00029 #include "mock_orientation.hh" 00030 00031 00032 MockOrientation::MockOrientation() : yawAngle(0), pitchAngle(0), rollAngle(0) 00033 { 00034 for(int i = 0; i < 3; i++) 00035 for(int j = 0; j < 3; j++) 00036 matrix[i][j] = 0; 00037 } 00038 00039 00040 void MockOrientation::getOrientationMatrix(double mat[3][3]) 00041 { 00042 for(int i = 0; i < 3; i++) 00043 for(int j = 0; j < 3; j++) 00044 mat[i][j] = matrix[i][j]; 00045 } 00046 00047 void MockOrientation::setOrientationMatrix(double mat[3][3]) 00048 { 00049 for(int i = 0; i < 3; i++) 00050 for(int j = 0; j < 3; j++) 00051 matrix[i][j] = mat[i][j]; 00052 } 00053 00054 00055 00056 void MockOrientation::getEulerAngles(double* yaw, double* pitch, double* roll) 00057 { 00058 *yaw = yawAngle + eulerYawOffset; 00059 *pitch = pitchAngle + eulerPitchOffset; 00060 *roll = rollAngle + eulerRollOffset; 00061 00062 } 00063 00064 void MockOrientation::setEulerAnglres(double yaw, double pitch, double roll) { 00065 yawAngle = yaw; 00066 pitchAngle = pitch; 00067 rollAngle = roll; 00068 }