A WIP 3D game engine in C++ using OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
538 B

#include "jsonloader.h"
std::optional<glm::vec3> vec3_fromjson(json j) noexcept {
try {
glm::vec3 c {j[0], j[1], j[2]};
return c;
} catch (std::exception &e) {
fmt::print("{} {}:{}:: {}", __FUNCTION__, __FILE__, __LINE__, e.what());
return {};
}
}
std::optional<glm::vec2> vec2_fromjson(json j) noexcept {
try {
glm::vec2 c {j[0], j[1]};
return c;
} catch (std::exception &e) {
fmt::print("{} {}:{}:: {}", __FUNCTION__, __FILE__, __LINE__, e.what());
return {};
}
}