Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/camera.h @ 3639

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

orxonox/trunk: now dynamic FOV. still working

File size: 1.4 KB
Line 
1/*!
2    \file camera.h
3    \brief Viewpoint controlling class definitions
4*/ 
5
6#ifndef _CAMERA_H
7#define _CAMERA_H
8
9#include "p_node.h"
10
11class World;
12class CameraTarget;
13
14enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT};
15
16//! Camera
17/**
18   This class controls the viewpoint from which the World is rendered.
19*/
20class Camera : public PNode
21{
22 private:
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.
29
30  Vector* toRelCoor;
31  float toFovy;
32 
33 public:
34  Camera(void);
35  virtual ~Camera(void);
36
37  void lookAt(PNode* target);
38  PNode* getTarget();
39
40  void setAspectRatio(float aspectRatio);
41  void setFovy(float fovy);
42  void setClipRegion(float nearClip, float farClip);
43
44  void setViewMode(ViewMode mode);
45  void tick(float dt);
46  void apply (void);
47};
48
49//! A CameraTarget is where the Camera is looking at.
50class CameraTarget : public PNode
51{
52  friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
53 
54 private:
55  CameraTarget(void);
56 
57 public:
58  virtual ~CameraTarget(void);
59};
60
61
62#endif /* _CAMERA_H */
Note: See TracBrowser for help on using the repository browser.