-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
35 lines (28 loc) · 908 Bytes
/
Camera.h
File metadata and controls
35 lines (28 loc) · 908 Bytes
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
#pragma once
#include "AGameObject.h"
#include "InputListener.h"
class Camera : public AGameObject, public InputListener
{
public:
Camera(std::string name);
~Camera();
void update(float deltaTime) override;
void draw(int width, int height) override;
Matrix4x4 getViewMatrix();
virtual void onKeyDown(int key) override;
virtual void onKeyUp(int key) override;
virtual void onMouseMove(const Point deltaPos) override;
virtual void onLeftMouseDown(const Point deltaPos) override;
virtual void onLeftMouseUp(const Point deltaPos) override;
virtual void onRightMouseDown(const Point deltaPos) override;
virtual void onRightMouseUp(const Point deltaPos) override;
private:
void updateViewMatrix();
float ticks = 0.0f;
float mouseDown = false;
Vector3D forwardDirection;
Vector3D backwardDirection;
Matrix4x4 viewMatrix;
//float forwardDirection = 0.0f;
//Matrix4x4 worldCameraMatrix;
};