Last change
on this file since 2588 was
2551,
checked in by patrick, 20 years ago
|
orxonox/trunk: minor changes - enhanced sc controll, fixed uncontrolled rotation effect, added some debug outputs for testing purposes, reformatted some src files from win style but not all
|
File size:
1.5 KB
|
Rev | Line | |
---|
[2096] | 1 | /*! |
---|
| 2 | \file camera.h |
---|
| 3 | \brief Viewpoint controlling class definitions |
---|
| 4 | */ |
---|
[2068] | 5 | |
---|
| 6 | #ifndef CAMERA_H |
---|
| 7 | #define CAMERA_H |
---|
| 8 | |
---|
[2100] | 9 | #include "stdincl.h" |
---|
| 10 | |
---|
| 11 | class WorldEntity; |
---|
| 12 | |
---|
[2096] | 13 | //! Camera |
---|
| 14 | /** |
---|
[2551] | 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. |
---|
[2096] | 20 | */ |
---|
[2551] | 21 | |
---|
| 22 | enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; |
---|
| 23 | |
---|
[2068] | 24 | class Camera { |
---|
| 25 | private: |
---|
[2551] | 26 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
---|
| 27 | Placement actual_place; //!< the Camera's current position |
---|
| 28 | Placement desired_place; //!< where the Camera should be according to calculations |
---|
| 29 | |
---|
| 30 | /* physical system - not needed yet */ |
---|
| 31 | float m; //!< mass |
---|
| 32 | Vector *fs; //!< seil-kraft |
---|
| 33 | Vector *a; //!< acceleration |
---|
| 34 | Vector *v; //!< velocity |
---|
| 35 | |
---|
| 36 | /* elliptical camera mode variables */ |
---|
| 37 | Placement plLastBPlace; |
---|
| 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 | |
---|
| 51 | |
---|
| 52 | CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity |
---|
| 53 | |
---|
[2068] | 54 | void update_desired_place (); |
---|
| 55 | |
---|
| 56 | public: |
---|
| 57 | Camera (); |
---|
| 58 | ~Camera (); |
---|
| 59 | |
---|
[2100] | 60 | void time_slice (Uint32 deltaT); |
---|
| 61 | void apply (); |
---|
| 62 | void bind (WorldEntity* entity); |
---|
| 63 | void jump (Placement* plc); |
---|
[2068] | 64 | |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.