/[enigma]/enigma/src/objects.hh
ViewVC logotype

Diff of /enigma/src/objects.hh

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

revision 1.9 by dheck, Fri Feb 14 19:04:51 2003 UTC revision 1.10 by dheck, Thu Mar 13 18:07:39 2003 UTC
# Line 187  namespace world Line 187  namespace world
187    
188    
189          // Floor interface          // Floor interface
190          virtual px::V3 get_force(Actor *a)          virtual px::V2 get_force(Actor *a)
191          { return px::V3(); }          { return px::V2(); }
192    
193          virtual void on_drop(Item* it) {}          virtual void on_drop(Item* it) {}
194          virtual void on_pickup(Item* it) {}          virtual void on_pickup(Item* it) {}
# Line 231  namespace world Line 231  namespace world
231          // Item interface          // Item interface
232          //          //
233    
234          virtual px::V3 get_force(Actor *a);          virtual px::V2 get_force(Actor *a);
235    
236          virtual void on_drop(Actor *a);          virtual void on_drop(Actor *a);
237          virtual void on_pickup(Actor *a);          virtual void on_pickup(Actor *a);
# Line 269  namespace world Line 269  namespace world
269    
270          // Stone interface          // Stone interface
271          virtual StoneResponse  collision_response(const StoneContact &sc);          virtual StoneResponse  collision_response(const StoneContact &sc);
272          virtual px::V3         actor_impulse (const StoneContact &sc);          virtual px::V2         actor_impulse (const StoneContact &sc);
273          virtual void           actor_hit (const StoneContact &sc);          virtual void           actor_hit (const StoneContact &sc);
274          virtual void           actor_inside (Actor *a) {}          virtual void           actor_inside (Actor *a) {}
275          virtual void           actor_contact (Actor *a) {}          virtual void           actor_contact (Actor *a) {}
# Line 288  namespace world Line 288  namespace world
288      public:      public:
289          // Actor interface.          // Actor interface.
290          virtual void on_hit(Actor* a) {}          virtual void on_hit(Actor* a) {}
291          virtual void on_creation(const px::V3 &pos);          virtual void on_creation(const px::V2 &pos);
292          virtual void on_respawn (const px::V3 &pos);          virtual void on_respawn (const px::V2 &pos);
293    
294          virtual bool is_dead() = 0;          virtual bool is_dead() = 0;
295          virtual bool is_flying() { return false; }          virtual bool is_flying() { return false; }
# Line 302  namespace world Line 302  namespace world
302    
303          // Accessors.          // Accessors.
304          world::ActorInfo *get_actorinfo() { return &actorinfo; }          world::ActorInfo *get_actorinfo() { return &actorinfo; }
305          const px::V3 &get_pos() const { return actorinfo.pos; }          const px::V2 &get_pos() const { return actorinfo.pos; }
306          const px::V3 &get_vel() const { return actorinfo.vel; }          const px::V2 &get_vel() const { return actorinfo.vel; }
307          double get_radius() const { return actorinfo.radius; }          double get_radius() const { return actorinfo.radius; }
308          double get_mass() const { return actorinfo.mass; }          double get_mass() const { return actorinfo.mass; }
309    
310          void move();          void move();
311          void warp(const px::V3 &newpos);          void warp(const px::V2 &newpos);
312    
313          void respawn();          void respawn();
314          void add_force (const px::V3 &f);          void add_force (const px::V2 &f);
315    
316          display::SpriteId get_spriteid() const { return sprite_id; }          const display::SpriteHandle &get_sprite() const { return m_sprite; }
317    
318      protected:      protected:
319          Actor(const char *name, const px::V3 &pos);          Actor(const char *name, const px::V2 &pos);
320    
321          void set_model(const string &mname, const px::V3 &pos);          void set_model(const string &mname, const px::V2 &pos);
322          void set_model(const string &mname);          void set_model(const string &mname);
323          void set_attrib(const string &key, const Value &val);          void set_attrib(const string &key, const Value &val);
324    
325      private:      private:
326          virtual void on_motion(px::V3 newpos) {}  
327            virtual void on_motion(px::V2 newpos) {}
328          world::ActorInfo  actorinfo;          world::ActorInfo  actorinfo;
329          display::SpriteId sprite_id;          display::SpriteHandle      m_sprite;
330          V3                startingpos;          V2                startingpos;
331          V3                respawnpos;          V2                respawnpos;
332          bool              use_respawnpos;          bool              use_respawnpos;
333      };      };
334  }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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