summaryrefslogtreecommitdiff
path: root/src/koopatlas/camera.h
blob: 39e34d0bc3d8f9dfb54abf64a8edfd82abb45709 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __KOOPATLAS_CAMERA_H
#define __KOOPATLAS_CAMERA_H

#include "koopatlas/core.h"

class dWorldCamera_c : public dBase_c {
	public:
		int onCreate();
		int onDelete();
		int onExecute();
		int onDraw();

		dWorldCamera_c();

		EGG::Screen screen;
		EGG::LookAtCamera camera3d;

		EGG::ProjectOrtho projection2d;
		EGG::LookAtCamera camera2d;

		Vec camPos, camTarget, camUp;


		float currentX, currentY, zoomLevel;

		void calculateScreenGeometry();


		float zoomDivisor, screenLeft, screenTop, screenWidth, screenHeight;


		void doStuff(float);
		void generateCameraMatrices();
		void updateCameras();

		static dWorldCamera_c *build();
		static dWorldCamera_c *instance;
};

#endif