Const qualify const methods

Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
This commit is contained in:
Arthur Brainville 2018-01-08 18:32:48 +01:00
parent 5845319b1a
commit 41fe772058
No known key found for this signature in database
GPG Key ID: BC05C4812A06BCF3

View File

@ -340,7 +340,7 @@ using ColorValue = std::array<double, 4>;
///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<double, 4>;
///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],