Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/weaponSystem/src/world_entities/world_entity.h @ 4877

Last change on this file since 4877 was 4877, checked in by bensch, 19 years ago

orxonox/branches/weaponSystem: cleanup WorldEntity and Player (or at least started cleaning up)

File size: 2.0 KB
Line 
1/*!
2    \file world_entity.h
3  *  Definition of the basic WorldEntity
4*/
5
6#ifndef _WORLD_ENTITY_H
7#define _WORLD_ENTITY_H
8
9#include "p_node.h"
10#include "comincl.h"
11#include "resource_manager.h"
12#include "factory.h"
13#include "load_param.h"
14#include "bv_tree.h"
15#include "model.h"
16
17
18
19class CharacterAttributes;
20class SoundEngine;
21class SoundBuffer;
22class SoundSource;
23
24
25//! Basic class from which all interactive stuff in the world is derived from
26class WorldEntity : public PNode
27{
28 public:
29  WorldEntity(const TiXmlElement* root = NULL);
30  virtual ~WorldEntity ();
31
32  void loadParams(const TiXmlElement* root);
33  void loadModel(const char* fileName);
34
35
36  //void addAbility(Ability* ability);
37  //void removeAbility(Ability* ability);
38
39  /** @param visibility if the Entity should be visible (been draw) */
40  void setVisibiliy (bool visibility) { this->bVisible = visibility; };
41  /** @returns true if the entity is visible, false otherwise */
42  bool isVisible() const { return this->bVisible; };
43  void setCharacterAttributes(CharacterAttributes* charAttr);
44  CharacterAttributes* getCharacterAttributes();
45
46  virtual void postSpawn ();
47  virtual void leftWorld ();
48
49  virtual void hit (WorldEntity* weapon, Vector* loc);
50  virtual void collideWith (WorldEntity* entity);
51
52  /** @returns the Count of Faces on this WorldEntity */
53  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
54
55  virtual void draw ();
56  void drawBVTree(int depth, int drawMode);
57  virtual void tick (float time);
58
59 protected:
60  Model*                  model;            //!< The model that should be loaded for this entity.
61  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
62  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
63
64 private:
65  bool                    bCollide;         //!< If it should be considered for the collisiontest.
66  bool                    bVisible;         //!< If it should be visible.
67};
68
69#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.