Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 5510 was 5510, checked in by bensch, 18 years ago

orxonox/trunk: small cleanup in WorldEntity

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