/[enigma]/enigma/src/world.cc
ViewVC logotype

Diff of /enigma/src/world.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.49 by dheck, Tue Jun 17 09:33:39 2003 UTC revision 1.50 by dheck, Wed Jun 18 00:58:26 2003 UTC
# Line 239  Field::~Field() Line 239  Field::~Field()
239  */  */
240  namespace  namespace
241  {  {
242      class MouseForce : public ForceField {      class MouseForce {
243      public:      public:
244          void set_force(V2 f) { force=f; }          void set_force(V2 f) { force=f; }
245          void add_force(V2 f) { force+=f; }          void add_force(V2 f) { force+=f; }
246    
247          V2 get_force(Actor *a, V2 /*x*/, V2 /*v*/, double /*time*/)          V2 get_force(Actor *a) {
248          {              if (a->is_flying() || a->is_dead() || !a->int_attrib("mouseforce"))
             int iplayer=0;  
             if (a->int_attrib("player", &iplayer) && iplayer != player::CurrentPlayer())  
                 return V2();  
   
             if (a->is_flying() || a->is_dead() )  
249                  return V2();                  return V2();
   
             if (a->int_attrib("mouseforce"))  
                 return force;  
250              else              else
251                  return V2();                  return force;
252          }          }
253    
254          void tick(double /*dtime*/) {          void tick(double /*dtime*/) {
# Line 450  get_accel (Actor *a, const V2 & x, const Line 442  get_accel (Actor *a, const V2 & x, const
442          if (Floor *floor = GetFloor(p))          if (Floor *floor = GetFloor(p))
443          {          {
444              // Mouse force              // Mouse force
445              f += level->mouseforce.get_force(a,x,v,time)*floor->mousefactor();              f += floor->process_mouseforce(a, level->mouseforce.get_force(a));
446    
447              // Friction              // Friction
448              double vv=length(v);              double vv=length(v);
# Line 470  get_accel (Actor *a, const V2 & x, const Line 462  get_accel (Actor *a, const V2 & x, const
462      }      }
463    
464      // Electrostatic forces between actors.      // Electrostatic forces between actors.
     V2 elforce;  
465      if (double q = a->get_charge()) {      if (double q = a->get_charge()) {
466          for (ActorList::iterator i=level->actorlist.begin();          for (ActorList::iterator i=level->actorlist.begin();
467               i != level->actorlist.end(); ++i)               i != level->actorlist.end(); ++i)

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26