This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
54 lines (41 loc) · 1.38 KB
/
Copy pathCamera.h
File metadata and controls
54 lines (41 loc) · 1.38 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <directxmath.h>
#include "Input.h"
#define MOVEMENTSPEED 4.0f
using namespace DirectX;
class Camera
{
protected:
XMFLOAT3 _eye;
XMFLOAT3 _at;
XMFLOAT3 _up;
FLOAT _windowWidth;
FLOAT _windowHeight;
FLOAT _nearDepth;
FLOAT _farDepth;
XMFLOAT4X4 _view;
XMFLOAT4X4 _projection;
//this makes this class abstract, requiring this method.
//gathered this technique from the following source:
//https://www.simplilearn.com/tutorials/cpp-tutorial/abstract-class-in-cpp#:~:text=An%20abstract%20class%20in%20C%2B%2B%20is%20one%20that,become%20an%20abstract%20class%20in%20its%20own%20right.
virtual void UpdateView() = 0;
//TODO: add billboard to render for when camera is not in use.
public:
Camera() {}
~Camera();
//this class is abstract, should never be constructed
virtual void Update(Input* nextInput, float nextT) = 0;
void SetPosition(XMFLOAT3 position) { _eye = position; }
void SetLookAt(XMFLOAT3 at) { _at = at; }
void SetUp(XMFLOAT3 up) { _up = up; }
XMFLOAT3 GetPosition() { return _eye; }
XMFLOAT3 GetLookAt() { return _at; }
XMFLOAT3 GetUp() { return _up; }
XMFLOAT4X4 GetView() { return _view; }
XMFLOAT4X4 GetProjection() { return _projection; }
XMFLOAT4X4 GetCombinedViewProjection();
void Reshape(FLOAT windowWidth, FLOAT windowHeight, FLOAT nearDepth, FLOAT farDepth);
};