Files
Seele/src/Engine/Component/Camera.h
T

42 lines
755 B
C++
Raw Normal View History

#pragma once
#include "Component.h"
#include "Math/Matrix.h"
#include "Transform.h"
namespace Seele
{
namespace Component
{
struct Camera
{
REQUIRE_COMPONENT(Transform)
Camera();
~Camera();
2023-01-21 18:43:21 +01:00
Matrix4 getViewMatrix() const
2022-03-19 22:45:30 +01:00
{
assert (!bNeedsViewBuild);
2022-03-19 22:45:30 +01:00
return viewMatrix;
}
2023-01-21 18:43:21 +01:00
Vector getCameraPosition() const
2022-03-19 22:45:30 +01:00
{
2023-12-03 23:12:20 +01:00
return cameraPos;
2022-03-19 22:45:30 +01:00
}
void mouseMove(float deltaX, float deltaY);
void mouseScroll(float x);
void moveX(float amount);
void moveY(float amount);
void buildViewMatrix();
2024-01-02 16:48:03 +01:00
2023-11-13 13:23:16 +01:00
bool mainCamera = false;
private:
2024-01-02 16:48:03 +01:00
float yaw;
float pitch;
Matrix4 viewMatrix;
Vector cameraPos;
bool bNeedsViewBuild;
};
} // namespace Component
} // namespace Seele