Last change
on this file since 3542 was
3399,
checked in by bensch, 20 years ago
|
orxonox/branches/nico: merged trunk into branches/nico
merged with command:
svn merge ../trunk/ nico/ -r 3238:HEAD
resolved conflict in favor of branches/nico.
|
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 "stdincl.h" |
---|
10 | #include "world_entity.h" |
---|
11 | |
---|
12 | |
---|
13 | class World; |
---|
14 | |
---|
15 | //! Camera |
---|
16 | /** |
---|
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. |
---|
22 | */ |
---|
23 | |
---|
24 | enum CAMERA_MODE {NORMAL, SMOTH_FOLLOW, STICKY, ELLIPTICAL}; |
---|
25 | |
---|
26 | class Camera : public WorldEntity { |
---|
27 | private: |
---|
28 | WorldEntity* bound; //!< the WorldEntity the Camera is bound to |
---|
29 | World* world; |
---|
30 | |
---|
31 | /* physical system - not needed yet */ |
---|
32 | float m; //!< mass |
---|
33 | Vector *fs; //!< seil-kraft |
---|
34 | Vector *a; //!< acceleration |
---|
35 | Vector *v; //!< velocity |
---|
36 | |
---|
37 | /* elliptical camera mode variables */ |
---|
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 updateDesiredPlace (); |
---|
55 | |
---|
56 | public: |
---|
57 | Camera (World* world); |
---|
58 | ~Camera (); |
---|
59 | |
---|
60 | void timeSlice (Uint32 deltaT); |
---|
61 | void apply (); |
---|
62 | void bind (WorldEntity* entity); |
---|
63 | void destroy(); |
---|
64 | |
---|
65 | void setWorld(World* world); |
---|
66 | |
---|
67 | }; |
---|
68 | |
---|
69 | #endif /* _CAMERA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.