Files
Nuake-custom/Nuake/src/Scene/EditorCamera.h
Antoine Pilote 93d007680b Serializing editor camera position and direction.
Editor camera should resume where it was
2023-07-01 11:49:38 -04:00

41 lines
718 B
C++

#pragma once
#include "../Core/Timestep.h"
#include "../Rendering/Camera.h"
#include "src/Core/Core.h"
namespace Nuake
{
class EditorCamera : public Camera
{
public:
EditorCamera()
{
Translation = Vector3(10, 10, 10);
SetDirection(Vector3(-1, -1, -1));
}
void Update(Timestep ts, const bool hover);
Vector3 TargetPos = Vector3(0, 0, 0);
bool IsMoving = false;
Ref<EditorCamera> Copy();
json Serialize();
bool Deserialize(const std::string& str);
void SetYaw(float yaw);
void SetPitch(float pitch);
private:
bool controlled = false;
bool firstMouse = false;
float mouseLastX;
float mouseLastY;
float Yaw = -135.f;
float Pitch = -45.f;
void UpdateDirection();
};
}