00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CEffectStickSlipH 00023 #define CEffectStickSlipH 00024 //--------------------------------------------------------------------------- 00025 #include "effects/CGenericEffect.h" 00026 //--------------------------------------------------------------------------- 00027 00028 //=========================================================================== 00036 //=========================================================================== 00037 00038 //--------------------------------------------------------------------------- 00043 //--------------------------------------------------------------------------- 00044 struct cStickSlipStatus 00045 { 00047 cVector3d m_currentStickPosition; 00048 00050 bool m_valid; 00051 }; 00052 00053 00054 //=========================================================================== 00062 //=========================================================================== 00063 class cEffectStickSlip : public cGenericEffect 00064 { 00065 public: 00066 //----------------------------------------------------------------------- 00067 // CONSTRUCTOR & DESTRUCTOR: 00068 //----------------------------------------------------------------------- 00069 00071 cEffectStickSlip(cGenericObject* a_parent); 00072 00074 virtual ~cEffectStickSlip() {}; 00075 00076 00077 //----------------------------------------------------------------------- 00078 // METHODS: 00079 //----------------------------------------------------------------------- 00080 00082 bool computeForce(const cVector3d& a_toolPos, 00083 const cVector3d& a_toolVel, 00084 const unsigned int& a_toolID, 00085 cVector3d& a_reactionForce); 00086 00087 protected: 00088 00089 //----------------------------------------------------------------------- 00090 // MEMBERS: 00091 //----------------------------------------------------------------------- 00092 00094 cStickSlipStatus m_history[CHAI_EFFECT_MAX_IDN]; 00095 }; 00096 00097 //--------------------------------------------------------------------------- 00098 #endif 00099 //---------------------------------------------------------------------------