TazGraph Project v0.1.0
Loading...
Searching...
No Matches
ICamera.h
1#pragma once
2
3#define GLM_ENABLE_EXPERIMENTAL
4#include <glm/glm.hpp>
5#include <glm/gtc/matrix_transform.hpp>
6#include <glm/gtx/rotate_vector.hpp>
7#include <SDL2/SDL.h>
8
9class ICamera {
10public:
11 virtual ~ICamera() = default;
12
13 // Initializes the camera2D.worldLocation with the screen's width and height
14 virtual void init() = 0;
15
16 // Updates the camera2D.worldLocation's matrix if there have been any changes
17 virtual void update() = 0;
18
19 // Converts screen coordinates to world coordinates
20 virtual glm::vec2 convertScreenToWorld(glm::vec2 screenCoords) const = 0;
21
22 // Returns the dimensions of the camera2D.worldLocation's view
23 virtual glm::ivec2 getCameraDimensions() const = 0;
24
25 // Returns the SDL_Rect representing the camera2D.worldLocation's viewport
26 virtual SDL_FRect getCameraRect() const = 0;
27
28 // Additional methods to expose camera2D.worldLocation properties as needed
29 virtual glm::vec3 getPosition() const = 0;
30 virtual void setPosition(const glm::vec3 newPosition) = 0;
31 virtual void setPosition_X(const float newPosition) = 0;
32 virtual void setPosition_Y(const float newPosition) = 0;
33 virtual void setPosition_Z(const float newPosition) = 0;
34 virtual float getScale() const = 0;
35 virtual glm::mat4 getCameraMatrix() const = 0;
36 virtual void setScale(float scale) = 0;
37
38 virtual bool isPointInCameraView(const glm::vec4 point, float margin) = 0;
39 virtual void makeCameraDirty() = 0;
40 virtual bool hasChanged() = 0;
41 virtual void refreshCamera() = 0;
42};
Definition ICamera.h:9