source:
orxonox.OLD/orxonox/branches/trackManager/src/camera.h
@
3512
Last change on this file since 3512 was 3369, checked in by bensch, 20 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[2096] | 1 | /*! |
2 | \file camera.h | |
3 | \brief Viewpoint controlling class definitions | |
4 | */ | |
[2068] | 5 | |
[3224] | 6 | #ifndef _CAMERA_H |
7 | #define _CAMERA_H | |
[2068] | 8 | |
[2100] | 9 | #include "stdincl.h" |
[3365] | 10 | #include "world_entity.h" |
[2100] | 11 | |
[3365] | 12 | |
[2636] | 13 | class World; |
[2100] | 14 | |
[2096] | 15 | //! Camera |
16 | /** | |
[2636] | 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. | |
[2096] | 22 | */ |
[2551] | 23 | |
24 | enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; | |
25 | ||
[3365] | 26 | class Camera : public WorldEntity { |
[2068] | 27 | private: |
[2551] | 28 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
[2636] | 29 | World* world; |
[2551] | 30 | |
31 | /* physical system - not needed yet */ | |
32 | float m; //!< mass | |
33 | Vector *fs; //!< seil-kraft | |
34 | Vector *a; //!< acceleration | |
35 | Vector *v; //!< velocity | |
36 | ||
37 | /* elliptical camera mode variables */ | |
38 | float cameraOffset; | |
39 | float cameraOffsetZ; | |
40 | float deltaTime; | |
41 | float t; | |
42 | Vector r; | |
43 | float rAbs; | |
44 | float ka; | |
45 | float a0; | |
[2068] | 46 | |
[2551] | 47 | Quaternion *from; |
48 | Quaternion *to; | |
49 | Quaternion *res; | |
50 | ||
[2636] | 51 | |
[2551] | 52 | CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity |
[2636] | 53 | |
[3228] | 54 | void updateDesiredPlace (); |
[2636] | 55 | |
[2068] | 56 | public: |
[2636] | 57 | Camera (World* world); |
[2068] | 58 | ~Camera (); |
[2636] | 59 | |
[3225] | 60 | void timeSlice (Uint32 deltaT); |
[2636] | 61 | void apply (); |
62 | void bind (WorldEntity* entity); | |
[3213] | 63 | void destroy(); |
[2068] | 64 | |
[2636] | 65 | void setWorld(World* world); |
[2068] | 66 | |
67 | }; | |
68 | ||
[3224] | 69 | #endif /* _CAMERA_H */ |
Note: See TracBrowser
for help on using the repository browser.