Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/nico/src/camera.h @ 3146

Last change on this file since 3146 was 2636, checked in by patrick, 20 years ago
  • Added a GameLoader to the game. This enables orxonox to load a campaign consisting of multimple worlds and cinematics etc. However, cinematics are not yet implemented.

In the game you can jump from one level to the other by pressing x. Currently there are only two very simple levels defined. (DEBUG_LEVEL_0, DEBUG_LEVEL_1).

  • Added Error Handling structs to signal the error source and code
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.