Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: useless stuff :)

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