00001 /* 00002 This source file is part of OgreHaptics 00003 (a library for wrapping haptics devices for use with the open-source 00004 graphics engine OGRE, http://www.ogre3d.org) 00005 00006 Copyright (c) 2006 - 2008 Jorrit de Vries 00007 Also see acknowledgements in Readme.html 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public License 00011 as published by the Free Software Foundation; either version 2.1 00012 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the 00021 Free Software Foundation, Inc., 00022 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 #ifndef _OgreHapticsForceEffectAlgorithm_H__ 00025 #define _OgreHapticsForceEffectAlgorithm_H__ 00026 00027 #include "OgreHapticsPrerequisites.h" 00028 #include "OgreHapticsForceOutput.h" 00029 00030 namespace OgreHaptics { 00031 00048 class _OgreHapticsExport ForceEffectAlgorithm : public StringInterface 00049 { 00050 public: 00052 ForceEffectAlgorithm(const String& type); 00054 virtual ~ForceEffectAlgorithm() {} 00055 00062 virtual const String& getType(void) const { return mType; } 00063 00074 virtual void reset(void) {} 00075 00089 virtual const ForceOutput& calculateForces(const Vector3& position, 00090 const Quaternion& orientation, const Vector3& linearVelocity, 00091 const Vector3& angularVelocity, double timeElapsed) = 0; 00092 protected: 00094 String mType; 00096 ForceOutput mOutput; 00097 }; 00098 00100 typedef std::vector<ForceEffectAlgorithm*> ForceEffectAlgorithmList; 00101 00118 class _OgreHapticsExport ForceEffectAlgorithmFactory 00119 { 00120 public: 00122 ForceEffectAlgorithmFactory() {} 00124 virtual ~ForceEffectAlgorithmFactory(); 00125 00130 virtual String getName(void) const = 0; 00131 00138 virtual ForceEffectAlgorithm* createAlgorithm(void) = 0; 00143 virtual void destroyAlgorithm(ForceEffectAlgorithm* algorithm); 00144 protected: 00146 ForceEffectAlgorithmList mAlgorithms; 00147 }; 00148 00149 } 00150 00151 #endif
Last modified Tue Jan 6 22:31:25 2009