将glm :: Mat4转换为字符串

时间:2019-04-24 21:57:30

标签: string glm

有什么方法可以简单地将glm :: mat4转换为字符串,然后再将其转换回初始的glm :: mat4?

还是我需要创建自己的转换器?

1 个答案:

答案 0 :(得分:0)

尝试使用 donaldmunro 提供的这个:

#include <glm/gtx/string_cast.hpp>
..
..
glm::mat4 mat;
..
..
std::cout << glm::to_string(mat) << std::endl;

this gist

对我来说效果很好!