Remove Point2f, replace with Vector2f

This commit is contained in:
Bram Verhulst
2024-04-17 13:54:48 +02:00
parent 64e96ab209
commit db83ae5e13
42 changed files with 494 additions and 634 deletions

View File

@@ -6,20 +6,20 @@ class Camera
{
public:
Camera();
Camera(const Point2f& position, float scale = 1);
Camera(const Vector2f& position, float scale = 1);
~Camera() = default;
Camera(const Camera& other) = default;
Camera& operator=(const Camera& other) = default;
void SetPosition(const Point2f& position) {
void SetPosition(const Vector2f& position) {
m_Position = position;
}
void SetScale(const float scale) {
m_Scale = scale;
}
const Point2f& GetPosition() const {
const Vector2f& GetPosition() const {
return m_Position;
}
float GetScale() const {
@@ -33,13 +33,13 @@ public:
m_FollowingPlayer = player;
}
Point2f TransformMouse(const Point2f& mousePos) const;
Point2f TransformWorld(const Point2f& worldPos) const;
Vector2f TransformMouse(const Vector2f& mousePos) const;
Vector2f TransformWorld(const Vector2f& worldPos) const;
Rectf Viewport = Rectf { 0, 0, 846.f, 500.f };
//TODO: Remove this and make it some static
private:
Point2f m_Position;
Vector2f m_Position;
float m_Scale;
Player* m_FollowingPlayer { nullptr };
//TODO: Ask if the rule applies to the fact that the player is not managed by the camera