Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: WorldEntity now has the ability to return its FaceCounts

File size: 1.9 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 "model.h"
15
16//class CollisionCluster;
17class CharacterAttributes;
18class SoundEngine;
19class SoundBuffer;
20class SoundSource;
21
22//! Basic class from which all interactive stuff in the world is derived from
23class WorldEntity : public PNode
24{
25  friend class World;
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  //void setCollision (CollisionCluster* newhull);
35
36  //void addAbility(Ability* ability);
37  //void removeAbility(Ability* ability);
38  void setDrawable (bool bDraw);
39  void setCharacterAttributes(CharacterAttributes* charAttr);
40  CharacterAttributes* getCharacterAttributes();
41
42  virtual void postSpawn ();
43  virtual void leftWorld ();
44
45  virtual void hit (WorldEntity* weapon, Vector* loc);
46  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
47  virtual void command (Command* cmd);
48
49  /** \returns the Count of Faces on this WorldEntity */
50  virtual unsigned int getFaceCount (void) const { if (this->model) return this->model->getFaceCount(); else return 0; };
51
52  void processDraw ();
53  virtual void draw ();
54  virtual void tick (float time);
55
56 protected:
57  Model* model;                  //!< The model that should be loaded for this entity.
58  CharacterAttributes* charAttr;      //!< the character attributes of a world_entity
59
60 private:
61  bool bCollide;                      //!< If it should be considered for the collisiontest.
62  bool bDraw;                         //!< If it should be visible.
63
64
65
66  //CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
67};
68
69#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.