RecurrentForce.h

00001 /****************************************************************************
00002  * Copyright 2005 Evan Drumwright
00003  * This library is distributed under the terms of the GNU General Public 
00004  * License (found in COPYING).
00005  ****************************************************************************/
00006 
00007 #ifndef _RECURRENT_FORCE
00008 #define _RECURRENT_FORCE
00009 
00010 #include <vector>
00011 #include <map>
00012 #include <boost/shared_ptr.hpp>
00013 #include <Physsim/Base.h>
00014 
00015 namespace Physsim {
00016 
00017 class DynamicBody;
00018         
00020 
00025 class RecurrentForce : public Base
00026 {
00027         public:
00028                 virtual ~RecurrentForce() { }
00029                 bool is_skipped(DynamicBodyPtr body) const;
00030                 
00032                 virtual void add_force(std::vector<DynamicBodyPtr>& bodies) = 0;
00033                 
00035                 void add_skipped(DynamicBodyPtr body) { _skipbodies[body] = true; }
00036 
00038                 void remove_skipped(DynamicBodyPtr body) { _skipbodies[body] = false; }
00039 
00041                 void clear_skipped() { _skipbodies.clear(); }
00042 
00043         protected:
00045                 std::map<DynamicBodyPtr, bool> _skipbodies;
00046 };
00047 
00048 } // end namespace Physsim
00049 
00050 #endif

Generated on Wed Oct 24 14:54:22 2007 for Physsim by  doxygen 1.5.1