test_class.file: cache/src/test/java/net/runelite/cache/models/ObjExporterTest.java
test_class.identifier: ObjExporterTest
test_case.body: @Test
  	@Ignore
  	public void testExport() throws Exception
  	{
  		try (Store store = new Store(StoreLocation.LOCATION))
  		{
  			store.load();
  
  			TextureManager tm = new TextureManager(store);
  			tm.load();
  
  			ModelLoader loader = new ModelLoader();
  			ModelDefinition model = loader.load(9638, Files.readAllBytes(new File("D:\\rs\\07\\cache\\models\\9638.model").toPath()));
  
  			ObjExporter exporter = new ObjExporter(tm, model);
  			try (PrintWriter objWriter = new PrintWriter(new FileWriter(new File("D:\\rs\\07\\temp\\9638.obj")));
  				PrintWriter mtlWriter = new PrintWriter(new FileWriter(new File("D:\\rs\\07\\temp\\9638.mtl"))))
  			{
  				exporter.export(objWriter, mtlWriter);
  			}
  		}
  	}
test_case.class_method_signature: ObjExporterTest.testExport()
test_case.full_signature: @Test @Ignore public void testExport()
test_case.identifier: testExport
test_case.invocations: load load load readAllBytes toPath export
test_case.modifiers: @Test @Ignore public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExport()
focal_class.declarator: textureManager
focal_class.modifier: private final
focal_class.original_string: private final TextureManager textureManager;
focal_class.type: TextureManager
focal_class.var_name: textureManager
focal_class.declarator: model
focal_class.modifier: private final
focal_class.original_string: private final ModelDefinition model;
focal_class.type: ModelDefinition
focal_class.var_name: model
focal_class.file: cache/src/main/java/net/runelite/cache/models/ObjExporter.java
focal_class.identifier: ObjExporter
focal_class.class_method_signature: ObjExporter.ObjExporter(TextureManager textureManager, ModelDefinition model)
focal_class.full_signature: public  ObjExporter(TextureManager textureManager, ModelDefinition model)
focal_class.identifier: ObjExporter
focal_class.modifiers: public
focal_class.parameters: (TextureManager textureManager, ModelDefinition model)
focal_class.signature:  ObjExporter(TextureManager textureManager, ModelDefinition model)
focal_class.class_method_signature: ObjExporter.export(PrintWriter objWriter, PrintWriter mtlWriter)
focal_class.full_signature: public void export(PrintWriter objWriter, PrintWriter mtlWriter)
focal_class.identifier: export
focal_class.modifiers: public
focal_class.parameters: (PrintWriter objWriter, PrintWriter mtlWriter)
focal_class.return: void
focal_class.signature: void export(PrintWriter objWriter, PrintWriter mtlWriter)
focal_class.class_method_signature: ObjExporter.rs2hsbToColor(int hsb)
focal_class.full_signature: private static Color rs2hsbToColor(int hsb)
focal_class.identifier: rs2hsbToColor
focal_class.modifiers: private static
focal_class.parameters: (int hsb)
focal_class.return: Color
focal_class.signature: Color rs2hsbToColor(int hsb)
focal_method.body: public void export(PrintWriter objWriter, PrintWriter mtlWriter)
  	{
  		model.computeNormals();
  		model.computeTextureUVCoordinates();
  
  		objWriter.println("mtllib " + model.id + ".mtl");
  
  		objWriter.println("o runescapemodel");
  
  		for (int i = 0; i < model.vertexCount; ++i)
  		{
  			objWriter.println("v " + model.vertexPositionsX[i] + " "
  				+ model.vertexPositionsY[i] * -1 + " "
  				+ model.vertexPositionsZ[i] * -1);
  		}
  
  		if (model.faceTextures != null)
  		{
  			float[][] u = model.faceTextureUCoordinates;
  			float[][] v = model.faceTextureVCoordinates;
  
  			for (int i = 0; i < model.faceCount; ++i)
  			{
  				objWriter.println("vt " + u[i][0] + " " + v[i][0]);
  				objWriter.println("vt " + u[i][1] + " " + v[i][1]);
  				objWriter.println("vt " + u[i][2] + " " + v[i][2]);
  			}
  		}
  
  		for (VertexNormal normal : model.vertexNormals)
  		{
  			objWriter.println("vn " + normal.x + " " + normal.y + " " + normal.z);
  		}
  
  		for (int i = 0; i < model.faceCount; ++i)
  		{
  			int x = model.faceVertexIndices1[i] + 1;
  			int y = model.faceVertexIndices2[i] + 1;
  			int z = model.faceVertexIndices3[i] + 1;
  
  			objWriter.println("usemtl m" + i);
  			if (model.faceTextures != null)
  			{
  				objWriter.println("f "
  					+ x + "/" + (i * 3 + 1) + " "
  					+ y + "/" + (i * 3 + 2) + " "
  					+ z + "/" + (i * 3 + 3));
  
  			}
  			else
  			{
  				objWriter.println("f " + x + " " + y + " " + z);
  			}
  			objWriter.println("");
  		}
  
  		// Write material
  		for (int i = 0; i < model.faceCount; ++i)
  		{
  			short textureId = -1;
  
  			if (model.faceTextures != null)
  			{
  				textureId = model.faceTextures[i];
  			}
  
  			mtlWriter.println("newmtl m" + i);
  
  			if (textureId == -1)
  			{
  				Color color = rs2hsbToColor(model.faceColors[i]);
  
  				double r = color.getRed() / 255.0;
  				double g = color.getGreen() / 255.0;
  				double b = color.getBlue() / 255.0;
  
  				mtlWriter.println("Kd " + r + " " + g + " " + b);
  			}
  			else
  			{
  				TextureDefinition texture = textureManager.findTexture(textureId);
  				assert texture != null;
  
  				mtlWriter.println("map_Kd sprite/" + texture.getFileIds()[0] + "-0.png");
  			}
  
  			int alpha = 0;
  
  			if (model.faceAlphas != null)
  			{
  				alpha = model.faceAlphas[i] & 0xFF;
  			}
  
  			if (alpha != 0)
  			{
  				mtlWriter.println("d " + (alpha / 255.0));
  			}
  		}
  	}
focal_method.class_method_signature: ObjExporter.export(PrintWriter objWriter, PrintWriter mtlWriter)
focal_method.full_signature: public void export(PrintWriter objWriter, PrintWriter mtlWriter)
focal_method.identifier: export
focal_method.invocations: computeNormals computeTextureUVCoordinates println println println println println println println println println println println println rs2hsbToColor getRed getGreen getBlue println findTexture println getFileIds println
focal_method.modifiers: public
focal_method.parameters: (PrintWriter objWriter, PrintWriter mtlWriter)
focal_method.return: void
focal_method.signature: void export(PrintWriter objWriter, PrintWriter mtlWriter)