mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-28 02:58:35 +02:00
~ | removing useless trycatch
This commit is contained in:
@ -20,26 +20,23 @@ class Cube : public Object
|
||||
public:
|
||||
Cube(std::stringstream &line) : Object(glm::vec3(0.0f), -1)
|
||||
{
|
||||
try {
|
||||
float x, y, z;
|
||||
float width, height, depth;
|
||||
int mat_index;
|
||||
float x, y, z;
|
||||
float width, height, depth;
|
||||
int mat_index;
|
||||
|
||||
if (!(line >> x >> y >> z))
|
||||
throw std::runtime_error("Missing position values");
|
||||
if (!(line >> x >> y >> z))
|
||||
throw std::runtime_error("Missing position values");
|
||||
|
||||
if (!(line >> width >> height >> depth))
|
||||
throw std::runtime_error("Missing width, height or depth values");
|
||||
if (!(line >> width >> height >> depth))
|
||||
throw std::runtime_error("Missing width, height or depth values");
|
||||
|
||||
if (!(line >> mat_index))
|
||||
throw std::runtime_error("Missing material properties");
|
||||
if (!(line >> mat_index))
|
||||
throw std::runtime_error("Missing material properties");
|
||||
|
||||
_position = glm::vec3(x, y, z);
|
||||
_size = glm::vec3(width, height, depth);
|
||||
|
||||
_mat_index = mat_index;
|
||||
}
|
||||
catch (const std::exception& e) { throw; }
|
||||
_position = glm::vec3(x, y, z);
|
||||
_size = glm::vec3(width, height, depth);
|
||||
|
||||
_mat_index = mat_index;
|
||||
}
|
||||
Cube(const glm::vec3& position, const glm::vec3 &size, const int mat_index)
|
||||
: Object(position, mat_index), _size(size) {}
|
||||
|
Reference in New Issue
Block a user