From: Alexis Laferrière Date: Fri, 15 Jan 2016 21:25:50 +0000 (-0500) Subject: lib/gamnit: add support for map_Ka in the .mtl parser X-Git-Tag: v0.8~14^2~7 X-Git-Url: http://nitlanguage.org lib/gamnit: add support for map_Ka in the .mtl parser Signed-off-by: Alexis Laferrière --- 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