Last change
on this file since 2624 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
|
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 | |
---|
13 | //! Camera |
---|
14 | /** |
---|
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. |
---|
20 | */ |
---|
21 | |
---|
22 | enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; |
---|
23 | |
---|
24 | class Camera { |
---|
25 | private: |
---|
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; |
---|
46 | |
---|
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 | |
---|
54 | void update_desired_place (); |
---|
55 | |
---|
56 | public: |
---|
57 | Camera (); |
---|
58 | ~Camera (); |
---|
59 | |
---|
60 | void time_slice (Uint32 deltaT); |
---|
61 | void apply (); |
---|
62 | void bind (WorldEntity* entity); |
---|
63 | void jump (Placement* plc); |
---|
64 | |
---|
65 | }; |
---|
66 | |
---|
67 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.