Last change
on this file since 2757 was
2636,
checked in by patrick, 20 years ago
|
- Added a GameLoader to the game. This enables orxonox to load a campaign consisting of multimple worlds and cinematics etc. However, cinematics are not yet implemented.
In the game you can jump from one level to the other by pressing x. Currently there are only two very simple levels defined. (DEBUG_LEVEL_0, DEBUG_LEVEL_1).
- Added Error Handling structs to signal the error source and code
|
File size:
1.6 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; |
---|
[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 |
---|
| 28 | Placement actual_place; //!< the Camera's current position |
---|
| 29 | Placement desired_place; //!< 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 | |
---|
| 56 | void update_desired_place (); |
---|
| 57 | |
---|
[2068] | 58 | public: |
---|
[2636] | 59 | Camera (World* world); |
---|
[2068] | 60 | ~Camera (); |
---|
[2636] | 61 | |
---|
| 62 | void time_slice (Uint32 deltaT); |
---|
| 63 | void apply (); |
---|
| 64 | void bind (WorldEntity* entity); |
---|
| 65 | void jump (Placement* plc); |
---|
[2068] | 66 | |
---|
[2636] | 67 | void setWorld(World* world); |
---|
[2068] | 68 | |
---|
| 69 | }; |
---|
| 70 | |
---|
| 71 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.