Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/camera.h @ 4490

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

orxonox/trunk: started documentation of world-entities….
this is not really usefull, because i think, that this will change a lot with development….

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