Last change
on this file since 4992 was
4987,
checked in by bensch, 19 years ago
|
orxonox/trunk: introducing smooth-PNode
|
File size:
1.6 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file camera.h |
---|
3 | * Viewpoint controlling class definitions |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _CAMERA_H |
---|
7 | #define _CAMERA_H |
---|
8 | |
---|
9 | #include "p_node.h" |
---|
10 | #include "vector.h" |
---|
11 | #include "event_listener.h" |
---|
12 | |
---|
13 | class World; |
---|
14 | class CameraTarget; |
---|
15 | class Event; |
---|
16 | |
---|
17 | //! an enumerator for different types of view |
---|
18 | typedef enum ViewMode |
---|
19 | { |
---|
20 | VIEW_NORMAL, |
---|
21 | VIEW_BEHIND, |
---|
22 | VIEW_FRONT, |
---|
23 | VIEW_LEFT, |
---|
24 | VIEW_RIGHT, |
---|
25 | VIEW_TOP |
---|
26 | }; |
---|
27 | |
---|
28 | //! Camera |
---|
29 | /** |
---|
30 | This class controls the viewpoint from which the World is rendered. |
---|
31 | */ |
---|
32 | class Camera : public PNode, public EventListener |
---|
33 | { |
---|
34 | public: |
---|
35 | Camera(); |
---|
36 | virtual ~Camera(); |
---|
37 | |
---|
38 | void lookAt(PNode* target); |
---|
39 | PNode* getTarget(); |
---|
40 | |
---|
41 | void setAspectRatio(float aspectRatio); |
---|
42 | void setFovy(float fovy); |
---|
43 | void setClipRegion(float nearClip, float farClip); |
---|
44 | |
---|
45 | void setViewMode(ViewMode mode); |
---|
46 | void tick(float dt); |
---|
47 | void apply (); |
---|
48 | |
---|
49 | void process(const Event &event); |
---|
50 | |
---|
51 | private: |
---|
52 | CameraTarget* target; //!< The Target of the Camera (where this Camera Looks at) |
---|
53 | |
---|
54 | float fovy; //!< The field of view Angle (in degrees). |
---|
55 | float aspectRatio; //!< The aspect ratio (width / height). |
---|
56 | float nearClip; //!< The near clipping plane. |
---|
57 | float farClip; //!< The far clipping plane. |
---|
58 | |
---|
59 | float toFovy; //!< The fovy-mode to iterate to. |
---|
60 | }; |
---|
61 | |
---|
62 | //! A CameraTarget is where the Camera is looking at. |
---|
63 | class CameraTarget : public PNode |
---|
64 | { |
---|
65 | friend class Camera; //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it. |
---|
66 | |
---|
67 | private: |
---|
68 | CameraTarget(); |
---|
69 | |
---|
70 | public: |
---|
71 | virtual ~CameraTarget(); |
---|
72 | }; |
---|
73 | |
---|
74 | |
---|
75 | #endif /* _CAMERA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.