1#ifndef RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
2#define RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
5#include "./Vector2.hpp"
6#include "./raylib-cpp-utils.hpp"
20 float rotation = 0.0f,
float zoom = 1.0f) : ::
Camera2D{offset, target, rotation, zoom} {}
32 GETTERSETTER(::Vector2, Offset, offset)
34 GETTERSETTER(
float, Rotation, rotation)
35 GETTERSETTER(
float, Zoom, zoom)
46 return ::GetCameraMatrix2D(*
this);
53 return ::GetWorldToScreen2D(position, *
this);
60 return ::GetScreenToWorld2D(position, *
this);
64 inline void set(const ::Camera2D& camera) {
65 offset = camera.offset;
66 target = camera.target;
67 rotation = camera.rotation;
Camera2D type, defines a 2d camera.
Camera2D(const ::Camera2D &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.
Camera2D(::Vector2 offset, ::Vector2 target, float rotation=0.0f, float zoom=1.0f)
Matrix type (OpenGL style 4x4 - right handed, column major)
All raylib-cpp classes and functions appear in the raylib namespace.