Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 5029 was 5029, checked in by patrick, 19 years ago

orxonox/trunk: some changes in the NPC interface class

File size: 2.2 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
43  void setCharacterAttributes(CharacterAttributes* charAttr);
44  CharacterAttributes* getCharacterAttributes();
45
46  /** @returns a reference to the obb tree of this worldentity */
47  BVTree* getOBBTree() { return this->obbTree; }
48
49  virtual void postSpawn ();
50  virtual void leftWorld ();
51
52  virtual void hit (WorldEntity* weapon, Vector* loc);
53  virtual void collidesWith (WorldEntity* entity);
54  virtual void collidesWith (WorldEntity* entity, const Vector& location);
55
56  /** @returns the Count of Faces on this WorldEntity */
57  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
58
59  virtual void tick (float time);
60  virtual void draw ();
61  void drawBVTree(int depth, int drawMode);
62
63 protected:
64  Model*                  model;            //!< The model that should be loaded for this entity.
65  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
66  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
67
68 private:
69  bool                    bCollide;         //!< If it should be considered for the collisiontest.
70  bool                    bVisible;         //!< If it should be visible.
71};
72
73#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.