using System;
using OpenTK;

namespace SharpQuake
{
	internal class model_t
	{
		public model_t()
		{
			this.hulls = new hull_t[4];
			for (int i = 0; i < this.hulls.Length; i++)
			{
				this.hulls[i] = new hull_t();
			}
		}

		public void Clear()
		{
			this.name = null;
			this.needload = false;
			this.type = modtype_t.mod_brush;
			this.numframes = 0;
			this.synctype = synctype_t.ST_SYNC;
			this.flags = 0;
			this.mins = Vector3.Zero;
			this.maxs = Vector3.Zero;
			this.radius = 0f;
			this.clipbox = false;
			this.clipmins = Vector3.Zero;
			this.clipmaxs = Vector3.Zero;
			this.firstmodelsurface = 0;
			this.nummodelsurfaces = 0;
			this.numsubmodels = 0;
			this.submodels = null;
			this.numplanes = 0;
			this.planes = null;
			this.numleafs = 0;
			this.leafs = null;
			this.numvertexes = 0;
			this.vertexes = null;
			this.numedges = 0;
			this.edges = null;
			this.numnodes = 0;
			this.nodes = null;
			this.numtexinfo = 0;
			this.texinfo = null;
			this.numsurfaces = 0;
			this.surfaces = null;
			this.numsurfedges = 0;
			this.surfedges = null;
			this.numclipnodes = 0;
			this.clipnodes = null;
			this.nummarksurfaces = 0;
			this.marksurfaces = null;
			hull_t[] array = this.hulls;
			for (int i = 0; i < array.Length; i++)
			{
				array[i].Clear();
			}
			this.numtextures = 0;
			this.textures = null;
			this.visdata = null;
			this.lightdata = null;
			this.entities = null;
			this.cache = null;
		}

		public void CopyFrom(model_t src)
		{
			this.name = src.name;
			this.needload = src.needload;
			this.type = src.type;
			this.numframes = src.numframes;
			this.synctype = src.synctype;
			this.flags = src.flags;
			this.mins = src.mins;
			this.maxs = src.maxs;
			this.radius = src.radius;
			this.clipbox = src.clipbox;
			this.clipmins = src.clipmins;
			this.clipmaxs = src.clipmaxs;
			this.firstmodelsurface = src.firstmodelsurface;
			this.nummodelsurfaces = src.nummodelsurfaces;
			this.numsubmodels = src.numsubmodels;
			this.submodels = src.submodels;
			this.numplanes = src.numplanes;
			this.planes = src.planes;
			this.numleafs = src.numleafs;
			this.leafs = src.leafs;
			this.numvertexes = src.numvertexes;
			this.vertexes = src.vertexes;
			this.numedges = src.numedges;
			this.edges = src.edges;
			this.numnodes = src.numnodes;
			this.nodes = src.nodes;
			this.numtexinfo = src.numtexinfo;
			this.texinfo = src.texinfo;
			this.numsurfaces = src.numsurfaces;
			this.surfaces = src.surfaces;
			this.numsurfedges = src.numsurfedges;
			this.surfedges = src.surfedges;
			this.numclipnodes = src.numclipnodes;
			this.clipnodes = src.clipnodes;
			this.nummarksurfaces = src.nummarksurfaces;
			this.marksurfaces = src.marksurfaces;
			for (int i = 0; i < src.hulls.Length; i++)
			{
				this.hulls[i].CopyFrom(src.hulls[i]);
			}
			this.numtextures = src.numtextures;
			this.textures = src.textures;
			this.visdata = src.visdata;
			this.lightdata = src.lightdata;
			this.entities = src.entities;
			this.cache = src.cache;
		}

		public string name;

		public bool needload;

		public modtype_t type;

		public int numframes;

		public synctype_t synctype;

		public int flags;

		public Vector3 mins;

		public Vector3 maxs;

		public float radius;

		public bool clipbox;

		public Vector3 clipmins;

		public Vector3 clipmaxs;

		public int firstmodelsurface;

		public int nummodelsurfaces;

		public int numsubmodels;

		public dmodel_t[] submodels;

		public int numplanes;

		public mplane_t[] planes;

		public int numleafs;

		public mleaf_t[] leafs;

		public int numvertexes;

		public mvertex_t[] vertexes;

		public int numedges;

		public medge_t[] edges;

		public int numnodes;

		public mnode_t[] nodes;

		public int numtexinfo;

		public mtexinfo_t[] texinfo;

		public int numsurfaces;

		public msurface_t[] surfaces;

		public int numsurfedges;

		public int[] surfedges;

		public int numclipnodes;

		public dclipnode_t[] clipnodes;

		public int nummarksurfaces;

		public msurface_t[] marksurfaces;

		public hull_t[] hulls;

		public int numtextures;

		public texture_t[] textures;

		public byte[] visdata;

		public byte[] lightdata;

		public string entities;

		public cache_user_t cache;
	}
}
