SpiecsEngine
 
Loading...
Searching...
No Matches

◆ encode()

static Node YAML::convert< Spices::ConstantParam >::encode ( const Spices::ConstantParam & param)
inlinestatic

Definition at line 125 of file YamlUtils.h.

126 {
127 Node node;
128 node.push_back(param.paramType);
129
130 if (param.paramType == "float4") node.push_back(std::any_cast<glm::vec4>(param.paramValue));
131 else if(param.paramType == "float3") node.push_back(std::any_cast<glm::vec3>(param.paramValue));
132 else if(param.paramType == "float2") node.push_back(std::any_cast<glm::vec2>(param.paramValue));
133 else if(param.paramType == "float") node.push_back(std::any_cast<float>(param.paramValue));
134 else if(param.paramType == "int") node.push_back(std::any_cast<int>(param.paramValue));
135 else if(param.paramType == "bool") node.push_back(std::any_cast<bool>(param.paramValue));
136 else
137 {
138 std::stringstream ss;
139 ss << "YAML::convert<Spices::Material::ConstantParam>: not supported paramType: " << param.paramType;
140
141 SPICES_CORE_WARN(ss.str())
142 }
143
144 return node;
145 }
std::string paramType
Definition Material.h:38