mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
21 lines
511 B
C++
21 lines
511 B
C++
// Copyright 2024 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "Common/JsonUtil.h"
|
|
|
|
picojson::object ToJsonObject(const Common::Vec3& vec)
|
|
{
|
|
picojson::object obj;
|
|
obj.emplace("x", vec.x);
|
|
obj.emplace("y", vec.y);
|
|
obj.emplace("z", vec.z);
|
|
return obj;
|
|
}
|
|
|
|
void FromJson(const picojson::object& obj, Common::Vec3& vec)
|
|
{
|
|
vec.x = ReadNumericOrDefault<float>(obj, "x");
|
|
vec.y = ReadNumericOrDefault<float>(obj, "y");
|
|
vec.z = ReadNumericOrDefault<float>(obj, "z");
|
|
}
|