From 41fe77205884009f63c5a38f924ad3a401936b47 Mon Sep 17 00:00:00 2001 From: Arthur Brainville Date: Mon, 8 Jan 2018 18:32:48 +0100 Subject: [PATCH] Const qualify const methods Signed-off-by: Arthur Brainville (Ybalrid) --- tiny_gltf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 9a4d721..2accbd0 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -340,7 +340,7 @@ using ColorValue = std::array; ///Return the index of a texture if this Parameter is a texture map. ///Returned value is only valid if the parameter represent a texture from a material - int TextureIndex() { + int TextureIndex() const { const auto it = json_double_value.find("index"); if (it != std::end(json_double_value)) { @@ -351,13 +351,13 @@ using ColorValue = std::array; ///Material factor, like the roughness or metalness of a material ///Returned value is only valid if the parameter represent a texture from a material - double Factor() { + double Factor() const { return number_array[0]; } ///Return the color of a material ///Returned value is only valid if the parameter represent a texture from a material - ColorValue Color() { + ColorValue Color() const { return { { // this agregate intialize the std::array object, and uses C++11 RVO. number_array[0],