+ | Offset bvh in the parsing

This commit is contained in:
TheRedShip
2025-01-20 16:27:02 +01:00
parent 73bb4462b5
commit 226573aaba
8 changed files with 30 additions and 15 deletions

View File

@ -95,6 +95,20 @@ void SceneParser::parseCamera(std::stringstream &line)
}
void SceneParser::parseObj(std::stringstream &line)
{
std::string name;
float x = 0.;
float y = 0.;
float z = 0.;
line >> name;
line >> x >> y >> z;
ObjParser obj(name);
obj.parse(*_scene, glm::vec3(x, y, z));
}
bool SceneParser::parseLine(const std::string &line)
{
if (line.empty() || line[0] == '#')
@ -128,11 +142,7 @@ bool SceneParser::parseLine(const std::string &line)
else if (identifier == "CAM")
this->parseCamera(ss);
else if (identifier == "OBJ")
{
ss >> identifier;
ObjParser obj(identifier);
obj.parse(*_scene);
}
this->parseObj(ss);
}
catch (const std::exception& e)
{