Last change
on this file since 3241 was
3236,
checked in by patrick, 20 years ago
|
/orxonox/trunk: unstable - problems getting collision to compile
|
File size:
1.6 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file camera.h |
---|
3 | \brief Viewpoint controlling class definitions |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _CAMERA_H |
---|
7 | #define _CAMERA_H |
---|
8 | |
---|
9 | #include "stdincl.h" |
---|
10 | |
---|
11 | class WorldEntity; |
---|
12 | class World; |
---|
13 | |
---|
14 | //! Camera |
---|
15 | /** |
---|
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. |
---|
21 | */ |
---|
22 | |
---|
23 | enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; |
---|
24 | |
---|
25 | class Camera { |
---|
26 | private: |
---|
27 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
---|
28 | Placement actualPlace; //!< the Camera's current position |
---|
29 | Placement desiredPlace; //!< where the Camera should be according to calculations |
---|
30 | World* world; |
---|
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; |
---|
48 | |
---|
49 | Quaternion *from; |
---|
50 | Quaternion *to; |
---|
51 | Quaternion *res; |
---|
52 | |
---|
53 | |
---|
54 | CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity |
---|
55 | |
---|
56 | void updateDesiredPlace (); |
---|
57 | |
---|
58 | public: |
---|
59 | Camera (World* world); |
---|
60 | ~Camera (); |
---|
61 | |
---|
62 | void timeSlice (Uint32 deltaT); |
---|
63 | void apply (); |
---|
64 | void bind (WorldEntity* entity); |
---|
65 | void jump (Placement* plc); |
---|
66 | void destroy(); |
---|
67 | |
---|
68 | void setWorld(World* world); |
---|
69 | |
---|
70 | }; |
---|
71 | |
---|
72 | #endif /* _CAMERA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.