Last change
on this file since 3321 was
3302,
checked in by patrick, 20 years ago
|
orxonox/branches/parenting: implemented parenting and added to framework. sill got some problems with how to pass events through the new entity list (now part of the parenting-framework). changed to a more accurate way of coordinat-ing, the openGL coord-orientation. therefore the world is realy strange because it flies into the wrong direction.
|
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" |
---|
[3302] | 10 | #include "world_entity.h" |
---|
[2100] | 11 | |
---|
[3302] | 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 | |
---|
[3302] | 26 | class Camera : public WorldEntity { |
---|
[2068] | 27 | private: |
---|
[2551] | 28 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
---|
[3236] | 29 | Placement actualPlace; //!< the Camera's current position |
---|
[3228] | 30 | Placement desiredPlace; //!< where the Camera should be according to calculations |
---|
[2636] | 31 | World* world; |
---|
[2551] | 32 | |
---|
| 33 | /* physical system - not needed yet */ |
---|
| 34 | float m; //!< mass |
---|
| 35 | Vector *fs; //!< seil-kraft |
---|
| 36 | Vector *a; //!< acceleration |
---|
| 37 | Vector *v; //!< velocity |
---|
| 38 | |
---|
| 39 | /* elliptical camera mode variables */ |
---|
| 40 | Placement plLastBPlace; |
---|
| 41 | float cameraOffset; |
---|
| 42 | float cameraOffsetZ; |
---|
| 43 | float deltaTime; |
---|
| 44 | float t; |
---|
| 45 | Vector r; |
---|
| 46 | float rAbs; |
---|
| 47 | float ka; |
---|
| 48 | float a0; |
---|
[2068] | 49 | |
---|
[2551] | 50 | Quaternion *from; |
---|
| 51 | Quaternion *to; |
---|
| 52 | Quaternion *res; |
---|
| 53 | |
---|
[2636] | 54 | |
---|
[2551] | 55 | CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity |
---|
[2636] | 56 | |
---|
[3228] | 57 | void updateDesiredPlace (); |
---|
[2636] | 58 | |
---|
[2068] | 59 | public: |
---|
[2636] | 60 | Camera (World* world); |
---|
[2068] | 61 | ~Camera (); |
---|
[2636] | 62 | |
---|
[3225] | 63 | void timeSlice (Uint32 deltaT); |
---|
[2636] | 64 | void apply (); |
---|
| 65 | void bind (WorldEntity* entity); |
---|
| 66 | void jump (Placement* plc); |
---|
[3213] | 67 | void destroy(); |
---|
[2068] | 68 | |
---|
[2636] | 69 | void setWorld(World* world); |
---|
[2068] | 70 | |
---|
| 71 | }; |
---|
| 72 | |
---|
[3224] | 73 | #endif /* _CAMERA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.