Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/bezierTrack/src/camera.h @ 3028

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

orxonox/branches/bezierTrack: now Camera follows Path. heavy cleanUp of not used stuff like elyptical Camera and so on…

File size: 1.9 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;
13class CameraTarget;
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 Coordinate
27{
28 private:
29  WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
30  Placement actual_place;               //!< the Camera's current position
31  Placement desired_place;        //!< where the Camera should be according to calculations
32  World* world;
33  CameraTarget* target;
34 
35  /* physical system - not needed yet */
36  float mass;            //!< mass
37  Vector *acceleration;  //!< acceleration
38  Vector *velocity;      //!< velocity
39 
40  /* elliptical camera mode variables */
41  Placement plLastBPlace;
42  float cameraOffset;
43  float cameraOffsetZ;
44  float deltaTime;
45  float t;
46  Vector r;
47  float rAbs;
48  float ka;
49  float a0;
50
51  Quaternion *from;
52  Quaternion *to;
53  Quaternion *res;
54 
55 
56  CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
57 
58  void update_desired_place ();
59 
60 public:
61  Camera (World* world);
62  ~Camera ();
63 
64  void time_slice (Uint32 deltaT);
65  void apply ();
66  void bind (WorldEntity* entity);
67  void jump (Placement* plc);
68
69  void setWorld(World* world); 
70
71};
72
73//! A Class to handle the Target of a Camera.
74class CameraTarget : public Coordinate
75{
76 private:
77  WorldEntity* lookAt;
78 
79 
80 public:
81  CameraTarget ();
82  CameraTarget (Vector pos); //!< a target only needs a Position and no Rotation
83
84  void setLookAt (WorldEntity* lookat);
85
86};
87
88#endif
Note: See TracBrowser for help on using the repository browser.