Added function to easily access texture coordinate set index on a texture parameter

This commit is contained in:
Sascha Willems 2019-02-23 21:15:45 +01:00
parent 87be0ce34b
commit eb011068c0

View File

@ -380,6 +380,17 @@ struct Parameter {
return -1;
}
/// Return the index of a texture coordinate set if this Parameter is a texture map.
/// Returned value is only valid if the parameter represent a texture from a
/// material
int TextureTexCoord() const {
const auto it = json_double_value.find("texCoord");
if (it != std::end(json_double_value)) {
return int(it->second);
}
return 0;
}
/// Material factor, like the roughness or metalness of a material
/// Returned value is only valid if the parameter represent a texture from a
/// material