FF3DPICOBhgForceModel.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of Micole Architecture
00003  *
00004  * Copyright (C) 2007 Micole partners
00005  *
00006  * Micole Architecture is free software: you can redistribute it 
00007  * and/or modify it under the terms of the GNU Lesser General 
00008  * Public License as published by the Free Software Foundation, 
00009  * either version 3 of the License, or (at your option) any 
00010  * later version.
00011  *
00012  * Micole Architecture is distributed in the hope that it will be 
00013  * useful, * but WITHOUT ANY WARRANTY; without even the implied 
00014  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00015  * PURPOSE.  See the GNU Lesser General Public License for more 
00016  * details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with Micole Architecture.  If not, see
00020  * <http://www.gnu.org/licenses/>.
00021  */
00022 
00023 #ifndef FF3DPicobHGForceModel_H
00024 #define FF3DPicobHGForceModel_H
00025 #include "micolelib.h"
00026 
00027 #include <iostream>
00028 #include "ReachinMicoleApplication.h"
00029 #include "Picob.h"
00030 
00031 #include "FF3DForceModel.h"
00032 using namespace Reachin;
00033 using namespace std;
00034 
00038 struct MICOLELIB_API FF3DPicobHGForceModel : FF3DForceModel
00039 {
00045         FF3DPicobHGForceModel(const Vec3f &pt1, const Vec3f &pt2, vector<Vec3f> &bumps, const float &bumpLength, const float &pauseLength, const mgFloat &stiffness = STIFFNESS);
00046         FF3DPicobHGForceModel (const FF3DPicobHGForceModel &fm);
00047 
00048         virtual FF3DForceModel * clone() { return new FF3DPicobHGForceModel(*this); }
00049 
00050         virtual Vec3f evaluate( const Vec3f &pPos, const mgFloat &w )
00051         {
00052                 Vec3f vect = _pt2 - _pt1;
00053                 Vec3f diff = _p.getDeviation(pPos.y + (_pt2 - _pt1).length()/2, (_pt2 - _pt1).length()) - pPos; 
00054                 diff.y = 0;
00055 
00056                 Vec3f force = _stiffness * diff;
00057                 return force; 
00058         }
00059         private:
00060                 mgFloat _stiffness; 
00061 
00062                 Vec3f _pt1;
00063                 Vec3f _pt2;
00064                 Vec3f _oldForce;
00065                 Picob _p;
00066 };
00067 
00068 #endif

Generated on Tue Oct 16 17:10:42 2007 for Micole by  doxygen 1.4.7