From cf913574bcad025cd2b83243d541af36b81605d3 Mon Sep 17 00:00:00 2001 From: Summer G Stapleton Date: Thu, 29 Nov 2018 16:40:33 -0700 Subject: [PATCH] Very simple implementation (with example code) of a state-from-isd method. --- src/eal.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/eal.cpp diff --git a/src/eal.cpp b/src/eal.cpp new file mode 100644 index 0000000..a8b101a --- /dev/null +++ b/src/eal.cpp @@ -0,0 +1,19 @@ + +#include + +using json = nlohmann::json; + + +std::string eal::constructStateFromIsd(const std::string positionRotationData) const +{ + // Parse the position and rotation data from isd + json isd = json::parse(positionRotationData); + json state; + + state["m_w"] = isd.at("w"); + state["m_x"] = isd.at("x"); + state["m_y"] = isd.at("y"); + state["m_z"] = isd.at("z"); + + return state.dump(); +} -- GitLab