#pragma once

#include <frostbite2D/types/type_math.h>

namespace frostbite2D {

class Camera {
public:
  Camera();
  
  void setPosition(const Vec2& pos);
  void setZoom(float zoom);
  void setViewport(int width, int height);
  void setFlipY(bool flip) { flipY_ = flip; } // 调试用：Y轴翻转开关
  
  const Vec2& getPosition() const { return position_; }
  float getZoom() const { return zoom_; }
  
  void lookAt(const Vec2& target);
  void move(const Vec2& delta);
  void zoomAt(float factor, const Vec2& screenPos);
  
  glm::mat4 getViewMatrix() const;
  glm::mat4 getProjectionMatrix() const;
  
 private:
  Vec2 position_;
  float zoom_ = 1.0f;
  int viewportWidth_ = 1280;
  int viewportHeight_ = 720;
  bool flipY_ = false; // 调试用：Y轴翻转开关
};

}