From f4fbb8db59de0c5d333710a8d72ee9ee00dc7448 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 20 Dec 2023 14:42:45 +0100 Subject: [PATCH] Implemented frustum camera. --- sfw/application/camera_3d.cpp | 9 +++++++++ sfw/application/camera_3d.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sfw/application/camera_3d.cpp b/sfw/application/camera_3d.cpp index 4ef7a50..2be6131 100644 --- a/sfw/application/camera_3d.cpp +++ b/sfw/application/camera_3d.cpp @@ -67,6 +67,15 @@ void FrustumCamera::bind() { FrustumCamera::FrustumCamera() : Camera3D() { + offset = 0; + + projection_matrix.set_frustum( + size, + screen_aspect_ratio, + offset, + znear, + zfar, + vaspect); } FrustumCamera::~FrustumCamera() { diff --git a/sfw/application/camera_3d.h b/sfw/application/camera_3d.h index 1a7f51e..b9564e2 100644 --- a/sfw/application/camera_3d.h +++ b/sfw/application/camera_3d.h @@ -49,7 +49,8 @@ public: class FrustumCamera : public Camera3D { public: - //todo + float offset; + void bind(); FrustumCamera();