Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2190 in orxonox.OLD for orxonox/trunk/src/world_entity.h


Ignore:
Timestamp:
Jul 17, 2004, 12:11:20 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged and copied all files from branches/chris into trunk. it all seems to be in propper order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entity.h

    r2077 r2190  
    11/*!
    22    \file world_entity.h
    3     \brief A base class for all objects in the world
    4    
    5     This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions.
    6 */
    7 
    8 
     3    \brief Definition of the basic WorldEntity
     4*/
    95
    106#ifndef WORLD_ENTITY_H
    117#define WORLD_ENTITY_H
    128
    13 #include "data_tank.h"
     9#include "stdincl.h"
    1410
    15 class Vector;
    16 class Ability;
     11class CollisionCluster;
    1712
    18 //! WorldEntity
    19 /**
    20   A base class for all objects in the world
    21 
    22   This is the base class of all objects in the game-world. If you want to have an object in the world, that can realy interact with other objects and that is also dispbayable etc. you have to extend this class and override the needed functions.
    23 */
    24 class WorldEntity {
     13//! Basic class from which all interactive stuff in the world is derived from
     14class WorldEntity
     15{       
     16        friend class World;
    2517
    2618 public:
    27   WorldEntity ();
     19  WorldEntity (bool isFree = false);
    2820  ~WorldEntity ();
    2921
     22        Location* get_location ();
     23        Placement* get_placement ();
     24        void set_collision (CollisionCluster* newhull);
    3025
    31   void setPosition(Vector* position);
    32   Vector* getPosition();
    33   void setOrientation(Vector* orientation);
    34   Vector* getOrientation();
    35   void setSpawnPoint(Vector* place);
    36   void setSpeed(float speed);
    37   float getSpeed();
    38   void setHealth(float health);
    39   float getHealth();
     26        bool isFree ();
     27       
     28  //void addAbility(Ability* ability);
     29  //void removeAbility(Ability* ability);
    4030
    41   void addAbility(Ability* ability);
    42   void removeAbility(Ability* ability);
     31        virtual void post_spawn ();
     32  virtual void tick (float time);
     33  virtual void hit (WorldEntity* weapon, Vector loc);
     34  virtual void destroy ();
     35  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
     36        virtual void command (Command* cmd);
     37 
     38  virtual void draw ();
     39  virtual void get_lookat (Location* locbuf);
    4340
    44   virtual void tick(float dt);
    45   virtual void paint();
    46   /* virtual void actionEvent(Event* event); */
    47   virtual void collide(WorldEntity* we, Vector loc);
    48   virtual void hit(WorldEntity* weapon, Vector loc);
    49   virtual void destroy();
    50 
    51   virtual void entityPreEnter();
    52   virtual void entityPostEnter();
    53   virtual void entityPreQuit();
    54   virtual void entityPostQuit();
    55 
    56  
     41        virtual void left_world ();
    5742
    5843 private:
    59   Vector* position;    //!< position of the entity
    60   Vector* orientation; //!< orientation of the entity
    61   /* List of abilities */
    62   float health; //!< health of the entity, if any
    63   float speed; //!< speed of the entity if any
    64   /* entity can be in the air or at ground: */
    65   int airGround; //!< is it air or bound to the ground (ground=0, air=1)
     44  const bool bFree;     
     45  bool bCollide;
     46  bool bDraw;
     47 
     48        WorldEntity* owner;
     49        CollisionCluster* collisioncluster;
     50        Placement place;
     51        Location loc;
    6652
    67  
    68 
     53        void init( Location* spawnloc, WorldEntity* spawnowner);
     54        void init( Placement* spawnplc, WorldEntity* spawnowner);
    6955};
    7056
Note: See TracChangeset for help on using the changeset viewer.