27 #ifndef HX3D_GRAPHICS_VIEWPORTS_VIEWPORT 28 #define HX3D_GRAPHICS_VIEWPORTS_VIEWPORT 30 #include <glm/vec2.hpp> 32 #include "hx3d/graphics/cameras/camera.hpp" 33 #include "hx3d/utils/ptr.hpp" 75 void update(
Camera& camera,
const int screenWidth,
const int screenHeight);
void apply(Camera &camera)
Apply the viewport on the screen, centering the camera.
float _worldHeight
World height.
virtual void internalUpdate(Camera &camera)=0
Update the viewport, centering the camera (internal).
int _screenHeight
Screen height.
void setScreenPosition(const float x, const float y)
Set the viewport position.
int _screenWidth
Screen width.
void update(Camera &camera, const int screenWidth, const int screenHeight)
Update the viewport with a new screen width and height, centering the camera.
glm::vec2 screenToWorld(const glm::vec2 screenPoint)
Convert a screen point to a world point.
float _worldWidth
World width.
glm::vec2 getWorldSize()
Get the world size.