MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / TestStreamLoadObj

Function TestStreamLoadObj

engine/3rdparty/tinyobjloader/loader_example.cc:315–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315static bool TestStreamLoadObj() {
316 std::cout << "Stream Loading " << std::endl;
317
318 std::stringstream objStream;
319 objStream << "mtllib cube.mtl\n"
320 "\n"
321 "v 0.000000 2.000000 2.000000\n"
322 "v 0.000000 0.000000 2.000000\n"
323 "v 2.000000 0.000000 2.000000\n"
324 "v 2.000000 2.000000 2.000000\n"
325 "v 0.000000 2.000000 0.000000\n"
326 "v 0.000000 0.000000 0.000000\n"
327 "v 2.000000 0.000000 0.000000\n"
328 "v 2.000000 2.000000 0.000000\n"
329 "# 8 vertices\n"
330 "\n"
331 "g front cube\n"
332 "usemtl white\n"
333 "f 1 2 3 4\n"
334 "g back cube\n"
335 "# expects white material\n"
336 "f 8 7 6 5\n"
337 "g right cube\n"
338 "usemtl red\n"
339 "f 4 3 7 8\n"
340 "g top cube\n"
341 "usemtl white\n"
342 "f 5 1 4 8\n"
343 "g left cube\n"
344 "usemtl green\n"
345 "f 5 6 2 1\n"
346 "g bottom cube\n"
347 "usemtl white\n"
348 "f 2 6 7 3\n"
349 "# 6 elements";
350
351 std::string matStream(
352 "newmtl white\n"
353 "Ka 0 0 0\n"
354 "Kd 1 1 1\n"
355 "Ks 0 0 0\n"
356 "\n"
357 "newmtl red\n"
358 "Ka 0 0 0\n"
359 "Kd 1 0 0\n"
360 "Ks 0 0 0\n"
361 "\n"
362 "newmtl green\n"
363 "Ka 0 0 0\n"
364 "Kd 0 1 0\n"
365 "Ks 0 0 0\n"
366 "\n"
367 "newmtl blue\n"
368 "Ka 0 0 0\n"
369 "Kd 0 0 1\n"
370 "Ks 0 0 0\n"
371 "\n"
372 "newmtl light\n"

Callers 1

mainFunction · 0.70

Calls 3

LoadObjFunction · 0.85
PrintInfoFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected