-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camera.hpp
64 lines (44 loc) · 1.23 KB
/
Camera.hpp
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
54
55
56
57
58
59
60
61
62
63
64
#ifndef CAMERA_HPP
#define CAMERA_HPP
#include <d3d11.h>
#include <DirectXMath.h>
#include "ConstantBufferClass.hpp"
class Camera {
private:
float CameraMovementSpeed = 2.0;
float CameraRotationSpeed = 0.02;
DirectX::XMVECTOR CameraStartPosition = { 10, 10, 10 };
void MoveCameraUp();
void MoveCameraLeft();
void MoveCameraRight();
void MoveCameraForward();
void MoveCameraBackward();
void RotateCameraVertically(POINT MouseMovement);
void RotateCameraHorizontally(POINT mouseMovement);
void UpdateRightDirection();
public:
DirectX::XMVECTOR CameraPosition;
DirectX::XMVECTOR CameraDirection;
DirectX::XMVECTOR CameraUpDirection;
DirectX::XMVECTOR CameraRightDirection;
DirectX::XMMATRIX View;
Camera();
~Camera();
// Current controls:
// 'w','a','s','d' controls camera movement.
// mouse cursor controls camera direction.
// 'r' resets the camera.
// 'h' switches to hovercam
void UpdateCamera(
TCHAR CharacterMessage,
POINT MouseCoordinates,
MatrixBufferStored *FormattedStructData,
ID3D11Buffer* *GSConstantBuffer,
ID3D11DeviceContext* *DeviceContext,
bool HoverCamActivationStatus
);
void ResetCamera();
// GET FUNCTIONS
DirectX::XMFLOAT3 GetCameraPositionFloat3();
};
#endif