Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/camera.h @ 3547

Last change on this file since 3547 was 3544, checked in by bensch, 20 years ago

orxonox/trunk: now the delete-process is as inteded by c++
virtual ~ClassName extends deletion and deletes also the MasterClass

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