17#ifndef _FGE_GRAPHIC_C_VIEW_HPP_INCLUDED
18#define _FGE_GRAPHIC_C_VIEW_HPP_INCLUDED
27#include "FastEngine/fge_extern.hpp"
28#include "FastEngine/C_rect.hpp"
29#include "FastEngine/C_vector.hpp"
30#include "FastEngine/vulkan/C_viewport.hpp"
47 View(Vector2f
const& center, Vector2f
const& size);
49 void setCenter(Vector2f
const& center);
50 Vector2f
const& getCenter()
const;
61 Vector2f
const& getSize()
const;
63 void setRotation(
float angleDeg);
64 float getRotation()
const;
94 void move(Vector2f
const& offset);
122 [[nodiscard]] glm::mat4
const& getInverseTransform()
const;
131 [[nodiscard]] glm::mat4
const& getInverseProjection()
const;
134 fge::Vector2f g_center;
135 fge::Vector2f g_size;
139 mutable glm::mat4 g_transform;
140 mutable glm::mat4 g_projection;
141 mutable glm::mat4 g_inverseTransform;
142 mutable glm::mat4 g_inverseProjection;
143 mutable bool g_transformUpdated;
144 mutable bool g_projectionUpdated;
145 mutable bool g_invTransformUpdated;
146 mutable bool g_invProjectionUpdated;
Define a camera in a 2D scene.
Definition C_view.hpp:43
void move(Vector2f const &offset)
Helper function to move the view.
glm::mat4 const & getTransform() const
Get the transform of the view.
void rotate(float angle)
Helper function to rotate the view.
glm::mat4 const & getProjection() const
Get the projection matrix of the view.
void zoom(float factor)
Helper function to zoom the view.
void setSize(Vector2f const &size)
Set the size of the view.
void resizeFixCenter(fge::Vector2f const &newSize)
Resize the view and move it relatively to old center in order to expand it.
void reset(fge::vulkan::Viewport const &viewport)
Reset the view to the given viewport.
void setFactorViewport(fge::RectFloat const &factorViewport)
Set the viewport rectangle of the view.
Definition C_viewport.hpp:27