00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FF3DPICOBGFORCEMODEL_H
00024 #define FF3DPICOBGFORCEMODEL_H
00025 #include "micolelib.h"
00026
00027 #include <Vrml.h>
00028 #include <Time.h>
00029 using namespace Reachin;
00030
00031 #include "FF3DForceModel.h"
00032 #include "Picob.h"
00033
00037 struct MICOLELIB_API FF3DPicobGForceModel : FF3DForceModel
00038 {
00039
00040
00041 FF3DPicobGForceModel(const Vec3f &, vector<Vec3f> &bumps, const float &bumpTime, const float &pauseTime, const mgFloat &stiffness = STIFFNESS);
00042 FF3DPicobGForceModel(const FF3DPicobGForceModel& fm);
00043
00044 virtual FF3DForceModel * clone() { return new FF3DPicobGForceModel(*this); }
00045
00046 virtual Vec3f evaluate( const Vec3f &pos, const mgFloat &w )
00047 {
00048 Time currentTime;
00049 currentTime.setToNow();
00050
00051 if (_p.isFinished(currentTime - _begin))
00052 _begin.setToNow();
00053
00054 Vec3f diff = (_stick_point + _p.getDeviation(currentTime - _begin)) - pos;
00055 return _stiffness * diff;
00056 }
00057 private:
00058 mgFloat _stiffness;
00059 Vec3f _stick_point;
00060 Time _begin;
00061 Picob _p;
00062 };
00063
00064 #endif