00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 * * 00022 * $Log: axis.h,v $ 00023 * Revision 1.3 2010/03/09 11:53:41 martius 00024 * renamed globally ode to ode-dbl 00025 * 00026 * Revision 1.2 2006/07/14 12:23:55 martius 00027 * selforg becomes HEAD 00028 * 00029 * Revision 1.1.2.1 2006/02/02 09:00:00 martius 00030 * axis type 00031 * 00032 * 00033 ***************************************************************************/ 00034 #ifndef __AXIS_H 00035 #define __AXIS_H 00036 00037 #include <osg/Vec3> 00038 #include <osg/Vec4> 00039 #include <ode-dbl/ode.h> 00040 #include <iostream> 00041 00042 namespace lpzrobots{ 00043 00044 // class for axis. This is a internally a 4 dimensional vector (homogenenous) with last component = 0 00045 // meaning it is a direction not a point 00046 class Axis : public osg::Vec4 { 00047 public: 00048 Axis () : osg::Vec4() {} 00049 Axis (float x, float y, float z) : osg::Vec4(x, y, z, 0) {} 00050 Axis (const osg::Vec4& v) : osg::Vec4(v) { w() =0; } 00051 Axis (const osg::Vec3& v) : osg::Vec4(v,0) {} 00052 Axis (const dReal v[3]) : osg::Vec4(v[0], v[1], v[2], 0) {} 00053 00054 osg::Vec3 vec3() const { return osg::Vec3( x(), y(), z()); } 00055 00056 void print(){ 00057 std::cout << '(' << x() << ',' << y() << ',' << z() << ')' << std::endl; 00058 } 00059 }; 00060 00061 } 00062 00063 #endif