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

Function parseVertexWithColor

engine/3rdparty/tinyobjloader/tiny_obj_loader.h:1049–1067  ·  view source on GitHub ↗

Extension: parse vertex with colors(6 items)

Source from the content-addressed store, hash-verified

1047
1048// Extension: parse vertex with colors(6 items)
1049static inline bool parseVertexWithColor(real_t *x, real_t *y, real_t *z,
1050 real_t *r, real_t *g, real_t *b,
1051 const char **token,
1052 const double default_x = 0.0,
1053 const double default_y = 0.0,
1054 const double default_z = 0.0) {
1055 (*x) = parseReal(token, default_x);
1056 (*y) = parseReal(token, default_y);
1057 (*z) = parseReal(token, default_z);
1058
1059 const bool found_color =
1060 parseReal(token, r) && parseReal(token, g) && parseReal(token, b);
1061
1062 if (!found_color) {
1063 (*r) = (*g) = (*b) = 1.0;
1064 }
1065
1066 return found_color;
1067}
1068
1069static inline bool parseOnOff(const char **token, bool default_value = true) {
1070 (*token) += strspn((*token), " \t");

Callers 1

LoadObjFunction · 0.85

Calls 1

parseRealFunction · 0.85

Tested by

no test coverage detected