Last change
on this file since 6782 was
5557,
checked in by bensch, 19 years ago
|
orxonox/trunk: more around the aim-class
|
File size:
1.0 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 |
---|
13 | class Model; |
---|
14 | class Material; |
---|
15 | class TiXmlElement; |
---|
16 | |
---|
17 | //! An Aim for zooming in on Targets. |
---|
18 | class Aim : public PNode, public Element2D { |
---|
19 | |
---|
20 | public: |
---|
21 | Aim(const TiXmlElement* root = NULL); |
---|
22 | virtual ~Aim(); |
---|
23 | |
---|
24 | void init(); |
---|
25 | void loadParams(const TiXmlElement* root); |
---|
26 | |
---|
27 | inline void selectTarget(PNode* target) { this->setParent(target); }; |
---|
28 | inline PNode* getTarget(PNode* target) { return this->getParent(); }; |
---|
29 | |
---|
30 | |
---|
31 | void setSize(float size); |
---|
32 | void setTexture(const char* textureFile); |
---|
33 | /** @param rotationSpeed the speed at what the crosshair should rotate */ |
---|
34 | inline void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; }; |
---|
35 | |
---|
36 | virtual void tick(float dt); |
---|
37 | virtual void draw() const; |
---|
38 | |
---|
39 | private: |
---|
40 | Material* material; //!< a material for the Aim. |
---|
41 | float rotationSpeed; //!< Speed of the Rotation. |
---|
42 | }; |
---|
43 | |
---|
44 | #endif /* _AIM_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.