Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: saver Weapon-Projectile-generation and Stuff

File size: 2.3 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
[3583]13class CharacterAttributes;
[4504]14class SoundEngine;
15class SoundBuffer;
16class SoundSource;
[5143]17class BVTree;
[4504]18
[4682]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 */
30  void loadModel(const char* fileName) { this->loadModelWithScale(fileName, 1.0); };
31  void loadModelWithScale(const char* fileName, float scaling);
[4680]32
[5061]33  bool buildObbTree(unsigned int depth);
[5057]34
[5061]35
[2190]36  //void addAbility(Ability* ability);
37  //void removeAbility(Ability* ability);
[4885]38
39  /** @param visibility if the Entity should be visible (been draw) */
40  void setVisibiliy (bool visibility) { this->bVisible = visibility; };
41  /** @returns true if the entity is visible, false otherwise */
42  bool isVisible() const { return this->bVisible; };
[5026]43
[3583]44  void setCharacterAttributes(CharacterAttributes* charAttr);
45  CharacterAttributes* getCharacterAttributes();
46
[5026]47  /** @returns a reference to the obb tree of this worldentity */
[5143]48  BVTree* getOBBTree() { return this->obbTree; };
[5026]49
[3229]50  virtual void postSpawn ();
[3583]51  virtual void leftWorld ();
52
[3578]53  virtual void hit (WorldEntity* weapon, Vector* loc);
[5029]54  virtual void collidesWith (WorldEntity* entity, const Vector& location);
[3365]55
[4836]56  /** @returns the Count of Faces on this WorldEntity */
[4746]57  virtual unsigned int getFaceCount () const { if (this->model) return this->model->getFaceCount(); else return 0; };
[4680]58
[4885]59  virtual void tick (float time);
[2190]60  virtual void draw ();
[4684]61  void drawBVTree(int depth, int drawMode);
[4680]62
[3583]63 protected:
[4885]64  Model*                  model;            //!< The model that should be loaded for this entity.
65  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
66  BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
[4680]67
[2036]68 private:
[4885]69  bool                    bCollide;         //!< If it should be considered for the collisiontest.
70  bool                    bVisible;         //!< If it should be visible.
[2036]71};
72
[3224]73#endif /* _WORLD_ENTITY_H */
Note: See TracBrowser for help on using the repository browser.