From 156cb38056ee6dc8e8b0537e7e7816db9d7e14b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 15 Jan 2016 16:25:50 -0500 Subject: [PATCH] lib/gamnit: add support for map_Ka in the .mtl parser MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/model_parsers/mtl.nit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/gamnit/model_parsers/mtl.nit b/lib/gamnit/model_parsers/mtl.nit index b962fe1..fc34e47 100644 --- a/lib/gamnit/model_parsers/mtl.nit +++ b/lib/gamnit/model_parsers/mtl.nit @@ -64,6 +64,8 @@ class MtlFileParser material.dissolved = 1.0 - read_number else if token == "illum" then material.illumination_model = read_number.to_i + else if token == "map_Ka" then + material.map_ambient = read_until_eol_or_comment else if token == "map_Kd" then material.map_diffuse = read_until_eol_or_comment else if token == "map_Bump" then @@ -111,6 +113,9 @@ class MtlDef # Illumination model var illumination_model = 0 + # Ambient map + var map_ambient: nullable String = null + # Diffuse map var map_diffuse: nullable String = null @@ -126,6 +131,6 @@ class MtlDef # Collect non-null maps from `map_diffuse, map_bump, map_specular, map_exponent` fun maps: Array[String] do - return [for m in [map_diffuse, map_bump, map_specular, map_exponent] do if m != null then m] + return [for m in [map_ambient, map_diffuse, map_bump, map_specular, map_exponent] do if m != null then m] end end -- 1.7.9.5