You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
/******************************************************************************
|
|
|
|
|
* File - orthographic_camera.h
|
|
|
|
|
* Author - Joey Pollack
|
|
|
|
|
* Date - 2022/01/25 (y/m/d)
|
|
|
|
|
* Mod Date - 2022/01/25 (y/m/d)
|
|
|
|
|
* Description - A 2D camera to be used with the World
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef CAMERA_H_
|
|
|
|
|
#define CAMERA_H_
|
|
|
|
|
|
|
|
|
|
#include <core/types.h>
|
|
|
|
|
|
|
|
|
|
namespace lunarium
|
|
|
|
|
{
|
|
|
|
|
class OrthographicCamera
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
OrthographicCamera(Vec2f position = { 0.0f, 0.0f }, Sizef viewport_size = {0.0f, 0.0f });
|
|
|
|
|
|
|
|
|
|
void MoveLeft(float amt);
|
|
|
|
|
void MoveUp(float amt);
|
|
|
|
|
void Rotate(float amt);
|
|
|
|
|
|
|
|
|
|
void SetPosition(Vec2f position);
|
|
|
|
|
void SetRotation(float rot);
|
|
|
|
|
|
|
|
|
|
void SetViewportSize(Sizef size);
|
|
|
|
|
|
|
|
|
|
glm::mat4 GetViewProjection();
|
|
|
|
|
Sizef GetViewport() const;
|
|
|
|
|
|
|
|
|
|
Vec2f GetPosition() const;
|
|
|
|
|
float GetRotation() const;
|
|
|
|
|
Sizef GetViewportSize() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void RecalculateView();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
Vec2f mPosition;
|
|
|
|
|
float mRotation;
|
|
|
|
|
Sizef mViewportSize;
|
|
|
|
|
|
|
|
|
|
glm::mat4 mProjection;
|
|
|
|
|
glm::mat4 mView;
|
|
|
|
|
glm::mat4 mViewProj;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // CAMERA_H_
|