Line data Source code
1 : /**
2 : * @file Camera.h
3 : * @brief Camera management.
4 : *
5 : * Camera game object.
6 : */
7 : #ifndef _CAMERA_H_
8 : #define _CAMERA_H_
9 :
10 : #include "Object.h"
11 : #include "Frustum.h"
12 :
13 : class Camera : public Object {
14 : public:
15 : Camera();
16 : Camera(const int&);
17 : virtual ~Camera();
18 :
19 : void update(const float&);
20 : void setCamera(const Vector& position, const Vector& velocity, const Quaternion& rotation, const Vector& rotationVelocity);
21 : void prepareGLView();
22 :
23 : // accessor functions
24 : void getRotationMatrix(Matrix &m) const;
25 :
26 0 : void printTypeName() { PRINT_DEBUG("Camera\n"); }
27 : void buildLuaObjectTable(lua_State *L);
28 :
29 : void draw(Object*);
30 :
31 : Frustum *getFrustum();
32 :
33 0 : void drawOutline(Object*) {}; // Camera*
34 0 : void drawShadow(Vector*) {}
35 :
36 0 : void handleCollision(Object*) {};
37 0 : void update(Vector*) {};
38 : void prepare() {};
39 0 : void animate(const float&, Object*) {}; // Camera*
40 :
41 : void setProjectionMatrix();
42 :
43 : Matrix rotationMatrix; // send to rendering library
44 : Frustum frustum;
45 : Matrix projectionMatrix;
46 : Matrix modelViewMatrix;
47 :
48 : Quaternion worldRotation;
49 :
50 : Matrix final;
51 : int id_;
52 :
53 : private:
54 : void initialize();
55 : };
56 :
57 : #endif
|