SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GetElementVector()

glm::vec4 Spices::GltfHelper::GetElementVector ( Json::object_t & root,
const char * path,
glm::vec4 pDefault )
static

Get vec4 value in Json::object_t.

Parameters
[in]rootjson object.
[in]pathtype name.
[in]pDefaultdefault return value. return Returns value if found or default if not.

Definition at line 234 of file GltfHelper.cpp.

235 {
237
238 if (root.find(path) != root.end() && !root[path].is_null())
239 {
240 return GetVector(root[path].get<Json::array_t>());
241 }
242 else
243 {
244 return pDefault;
245 }
246 }
#define SPICES_PROFILE_ZONE
static glm::vec4 GetVector(const Json::array_t &accessor)
Turn a Json::array_t to glm::vec4.