From 1c84fc22a59a2762081c40a8581f2ef098c1257d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Thu, 25 Jul 2019 16:07:27 +0200 Subject: [PATCH] fix default value checks for serialization --- tiny_gltf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 5fdeaf5..54faf57 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -5336,7 +5336,7 @@ static void SerializeGltfNormalTextureInfo(NormalTextureInfo &texinfo, SerializeNumberProperty("texCoord", texinfo.texCoord, o); } - if (!TINYGLTF_DOUBLE_EQUAL(texinfo.scale, 0.0)) { + if (!TINYGLTF_DOUBLE_EQUAL(texinfo.scale, 1.0)) { SerializeNumberProperty("scale", texinfo.scale, o); } @@ -5355,7 +5355,7 @@ static void SerializeGltfOcclusionTextureInfo(OcclusionTextureInfo &texinfo, SerializeNumberProperty("texCoord", texinfo.texCoord, o); } - if (!TINYGLTF_DOUBLE_EQUAL(texinfo.strength, 0.0)) { + if (!TINYGLTF_DOUBLE_EQUAL(texinfo.strength, 1.0)) { SerializeNumberProperty("strength", texinfo.strength, o); } @@ -5374,11 +5374,11 @@ static void SerializeGltfPbrMetallicRoughness(PbrMetallicRoughness &pbr, o); } - if (!TINYGLTF_DOUBLE_EQUAL(pbr.metallicFactor, 0.0)) { + if (!TINYGLTF_DOUBLE_EQUAL(pbr.metallicFactor, 1.0)) { SerializeNumberProperty("metallicFactor", pbr.metallicFactor, o); } - if (!TINYGLTF_DOUBLE_EQUAL(pbr.roughnessFactor, 0.0)) { + if (!TINYGLTF_DOUBLE_EQUAL(pbr.roughnessFactor, 1.0)) { SerializeNumberProperty("roughnessFactor", pbr.roughnessFactor, o); }