SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GltfLights()

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

Constructor Function.

Parameters
[in]dataSpecific Json element.

Definition at line 42 of file GltfLights.h.

43 : GltfObject(data)
44 {
46
47 m_LightsData.resize(data.size());
48
49 for (int i = 0; i < data.size(); i++)
50 {
51 Item& item = m_LightsData[i];
52 Json::object_t json = data[i];
53
54 item.color = GltfHelper::GetElementVector(json, "color", glm::vec4(1, 1, 1, 0));
55 item.range = GltfHelper::GetElementFloat(json, "range", 105);
56 item.intensity = GltfHelper::GetElementFloat(json, "intensity", 1);
57 item.innerConeAngle = GltfHelper::GetElementFloat(json, "spot/innerConeAngle", 0);
58 item.outerConeAngle = GltfHelper::GetElementFloat(json, "spot/outerConeAngle", SpicesShader::PI);
59
60 item.name = GltfHelper::GetElementString(json, "name", "");
61 item.type = GltfHelper::GetElementString(json, "type", "");
62
63 // @todo: another data.
64 }
65 }
#define SPICES_PROFILE_ZONE
static glm::vec4 GetElementVector(Json::object_t &root, const char *path, glm::vec4 pDefault)
Get vec4 value in Json::object_t.
static std::string GetElementString(const Json::object_t &root, const char *path, const std::string &pDefault)
Get string value in Json::object_t.
static float GetElementFloat(const Json::object_t &root, const char *path, float pDefault)
Get float value in Json::object_t.
std::vector< Item > m_LightsData
Data of Gltf Json Lights.
Definition GltfLights.h:77
GltfObject(const Json &data)
Constructor Function.
Definition GltfObject.h:33

References GltfLights().

Referenced by GltfLights().