Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/world_entity.h @ 4933

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

orxonox/trunk: merged the weaponSystem back to the trunk, because it seems safe
merged with command:
svn merge -r 4847:HEAD branches/weaponSystem/ trunk/
conflict in file src/world-entities/weapons/weapon.h resolved in favor of the weaponSystem

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