mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-07-06 07:25:11 +08:00
Added function to easily access texture coordinate set index on a texture parameter
This commit is contained in:
parent
87be0ce34b
commit
eb011068c0
11
tiny_gltf.h
11
tiny_gltf.h
@ -380,6 +380,17 @@ struct Parameter {
|
|||||||
return -1;
|
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
|
/// Material factor, like the roughness or metalness of a material
|
||||||
/// Returned value is only valid if the parameter represent a texture from a
|
/// Returned value is only valid if the parameter represent a texture from a
|
||||||
/// material
|
/// material
|
||||||
|
Loading…
x
Reference in New Issue
Block a user