SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GltfCameras()

Spices::GltfCameras::GltfCameras ( const Json & data)
inlineexplicit

Constructor Function.

Parameters
[in]dataSpecific Json element.

Definition at line 37 of file GltfCameras.h.

38 : GltfObject(data)
39 {
41
42 m_CamerasData.resize(data.size());
43
44 for (int i = 0; i < data.size(); i++)
45 {
46 Item& item = m_CamerasData[i];
47 const Json& json = data[i];
48
49 item.yfov = GltfHelper::GetElementFloat(json, "perspective/yfov", 0.1f);
50 item.znear = GltfHelper::GetElementFloat(json, "perspective/znear", 0.1f);
51 item.zfar = GltfHelper::GetElementFloat(json, "perspective/zfar", 100.0f);
52 item.nodeIndex = -1;
53 }
54 }
#define SPICES_PROFILE_ZONE
std::vector< Item > m_CamerasData
Data of Gltf Json Cameras.
Definition GltfCameras.h:66
static float GetElementFloat(const Json::object_t &root, const char *path, float pDefault)
Get float value in Json::object_t.
GltfObject(const Json &data)
Constructor Function.
Definition GltfObject.h:33
nlohmann::json Json
using Json insteadd of nlohmann::json
Definition GltfObject.h:25

References GltfCameras().

Referenced by GltfCameras().