aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/camera.hpp
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2025-12-24 01:38:45 +0100
committervimene <vincent.menegaux@gmail.com>2025-12-24 01:38:45 +0100
commit00370c21f107ff2a320fbdef170e24a8b5cda92a (patch)
tree04ff3e32e88e0acdfe0783947a0f2510d0520a1f /src/o3d/camera.hpp
parent236b6a3160cd3d8c217a966aaa2795c779c13a91 (diff)
downloadengine-00370c21f107ff2a320fbdef170e24a8b5cda92a.tar.gz
added uniform buffers, small tweaks
- fixed aspect ratio being the inverse of what it's supposed to be - use std::chrono::high_resolution_clock instead of system_clock - convert ellapsed time to float representing seconds - renamed engine::math::Matrix4::projection to perspective - use [0,1] instead of [-1,1] for the range of z values, to be aligned with vulkan - added engine::math::Matrix4::{look_at,transpose}
Diffstat (limited to 'src/o3d/camera.hpp')
-rw-r--r--src/o3d/camera.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/o3d/camera.hpp b/src/o3d/camera.hpp
index 485c825..b3588fb 100644
--- a/src/o3d/camera.hpp
+++ b/src/o3d/camera.hpp
@@ -15,7 +15,7 @@ struct Camera {
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();
+ return Matrix4::perspective(fov, aspect_ratio, min_z, max_z) * transform.to_inverse_mat4();
}
};