How do I print vector values of type glm::vec3 that have been passed by reference?

前端 未结 5 1635
星月不相逢
星月不相逢 2020-12-25 10:12

I have a small obj loader and it takes two parameters and passes them back to the input variables.. however this is my first time doing this and i\'m not sure how to print s

5条回答
  •  余生分开走
    2020-12-25 10:25

    To get the overload resolution right, you can do something like:

    // Writes a generic GLM vector type to a stream.
    template 
    std::ostream &operator<<(std::ostream &os, glm::vec v) {
      return os << glm::to_string(v);
    }
    
    

提交回复
热议问题