mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Cube intersection but problem with quads
This commit is contained in:
@ -99,6 +99,13 @@ void Scene::updateGPUData()
|
||||
gpu_obj.vertex2 = triangle->getVertex3();
|
||||
gpu_obj.normal = triangle->getNormal();
|
||||
}
|
||||
else if (obj->getType() == Object::Type::CUBE)
|
||||
{
|
||||
auto cube = static_cast<const Cube *>(obj);
|
||||
gpu_obj.position = cube->getPosition();
|
||||
gpu_obj.vertex1 = cube->getSize();
|
||||
gpu_obj.type = static_cast<int>(cube->getType());
|
||||
}
|
||||
|
||||
_gpu_objects.push_back(gpu_obj);
|
||||
}
|
||||
|
@ -37,6 +37,12 @@ SceneParser::SceneParser(Scene *scene) : _scene(scene)
|
||||
try { return (new Triangle(ss)); }
|
||||
catch (const std::exception &e) { throw; }
|
||||
};
|
||||
|
||||
object_parsers["cu"] = [](std::stringstream &ss) -> Object *
|
||||
{
|
||||
try { return (new Cube(ss)); }
|
||||
catch (const std::exception &e) { throw; }
|
||||
};
|
||||
}
|
||||
|
||||
void SceneParser::parseMaterial(std::stringstream &line)
|
||||
|
Reference in New Issue
Block a user