Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: the bounding volumes now get rendered at the right place

File size: 2.0 KB
Line 
1/*!
2    \file world_entity.h
3    \brief 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  friend class World;
29
30 public:
31  WorldEntity(const TiXmlElement* root = NULL);
32  virtual ~WorldEntity ();
33
34  void loadParams(const TiXmlElement* root);
35  void loadModel(const char* fileName);
36
37  //void setCollision (CollisionCluster* newhull);
38
39  //void addAbility(Ability* ability);
40  //void removeAbility(Ability* ability);
41  void setDrawable (bool bDraw);
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 collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
50  virtual void command (Command* cmd);
51
52  /** \returns the Count of Faces on this WorldEntity */
53  virtual unsigned int getFaceCount (void) const { if (this->model) return this->model->getFaceCount(); else return 0; };
54
55  void processDraw ();
56  virtual void draw ();
57  void drawBVTree(int depth, int drawMode);
58  virtual void tick (float time);
59
60 protected:
61  Model* model;                       //!< The model that should be loaded for this entity.
62  CharacterAttributes* charAttr;      //!< the character attributes of a world_entity
63  BVTree*             obbTree;       //!< this is the obb tree reference needed for collision detection
64
65 private:
66  bool bCollide;                      //!< If it should be considered for the collisiontest.
67  bool bDraw;                         //!< If it should be visible.
68
69
70
71  //CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
72};
73
74#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.