MCPcopy Create free account
hub / github.com/admtrv/objcurses / parse_diffuse_color

Method parse_diffuse_color

entities/geometry/object.cpp:203–216  ·  view source on GitHub ↗

parse kd

Source from the content-addressed store, hash-verified

201
202// parse kd
203bool Object::parse_diffuse_color(const std::string &line, Vec3 &current_diffuse)
204{
205 std::stringstream ss(line);
206
207 float r, g, b;
208 if (!(ss >> r >> g >> b))
209 {
210 std::cerr << "error: can't parse diffuse colors" << std::endl;
211 return false;
212 }
213
214 current_diffuse = Vec3(r, g, b);
215 return true;
216}
217
218// methods
219bool Object::load(const std::string &obj_filename, bool color_support)

Callers

nothing calls this directly

Calls 1

Vec3Class · 0.85

Tested by

no test coverage detected