1#ifndef RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
2#define RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
5#include "./Vector2.hpp"
7#include "./RadiansDegrees.hpp"
8#include "./raylib-cpp-utils.hpp"
21 Camera2D(::Vector2 offset, ::Vector2 target,
22 Degree rotation = 0.0f,
float zoom = 1.0f) : ::Camera2D{offset, target, rotation, zoom} {}
34 GETTERSETTER(::Vector2, Offset, offset)
36 GETTERSETTER(
Degree, Rotation, rotation)
37 GETTERSETTER(
float, Zoom, zoom)
48 return ::GetCameraMatrix2D(*
this);
55 return ::GetScreenToWorld2D(position, *
this);
62 return ::GetWorldToScreen2D(position, *
this);
66 void set(const ::Camera2D& camera) {
67 offset = camera.offset;
68 target = camera.target;
69 rotation = camera.rotation;
Camera2D type, defines a 2d camera.
Vector2 GetScreenToWorld(::Vector2 position) const
Returns the world space position for a 2d camera screen space position.
Matrix GetMatrix() const
Returns camera 2d transform matrix.
Vector2 GetWorldToScreen(::Vector2 position) const
Returns the screen space position for a 3d world space position.
Degree type (allows automatic worry free conversion between radians and degrees)
Matrix type (OpenGL style 4x4 - right handed, column major)