SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GltfImages()

Spices::GltfImages::GltfImages ( const Json & data,
const std::filesystem::path & path )
inline

Constructor Function.

Parameters
[in]dataSpecific Json element.
[in]pathgltf file directory path.

Definition at line 39 of file GltfImages.h.

40 : GltfObject(data)
41 {
43
44 m_ImagesData.resize(data.size());
45
46 for (int i = 0; i < data.size(); i++)
47 {
48 Item& item = m_ImagesData[i];
49 const Json& json = data[i];
50
51 std::string folder = json["uri"];
52
53 std::stringstream file;
54 file << path.string() << "/" << folder;
55
56 item.uri = file.str();
57
58 if (!FileLibrary::FileLibrary_Exists(item.uri.c_str()))
59 {
60 std::stringstream ss;
61 ss << "Image Files: " << item.uri << " is not finded.";
62
63 SPICES_CORE_ERROR(ss.str())
64 continue;
65 }
66 }
67 }
#define SPICES_PROFILE_ZONE
static bool FileLibrary_Exists(const char *path)
Determine whether the given string is existing a file.
std::vector< Item > m_ImagesData
Data of Gltf Json Cameras.
Definition GltfImages.h:84
GltfObject(const Json &data)
Constructor Function.
Definition GltfObject.h:33
nlohmann::json Json
using Json insteadd of nlohmann::json
Definition GltfObject.h:25

References GltfImages().

Referenced by GltfImages().