Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/world_entities/src/world_entities/weapons/aim.h @ 5560

Last change on this file since 5560 was 5560, checked in by bensch, 18 years ago

orxonox/branches/world_entities: AimingTurrets zoom in to the selected Entities… looks quite good, if i may say so, but it is quite buggy

File size: 1.1 KB
Line 
1/*!
2 * @file aim.h
3 *  Definition of
4 */
5
6#ifndef _AIM_H
7#define _AIM_H
8
9#include "p_node.h"
10#include "element_2d.h"
11
12// FORWARD DECLARATION
13class Model;
14class Material;
15class TiXmlElement;
16template<class T> class tAnimation;
17
18//! An Aim for zooming in on Targets.
19class Aim : public PNode, public Element2D {
20
21 public:
22  Aim(const TiXmlElement* root = NULL);
23  virtual ~Aim();
24
25  void init();
26  void loadParams(const TiXmlElement* root);
27
28  inline void selectTarget(PNode* target) { this->setParent(target); };
29  inline PNode* getTarget(PNode* target) { return this->getParent(); };
30
31  void searchTarget(PNode* source);
32
33  void setSize(float size);
34  void setTexture(const char* textureFile);
35  /** @param rotationSpeed the speed at what the crosshair should rotate */
36  inline void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; };
37
38  virtual void tick(float dt);
39  virtual void draw() const;
40
41 private:
42   Material*        material;             //!< a material for the Aim.
43   float            rotationSpeed;        //!< Speed of the Rotation.
44   tAnimation<Aim>* anim;
45};
46
47#endif /* _AIM_H */
Note: See TracBrowser for help on using the repository browser.