Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: all the WorldEntities now have a const function to draw themselves

File size: 2.2 KB
RevLine 
[4680]1/*!
[4885]2 * @file world_entity.h
3 * Definition of the basic WorldEntity
[2190]4*/
[2036]5
[3224]6#ifndef _WORLD_ENTITY_H
7#define _WORLD_ENTITY_H
[2036]8
[3365]9#include "p_node.h"
[4680]10#include "model.h"
[2036]11
[4885]12// FORWARD DECLARATION
[4504]13class SoundBuffer;
14class SoundSource;
[5143]15class BVTree;
[4504]16
[5498]17//class CharacterAttributes;
[4682]18
[5498]19
[4885]20//! Basis-class all interactive stuff in the world is derived from
[3365]21class WorldEntity : public PNode
[4680]22{
[2036]23 public:
[4261]24  WorldEntity(const TiXmlElement* root = NULL);
[3221]25  virtual ~WorldEntity ();
[3365]26
[4261]27  void loadParams(const TiXmlElement* root);
[3531]28
[5057]29  /** @see loadModelWithScale(const char*, float) @param fileName the File to load */
[5499]30  void loadModel(const char* fileName, float scaling = 1.0f);
[5498]31
[5061]32  bool buildObbTree(unsigned int depth);
[5057]33
[5061]34
[2190]35  //void addAbility(Ability* ability);
36  //void removeAbility(Ability* ability);
[4885]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; };
[5026]42
[5498]43//  void setCharacterAttributes(CharacterAttributes* charAttr);
44//  CharacterAttributes* getCharacterAttributes();
[3583]45
[5026]46  /** @returns a reference to the obb tree of this worldentity */
[5143]47  BVTree* getOBBTree() { return this->obbTree; };
[5026]48
[3229]49  virtual void postSpawn ();
[3583]50  virtual void leftWorld ();
51
[5029]52  virtual void collidesWith (WorldEntity* entity, const Vector& location);
[3365]53
[4836]54  /** @returns the Count of Faces on this WorldEntity */
[4746]55  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
[4680]56
[4885]57  virtual void tick (float time);
[5500]58  virtual void draw () const;
[5431]59  void drawBVTree(unsigned int depth, int drawMode);
[4680]60
[3583]61 protected:
[4885]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
[5498]64  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
[4680]65
[2036]66 private:
[4885]67  bool                    bCollide;         //!< If it should be considered for the collisiontest.
68  bool                    bVisible;         //!< If it should be visible.
[2036]69};
70
[3224]71#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.