GravityForce.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 _GRAVITY_FORCE_H
00008 #define _GRAVITY_FORCE_H
00009 
00010 #include <Physsim/Vector3.h>
00011 #include <Physsim/RecurrentForce.h>
00012 
00013 namespace Physsim {
00014 class GravityForce : public RecurrentForce
00015 {
00016         public:
00017                 GravityForce();
00018                 GravityForce(const GravityForce& source);
00019                 virtual ~GravityForce() {}
00020                 virtual void clone(BasePtr& cloned, bimap<BasePtr, BasePtr>* obj_map = NULL) const;
00021                 virtual void load_state(BaseConstPtr object, bimap<BasePtr, BasePtr>* correspondence = NULL);
00022                 virtual void save_state(BasePtr object, bimap<BasePtr, BasePtr>* correspondence = NULL) const;
00023                 virtual void add_force(std::vector<DynamicBodyPtr >& bodies);
00024                 void set_gravity(const Vector3& gravity) { _gravity = gravity; }
00025                 Vector3 get_gravity() const { return _gravity; }
00026                 virtual void load_from_xml(XMLTreeConstPtr node, std::map<std::string, BasePtr>& id_map);
00027                 virtual void save_to_xml(XMLTreePtr node, std::list<BaseConstPtr>& shared_objects) const;
00028 
00029         private:
00030                 Vector3 _gravity;
00031 };
00032 }
00033 
00034 #endif

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