1
0

add more handshake output

This commit is contained in:
2026-01-10 20:02:50 +08:00
parent a8e109b603
commit 2379a23477
8 changed files with 62 additions and 20 deletions

View File

@@ -3,6 +3,8 @@
#include <tiny_obj_loader.h>
#include <vector>
#include <string>
#include <filesystem>
#include <fstream>
namespace object_loader = ::basalt::shared::object_loader;
using object_loader::IObjectLoader;
@@ -30,9 +32,15 @@ public:
std::string err;
// Load the OBJ file
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, this->config.filename.c_str())) {
std::ifstream fs;
fs.open(std::filesystem::path(this->config.filename));
if (!fs.is_open()) {
throw std::runtime_error("fail to open obj file");
}
if (!tinyobj::LoadObj(&attrib, &shapes, &materials, &err, &fs)) {
throw std::runtime_error("fail to load obj file");
}
fs.close();
// Create one object from all shapes in the OBJ file
std::vector<Vector3> vertices;