1 #ifndef RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
2 #define RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_
4 #include "./raylib.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} {}
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 void set(const ::Camera2D& camera) {
65 offset = camera.offset;
66 target = camera.target;
67 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.
Matrix type (OpenGL style 4x4 - right handed, column major)
All raylib-cpp classes and functions appear in the raylib namespace.