From 8ab4780f134c33a9e11ac0fe0bd866e17d3ee650 Mon Sep 17 00:00:00 2001 From: vimene Date: Mon, 29 Dec 2025 21:21:09 +0100 Subject: starting to merge vulkan with the engine - refactored scene_main to be able to share code between software and hardware renderers, while still sharing code between terminal software renderer and graphical software renderer - made the hardware renderer use scene objects vertices and transforms, instead of hardcoded ones - made the hardware renderer use the scene's camera - made .obj parser create Vector3 instead of Vector4, which didn't made sense - removed unnecessary std:: - lots of small changes --- src/obj_parser.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/obj_parser.cpp') diff --git a/src/obj_parser.cpp b/src/obj_parser.cpp index b30eff1..d83d75f 100644 --- a/src/obj_parser.cpp +++ b/src/obj_parser.cpp @@ -104,14 +104,10 @@ o3d::Mesh parse_object(const std::string& obj_path) { // std::cout << "Object: " << line.substr(2) << std::endl; } else if (line.rfind("v ", 0) == 0) { auto s_coords = split(line.substr(2), ' '); - math::Vector4 v{parse_float(s_coords[0]), parse_float(s_coords[1]), parse_float(s_coords[2]), 1.f}; - // std::cout << "Vertex x: " << v.x << " y: " << v.y << " z: " << v.z << std::endl; - mesh.vertices.push_back(v); + mesh.vertices.emplace_back(parse_float(s_coords[0]), parse_float(s_coords[1]), parse_float(s_coords[2])); } else if (line.rfind("vn ", 0) == 0) { auto s_coords = split(line.substr(3), ' '); - math::Vector3 vn{parse_float(s_coords[0]), parse_float(s_coords[1]), parse_float(s_coords[2])}; - // std::cout << "Vertex normal x: " << vn.x << " y: " << vn.y << " z: " << vn.z << std::endl; - mesh.normals.push_back(vn); + mesh.normals.emplace_back(parse_float(s_coords[0]), parse_float(s_coords[1]), parse_float(s_coords[2])); } else if (line.rfind("s ", 0) == 0) { // auto smooth = false; // auto s_smooth = line.substr(2); -- cgit v1.2.3