Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/parenting/src/camera.h @ 3340

Last change on this file since 3340 was 3302, checked in by patrick, 20 years ago

orxonox/branches/parenting: implemented parenting and added to framework. sill got some problems with how to pass events through the new entity list (now part of the parenting-framework). changed to a more accurate way of coordinat-ing, the openGL coord-orientation. therefore the world is realy strange because it flies into the wrong direction.

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