This repository has been archived on 2024-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
DX11Starter/Camera.h
2022-04-09 21:04:28 -04:00

39 lines
809 B
C++

#pragma once
#include "Transform.h"
#include <memory>
class Camera
{
public:
Camera(float _x, float _y, float _z, float _aspect, float _fov, float _near, float _far, float _moveSpeed);
~Camera();
void Update(float _dt);
void UpdateViewMatrix();
void UpdateProjectionMatrix();
Transform* GetTransform();
DirectX::XMFLOAT4X4 GetViewMatrix();
DirectX::XMFLOAT4X4 GetProjectionMatrix();
void SetAspect(float _aspect);
void SetFOV(float _fov);
void SetNearClip(float _near);
void SetFarClip(float _far);
private:
float moveSpeed;
float aspect;
float fovYRadians;
float clipNear;
float clipFar;
DirectX::XMFLOAT4X4 viewMatrix;
DirectX::XMFLOAT4X4 projectionMatrix;
Transform transform;
void ReadInput(float _dt);
void ClampRotation();
};