Merge pull request #144 from SaschaWillems/master

Add direct access to texture coordinate set on texture parameter
This commit is contained in:
Syoyo Fujita 2019-02-24 14:42:51 +09:00 committed by GitHub
commit 326d7ea310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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