aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/camera.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/o3d/camera.h')
-rw-r--r--src/o3d/camera.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/o3d/camera.h b/src/o3d/camera.h
index 27c31eb..832f473 100644
--- a/src/o3d/camera.h
+++ b/src/o3d/camera.h
@@ -1,12 +1,22 @@
#ifndef O3D_CAMERA_H
#define O3D_CAMERA_H
+#include "math/mat4.h"
#include "math/tform.h"
+using
+ engine::math::Matrix4,
+ engine::math::Transform;
+
namespace engine::o3d {
struct Camera {
- engine::math::Transform transform;
+ float fov;
+ Transform transform;
+
+ constexpr Matrix4 to_mat4(float aspect_ratio, float min_z, float max_z) const & {
+ return Matrix4::projection(fov, aspect_ratio, min_z, max_z) * transform.to_inverse_mat4();
+ }
};
}