Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: Load_Param2 changed, to load Models with, or without scale.

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 "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
29  /** @see loadModelWithScale(const char*, float) @param fileName the File to load */
30  void loadModel(const char* fileName, float scaling = 1.0f);
31
32  bool buildObbTree(unsigned int depth);
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 collidesWith (WorldEntity* entity, const Vector& location);
53
54  /** @returns the Count of Faces on this WorldEntity */
55  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
56
57  virtual void tick (float time);
58  virtual void draw ();
59  void drawBVTree(unsigned int depth, int drawMode);
60
61 protected:
62  Model*                  model;            //!< The model that should be loaded for this entity.
63  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
64  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
65
66 private:
67  bool                    bCollide;         //!< If it should be considered for the collisiontest.
68  bool                    bVisible;         //!< If it should be visible.
69};
70
71#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.