<commit_before>﻿using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;

namespace Mugo
{
    class PizzaModel : ObjLoaderObject3D, ITunnelSegementElementModel
    {
        private const String objFilePath = "data/objects/Pizza.model";
        private const String texturePath = "data/textures/Pizza.png";
        private static readonly SimpleTextureMaterial material = new SimpleTextureMaterial();

        public PizzaModel() : base(objFilePath)
        {
            TextureId = TextureManager.LoadTexture(texturePath);
            Transformation *= Matrix4.CreateScale(0.2f);
            Transformation *= Matrix4.CreateRotationY(MathHelper.DegreesToRadians(90));
            Transformation *= Matrix4.CreateRotationX(MathHelper.DegreesToRadians(90));            
            Transformation *= Matrix4.CreateTranslation(0f, 1.5f, -TunnelSegment.Depth / 2f);

			DefaultTransformation = Transformation;
        }

        public int TextureId { get; private set; }

        public Matrix4 DefaultTransformation { get; }

		public void ResetTransformation()
		{
			Transformation = DefaultTransformation;
		}

        public new Matrix4 Transformation
        {
            get { return base.Transformation; }
            set { base.Transformation = value; }
        }

        public void Draw()
        {
            material.Draw(this, TextureId);
        }
    }
}<commit_msg>Cache pizza model's vao object.<commit_after>﻿using System;
using Engine.cgimin.material.simpletexture;
using Engine.cgimin.object3d;
using Engine.cgimin.texture;
using OpenTK;

namespace Mugo
{
	class PizzaModel : BaseObject3D, ITunnelSegementElementModel
	{
		private static readonly PizzaModelInternal internalModel = new PizzaModelInternal();
		private static readonly SimpleTextureMaterial material = new SimpleTextureMaterial();

		public Matrix4 DefaultTransformation { get; private set;}

		public new Matrix4 Transformation {
			get { return base.Transformation; }
			set { base.Transformation = value; }
		}

		public PizzaModel ()
		{
			DefaultTransformation = internalModel.DefaultTransformation;
			Transformation = internalModel.Transformation;
			Vao = internalModel.Vao;
			Indices = internalModel.Indices;
		}

		public void Draw ()
		{
			material.Draw(this, internalModel.TextureId);
		}

		private class PizzaModelInternal : ObjLoaderObject3D
		{
			private const String objFilePath = "data/objects/Pizza.model";
			private const String texturePath = "data/textures/Pizza.png";

			public PizzaModelInternal () : base (objFilePath)
			{
				TextureId = TextureManager.LoadTexture (texturePath);
				Transformation *= Matrix4.CreateScale (0.2f);
				Transformation *= Matrix4.CreateRotationY (MathHelper.DegreesToRadians (90));
				Transformation *= Matrix4.CreateRotationX (MathHelper.DegreesToRadians (90));
				Transformation *= Matrix4.CreateTranslation (0f, 1.5f, -TunnelSegment.Depth / 2f);

				DefaultTransformation = Transformation;
			}

			public int TextureId { get; private set; }

			public Matrix4 DefaultTransformation { get; }
		}
	}
}
{'fraction_non_alphanumeric': 0.0868732034493772, 'fraction_numerical': 0.012136697540721815, 'mean_word_length': 3.5064748201438847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5130112', 'n_tokens_mistral': 961, 'n_tokens_neox': 852, 'n_words': 196}