From db41d43345ea73cf7c1bbb29448e52ffb822e3e0 Mon Sep 17 00:00:00 2001 From: vimene Date: Tue, 13 Jan 2026 02:04:52 +0100 Subject: added textures for the hardware renderer - removed "using" directive in .hpp - reverse order of arguments for quaternion rotation, i.e. q.rot(v) instead of v.rot(q), where q is a quaterinon and v a vector - pass the inverse of the view matrix to render_and_present_frame, to allow light calculation in shaders (we used to just pass the matrix of the quaternion of the transformation, i.e. discard scaling and translations) - added another mesh and texture (viking_room) for testing purposes - added transparent background option - added Quaternion::look_towards(), which is the equivalent of Matrix4::look_at() but only for rotations - various improvement to .obj parsing - load texture coordinates from .obj file - merged duplicate vertices in Mesh::linearize_indices() --- src/o3d/camera.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/o3d/camera.hpp') diff --git a/src/o3d/camera.hpp b/src/o3d/camera.hpp index eb10450..ff99c08 100644 --- a/src/o3d/camera.hpp +++ b/src/o3d/camera.hpp @@ -4,18 +4,14 @@ #include "math/mat4.hpp" #include "math/tform.hpp" -using - engine::math::Matrix4, - engine::math::Transform; - namespace engine::o3d { struct Camera { float fov; - Transform transform; + engine::math::Transform transform; - constexpr Matrix4 to_mat4(float aspect_ratio, float min_z, float max_z) const & { - return Matrix4::perspective(fov, aspect_ratio, min_z, max_z) * transform.to_inverse_mat4(); + constexpr engine::math::Matrix4 to_mat4(float aspect_ratio, float min_z, float max_z) const & { + return engine::math::Matrix4::perspective(fov, aspect_ratio, min_z, max_z) * transform.to_inverse_mat4(); } }; -- cgit v1.2.3