25 for(
const MeshVertex& vertex : mesh.vertices()) {
28 ss_ <<
"v " << vertex.position[0] <<
" " << vertex.position[1] <<
" " << vertex.position[2] <<
"\n";
30 ss_ <<
"vn " << vertex.normal[0] <<
" " << vertex.normal[1] <<
" " << vertex.normal[2] <<
"\n";
32 ss_ <<
"vt " << vertex.texCoord[0] <<
" " << vertex.texCoord[1] <<
"\n";
37 ss_ <<
"f " <<
t[0] <<
"/" <<
t[0] <<
"/" <<
t[0] <<
" " <<
t[1] <<
"/" <<
t[1] <<
"/" <<
t[1] <<
" " <<
t[2] <<
"/" <<
t[2] <<
"/" <<
t[2]
44 std::string
str() {
return ss_.str(); }
49 std::stringstream
ss_;
Definition MeshVertex.hpp:14
A class for generating obj files for preview and debug purposes.
Definition ObjWriter.hpp:18
std::stringstream ss_
Definition ObjWriter.hpp:49
int mBase
Definition ObjWriter.hpp:47
void writeMesh(const Mesh &mesh)
Definition ObjWriter.hpp:22
std::string str()
Definition ObjWriter.hpp:44
Definition Triangle.hpp:14
A base class for all mesh implementations.
Definition Mesh.hpp:112
Definition AnyGenerator.hpp:12
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25