Files
Nuake-custom/Nuake/src/Scene/EditorCamera.h
Antoine Pilote d3ec4e1c02 Better Gizmos
Gizmos now display half opacity when occluded, same for lines
Improved editor camera, should keep updating even if not controlled
Viewport should not grab input when another imgui element is over it
2023-10-09 15:22:39 -04:00

49 lines
862 B
C++

#pragma once
#include "../Core/Timestep.h"
#include "../Rendering/Camera.h"
#include "src/Core/Core.h"
namespace Nuake
{
class EditorCamera : public Camera
{
private:
bool m_IsFlying = false;
public:
EditorCamera()
{
Yaw = 0.0f;
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 json& j);
void SetYaw(float yaw);
void SetPitch(float pitch);
bool IsFlying() const { return m_IsFlying; }
private:
bool controlled = false;
bool firstMouse = false;
float mouseLastX;
float mouseLastY;
float Yaw = 0.0f;
float Pitch = 0.0f;
float TargetYaw = 0.f;
float TargetPitch = 0.0f;
void UpdateDirection();
};
}