3#include "FrameBuffer.h"
15 static std::string
GetType() {
return "Camera"; };
88 int Serialize(std::fstream* data,
int offset)
override;
90 int Deserialize(std::fstream* data,
int offset)
override;
Defines the GameObject class and its related components.
The Camera class represents a camera in the game world.
Definition Camera.h:9
bool isActive
Definition Camera.h:31
int Serialize(std::fstream *data, int offset) override
Serialize the object and write it to the file.
Definition Camera.cpp:68
static std::string GetType()
Gets the type of the camera.
Definition Camera.h:15
float zoom
Definition Camera.h:81
float rotation
Definition Camera.h:80
void Update()
Updates the camera.
Definition Camera.cpp:40
static void UpdateActiveCamera()
Updates the active camera.
Definition Camera.cpp:4
void MoveTo(Vector2< int > target, float interpolationTime)
Moves the camera to the target position with interpolation.
Definition Camera.cpp:48
fVec2 position
Definition Camera.h:79
float alpha
Definition Camera.h:30
Matrix4< float > viewMatrix
Definition Camera.h:25
void ChangeOrtho(float sizeX, float sizeY)
Changes the orthographic size of the camera.
Definition Camera.cpp:26
static Camera * ActiveCamera
Definition Camera.h:85
FrameBuffer fbo
Definition Camera.h:83
fVec2 size
Definition Camera.h:27
~Camera()
Destructor for the Camera class.
Definition Camera.cpp:62
fVec3 clearColor
Definition Camera.h:29
void Capture()
Captures the camera.
Definition Camera.cpp:9
Matrix4< float > projectionMatrix
Definition Camera.h:24
Camera()=default
Default constructor for the Camera class.
fVec2 viewPortSize
Definition Camera.h:28
int Deserialize(std::fstream *data, int offset) override
Deserialize the object from the file.
Definition Camera.cpp:85
GameObject * attachedObj
Definition Camera.h:32
void Use()
Uses the camera.
Definition Camera.cpp:54
The FrameBuffer class represents a framebuffer object.
Definition FrameBuffer.h:12
Base class for game components.
Definition GameObject.h:29
Class representing a game object.
Definition GameObject.h:68