MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/RTXGI-DDGI / ParseCamera

Function ParseCamera

samples/test-harness/src/Config.cpp:251–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251bool ParseCamera(std::string &configString, Camera &camera, InputInfo &input, std::ofstream &log)
252{
253 std::string line;
254 std::stringstream stream;
255
256 size_t index = configString.find("#[camera]");
257 if (index == std::string::npos) return true;
258
259 stream.str(configString.substr(index));
260
261 bool status = true;
262 while (!stream.eof())
263 {
264 getline(stream, line, '\n');
265 if (line.find_first_of("#") == 0) continue; // commented line, skip it
266
267 if (ParseIfExists("cameraPosition=", camera.position, line, status, log)) continue;
268 if (ParseIfExists("cameraYaw=", input.yaw, line, status, log))
269 {
270 input.initialized = true;
271 continue;
272 }
273 if (ParseIfExists("cameraPitch=", input.pitch, line, status, log))
274 {
275 input.initialized = true;
276 continue;
277 }
278 if (ParseIfExists("cameraFov=", camera.fov, line, status, log))
279 {
280 camera.tanHalfFovY = tanf(camera.fov * (XM_PI / 180.f) * 0.5f);
281 continue;
282 }
283
284 if (!status) return false;
285 }
286 return true;
287}
288
289bool ParseVolumes(std::string &configString, std::vector<DDGIVolumeDesc> &descs, std::ofstream &log)
290{

Callers 1

ParseConfigFunction · 0.85

Calls 1

ParseIfExistsFunction · 0.85

Tested by

no test coverage detected