FF3DPlanarForceModel.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 FF3DPlanarForceModel_H
00024 #define FF3DPlanarForceModel_H
00025 #include "micolelib.h"
00026 
00027 #include "FF3DForceModel.h"
00028 using namespace Reachin;
00029 
00033 struct MICOLELIB_API FF3DPlanarForceModel : FF3DForceModel
00034 {
00035         mgFloat _stiffness; 
00036 
00037         Vec3f _pt1;
00038         Vec3f _pt2;
00039         Vec3f _pt3;
00040 
00046         FF3DPlanarForceModel(const Vec3f &pt1, const Vec3f &pt2, const mgFloat &stiffness = STIFFNESS);
00047         FF3DPlanarForceModel(const FF3DPlanarForceModel &fm);
00048 
00049         virtual FF3DForceModel * clone() {return new FF3DPlanarForceModel(*this); }
00050 
00051         virtual Vec3f evaluate( const Vec3f &pPos, const mgFloat &w )
00052         {
00053                 Vec3f pos = pPos; //duplicate original pos
00054                 pos.x = 0; //ignore y pos
00055                 pos.z = 0; //ignore y pos
00056                 Vec3f diff = Vec3f(0,0,0) - pos;
00057                 diff.x = 0; //only for linear
00058                 diff.z = 0; //only for planar
00059                 return _stiffness * diff; 
00060         }
00061 };
00062 
00063 #endif

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