Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/network/src/world_entities/camera.h @ 6088

Last change on this file since 6088 was 6069, checked in by patrick, 18 years ago

network: network world changes and spawning points

File size: 1.6 KB
RevLine 
[4592]1/*!
[5005]2 * @file camera.h
3 * Viewpoint controlling class definitions
[4592]4*/
[2068]5
[3224]6#ifndef _CAMERA_H
7#define _CAMERA_H
[2068]8
[3635]9#include "p_node.h"
[4414]10#include "event_listener.h"
[2100]11
[2636]12class World;
[3635]13class CameraTarget;
[4414]14class Event;
[2100]15
[4490]16//! an enumerator for different types of view
[4592]17typedef enum ViewMode
18{
19  VIEW_NORMAL,
20  VIEW_BEHIND,
21  VIEW_FRONT,
22  VIEW_LEFT,
23  VIEW_RIGHT,
24  VIEW_TOP
25};
[3635]26
[2096]27//! Camera
28/**
[5005]29 * This class controls the viewpoint from which the World is rendered.
[2096]30*/
[4414]31class Camera : public PNode, public EventListener
[3635]32{
33 public:
[4746]34  Camera();
35  virtual ~Camera();
[3635]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);
[4746]46  void apply ();
[4414]47
48  void process(const Event &event);
[4490]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
[4986]58  float             toFovy;          //!< The fovy-mode to iterate to.
[3635]59};
[2068]60
[3635]61//! A CameraTarget is where the Camera is looking at.
[4592]62class CameraTarget : public PNode
[3635]63{
[3636]64  friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
[4592]65
[3635]66 private:
[4746]67  CameraTarget();
[4592]68
[2068]69 public:
[3635]70};
[2068]71
72
[3224]73#endif /* _CAMERA_H */
Note: See TracBrowser for help on using the repository browser.