source:
orxonox.OLD/orxonox/trunk/src/camera.h
@
3639
| Last change on this file since 3639 was 3639, checked in by bensch, 21 years ago | |
|---|---|
| File size: 1.4 KB | |
| Rev | Line | |
|---|---|---|
| [2096] | 1 | /*! |
| 2 | \file camera.h | |
| 3 | \brief Viewpoint controlling class definitions | |
| 4 | */ | |
| [2068] | 5 | |
| [3224] | 6 | #ifndef _CAMERA_H |
| 7 | #define _CAMERA_H | |
| [2068] | 8 | |
| [3635] | 9 | #include "p_node.h" |
| [2100] | 10 | |
| [2636] | 11 | class World; |
| [3635] | 12 | class CameraTarget; |
| [2100] | 13 | |
| [3639] | 14 | enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT}; |
| [3635] | 15 | |
| [2096] | 16 | //! Camera |
| 17 | /** | |
| [3635] | 18 | This class controls the viewpoint from which the World is rendered. |
| [2096] | 19 | */ |
| [3635] | 20 | class Camera : public PNode |
| 21 | { | |
| [2068] | 22 | private: |
| [3636] | 23 | CameraTarget* target; //!< The Target of the Camera (where this Camera Looks at) |
| 24 | ||
| 25 | float fovy; //!< The field of view Angle (in degrees). | |
| 26 | float aspectRatio; //!< The aspect ratio (width / height). | |
| 27 | float nearClip; //!< The near clipping plane. | |
| 28 | float farClip; //!< The far clipping plane. | |
| [3639] | 29 | |
| 30 | Vector* toRelCoor; | |
| 31 | float toFovy; | |
| [2551] | 32 | |
| [3635] | 33 | public: |
| 34 | Camera(void); | |
| 35 | virtual ~Camera(void); | |
| 36 | ||
| 37 | void lookAt(PNode* target); | |
| 38 | PNode* getTarget(); | |
| [3636] | 39 | |
| 40 | void setAspectRatio(float aspectRatio); | |
| 41 | void setFovy(float fovy); | |
| 42 | void setClipRegion(float nearClip, float farClip); | |
| 43 | ||
| [3639] | 44 | void setViewMode(ViewMode mode); |
| 45 | void tick(float dt); | |
| [3636] | 46 | void apply (void); |
| [3635] | 47 | }; |
| [2068] | 48 | |
| [3635] | 49 | //! A CameraTarget is where the Camera is looking at. |
| 50 | class CameraTarget : public PNode | |
| 51 | { | |
| [3636] | 52 | friend class Camera; //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it. |
| [2551] | 53 | |
| [3635] | 54 | private: |
| 55 | CameraTarget(void); | |
| [2636] | 56 | |
| [2068] | 57 | public: |
| [3635] | 58 | virtual ~CameraTarget(void); |
| 59 | }; | |
| [2068] | 60 | |
| 61 | ||
| [3224] | 62 | #endif /* _CAMERA_H */ |
Note: See TracBrowser
for help on using the repository browser.










