Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 6999 was 6999, checked in by bensch, 18 years ago

orxonox/trunk: Hover should be Time Independant

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