Files
directx-plane-game/Graphics2/Camera.h
iDunnoDev 616f68bf8b Added Comments
Added ability to hold shift and skip the terrain generation when loading
Added ability for the perlin terrain to save a raw image of the terrain to use as a cache
2022-06-13 16:41:25 +01:00

53 lines
1.3 KiB
C++

#pragma once
#include "core.h"
#include "DirectXCore.h"
#include "SharedMethods.h"
#include "ObjectNode.h"
class Camera
{
public:
Camera();
~Camera();
void Update();
XMMATRIX GetViewMatrix();
XMVECTOR GetCameraPosition();
void SetCameraPosition(XMVECTOR vectorIn);
void SetCameraPosition(XMFLOAT4 floatIn);
void SetCameraPosition(float x, float y, float z);
void SetPitch(float pitch);
void SetTotalPitch(float pitch);
float GetPitch() const;
void SetYaw(float yaw);
void SetTotalYaw(float yaw);
float GetYaw() const;
void SetRoll(float roll);
void SetTotalRoll(float roll);
float GetRoll() const;
void SetLeftRight(float leftRight);
void SetForwardBack(float forwardBack);
// Method for setting which object node is being followed
void SetFollowNode(shared_ptr<ObjectNode> nodeFollowed, XMFLOAT3 followOffset, bool positionOnly);
private:
XMFLOAT4 _cameraPosition;
XMFLOAT4X4 _viewMatrix;
float _moveLeftRight;
float _moveForwardBack;
float _cameraYaw;
// Camera yaw previous to help with the rotation, remove later
float _cameraYawPrev;
float _cameraPitch;
float _cameraRoll;
shared_ptr<ObjectNode> _nodeFollowed;
XMFLOAT3 _followOffset;
bool _followPositionOnly;
};