Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/buerli/src/camera.h @ 2793

Last change on this file since 2793 was 2707, checked in by bensch, 20 years ago

orxonox/branches/buerli: merged back from trunk, with new configure makefile and so forth.

File size: 1.6 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 "stdincl.h"
10
11class WorldEntity;
12class World;
13
14//! Camera
15/**
16   This class controls the viewpoint from which the World is rendered. To use the
17   Camera it has to be bound to a WorldEntity which serves as the reference focus
18   point. The Camera itself calls the WorldEntity::get_lookat() and
19   World::calc_camera_pos() functions to calculate the position it currently should
20   be in.
21*/
22
23enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL};
24
25class Camera {
26 private:
27  WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
28  Placement actual_place;               //!< the Camera's current position
29  Placement desired_place;        //!< where the Camera should be according to calculations
30  World* world;
31 
32  /* physical system - not needed yet */
33  float m; //!< mass
34  Vector *fs; //!< seil-kraft
35  Vector *a;  //!< acceleration
36  Vector *v;  //!< velocity
37 
38  /* elliptical camera mode variables */
39  Placement plLastBPlace;
40  float cameraOffset;
41  float cameraOffsetZ;
42  float deltaTime;
43  float t;
44  Vector r;
45  float rAbs;
46  float ka;
47  float a0;
48
49  Quaternion *from;
50  Quaternion *to;
51  Quaternion *res;
52 
53 
54  CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
55 
56  void update_desired_place ();
57 
58 public:
59  Camera (World* world);
60  ~Camera ();
61 
62  void time_slice (Uint32 deltaT);
63  void apply ();
64  void bind (WorldEntity* entity);
65  void jump (Placement* plc);
66
67  void setWorld(World* world); 
68
69};
70
71#endif
Note: See TracBrowser for help on using the repository browser.