Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/weapons/crosshair.h @ 4834

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

orxonox/trunk: loadParams and timing

File size: 1.2 KB
Line 
1/*!
2    \file crosshair.h
3    \brief Definition of ...
4
5*/
6
7#ifndef _CROSSHAIR_H
8#define _CROSSHAIR_H
9
10#include "event_listener.h"
11#include "p_node.h"
12#include "vector.h"
13
14// FORWARD DEFINITION
15class Model;
16class Material;
17class TiXmlElement;
18
19//! A class that enables the
20class Crosshair : public PNode, public EventListener {
21
22 public:
23  Crosshair(const TiXmlElement* root = NULL);
24  virtual ~Crosshair();
25
26  void init();
27  void loadParams(const TiXmlElement* root);
28
29  void setSize(float size);
30  void setTexture(const char* textureFile);
31  /** @param rotationSpeed the speed at what the crosshair should rotate */
32  void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
33
34  virtual void process(const Event &event);
35  void tick(float dt);
36  void draw();
37
38 private:
39   float            position2D[2];        //!< The 2D-position on the screen
40
41   Material*        material;             //!< a material for the Aim.
42   float            rotation;             //!< a rotation of the aim.
43   float            rotationSpeed;        //!< Speed of the Rotation.
44   float            size;                 //!< The Size of the Crosshair (in % of screen resolution 1 is fullscreen)
45};
46
47#endif /* _CROSSHAIR_H */
Note: See TracBrowser for help on using the repository browser.