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