Last change
on this file since 3543 was
3543,
checked in by bensch, 20 years ago
|
orxonox/trunk: some more classes now destroy themselves via virtual-destructors and call to predecessing destroy-function
also made
#include "stdincl.h" out of unnecessary h-files, so we got faster compile time.
|
File size:
1.4 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 "world_entity.h" |
---|
10 | |
---|
11 | class World; |
---|
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 : public WorldEntity { |
---|
25 | private: |
---|
26 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
---|
27 | World* world; |
---|
28 | |
---|
29 | /* physical system - not needed yet */ |
---|
30 | float m; //!< mass |
---|
31 | Vector *fs; //!< seil-kraft |
---|
32 | Vector *a; //!< acceleration |
---|
33 | Vector *v; //!< velocity |
---|
34 | |
---|
35 | /* elliptical camera mode variables */ |
---|
36 | float cameraOffset; |
---|
37 | float cameraOffsetZ; |
---|
38 | float deltaTime; |
---|
39 | float t; |
---|
40 | Vector r; |
---|
41 | float rAbs; |
---|
42 | float ka; |
---|
43 | float a0; |
---|
44 | |
---|
45 | Quaternion *from; |
---|
46 | Quaternion *to; |
---|
47 | Quaternion *res; |
---|
48 | |
---|
49 | |
---|
50 | CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity |
---|
51 | |
---|
52 | void updateDesiredPlace (); |
---|
53 | |
---|
54 | public: |
---|
55 | Camera (World* world); |
---|
56 | virtual ~Camera (); |
---|
57 | void destroy(void); |
---|
58 | |
---|
59 | void timeSlice (Uint32 deltaT); |
---|
60 | void apply (); |
---|
61 | void bind (WorldEntity* entity); |
---|
62 | |
---|
63 | void setWorld(World* world); |
---|
64 | |
---|
65 | }; |
---|
66 | |
---|
67 | #endif /* _CAMERA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.