-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
32 lines (26 loc) · 771 Bytes
/
Camera.h
File metadata and controls
32 lines (26 loc) · 771 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
#pragma once
#include <directxmath/DirectXMath.h>
#include <Windows.h>
class Camera
{
public:
Camera();
Camera(const Camera& camera);
Camera(DirectX::XMVECTOR init_camera_pos, DirectX::XMVECTOR init_world_up, float ini_yaw, float init_pitch, float movement_speed, float mouse_sensitive);
~Camera();
void KeyControl(int keys, float delta_time);
void MouseControl(float x, float y);
void UpdateViewMatrix();
DirectX::XMMATRIX GetViewMatrix();
DirectX::XMVECTOR GetCameraPosition();
private:
DirectX::XMVECTOR m_camera_pos{};
DirectX::XMVECTOR m_camera_front{};
DirectX::XMVECTOR m_camera_up{};
DirectX::XMVECTOR m_camera_right{};
DirectX::XMVECTOR m_world_up{0, 1, 0};
float m_yaw;
float m_pitch;
float m_movement_speed;
float m_mouse_sensitive;
};