mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-12 03:39:03 +08:00
Merge pull request #144 from SaschaWillems/master
Add direct access to texture coordinate set on texture parameter
This commit is contained in:
commit
326d7ea310
11
tiny_gltf.h
11
tiny_gltf.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user