diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 17:50:17 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 17:50:17 +0100 |
commit | 9288e4964526f1ce6b7d0aca0f075a04f56ede32 (patch) | |
tree | 7277b99336d528b1ee7aebb278c84e0353ddcf01 /src/crepe/api/Camera.h | |
parent | 121b64b1cb6cfead5814070c8b0185d3d7308095 (diff) |
first version world postions with camera
Diffstat (limited to 'src/crepe/api/Camera.h')
-rw-r--r-- | src/crepe/api/Camera.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/crepe/api/Camera.h b/src/crepe/api/Camera.h index e0cda34..73d4ef4 100644 --- a/src/crepe/api/Camera.h +++ b/src/crepe/api/Camera.h @@ -2,6 +2,7 @@ #include "Color.h" #include "Component.h" +#include "api/Vector2.h" namespace crepe { @@ -27,20 +28,35 @@ public: //! Background color of the camera view. Color bg_color; - //! Aspect ratio height for the camera. - double aspect_height = 480; + Vector2 pos = {0,0}; - //! Aspect ratio width for the camera. - double aspect_width = 640; + Vector2 screen = {640,480}; - //! X-coordinate of the camera position. + Vector2 viewport = {500,500}; + + /* + //! screen width in pixel coordinates + double screen_w = 480; + + //! screen height in pixel coordinates + double screen_h = 640; + + //! screen widht in world units + double viewport_w = 500.0f; + + //! screen height in world units + double viewport_h = 500.0f; + + //! X-coordinate of the camera position. in world space double x = 0.0; - //! Y-coordinate of the camera position. + //! Y-coordinate of the camera position. in world space double y = 0.0; + */ + //! Zoom level of the camera view. - double zoom = 1.0; + double zoom = 1.0f; public: /** |