Esempio n. 1
0
		public Voxel(VoxelLoader loader, VxlReader vxl, HvaReader hva)
		{
			if (vxl.LimbCount != hva.LimbCount)
				throw new InvalidOperationException("Voxel and hva limb counts don't match");

			transforms = hva.Transforms;
			Frames = hva.FrameCount;
			Limbs = hva.LimbCount;

			limbData = new Limb[vxl.LimbCount];
			for (var i = 0; i < vxl.LimbCount; i++)
			{
				var vl = vxl.Limbs[i];
				var l = new Limb();
				l.Scale = vl.Scale;
				l.Bounds = (float[])vl.Bounds.Clone();
				l.Size = (byte[])vl.Size.Clone();
				l.RenderData = loader.GenerateRenderData(vxl.Limbs[i]);
				limbData[i] = l;
			}
		}
Esempio n. 2
0
 Voxel LoadFile(Pair<string,string> files)
 {
     VxlReader vxl;
     HvaReader hva;
     using (var s = GlobalFileSystem.OpenWithExts(files.First, ".vxl"))
         vxl = new VxlReader(s);
     using (var s = GlobalFileSystem.OpenWithExts(files.Second, ".hva"))
         hva = new HvaReader(s);
     return new Voxel(this, vxl, hva);
 }
Esempio n. 3
0
 Voxel LoadFile(Pair<string,string> files)
 {
     var vxl = new VxlReader(FileSystem.OpenWithExts(files.First, ".vxl"));
     var hva = new HvaReader(FileSystem.OpenWithExts(files.Second, ".hva"));
     return new Voxel(this, vxl, hva);
 }
Esempio n. 4
0
 Voxel LoadFile(Pair<string, string> files)
 {
     VxlReader vxl;
     HvaReader hva;
     using (var s = fileSystem.Open(files.First + ".vxl"))
         vxl = new VxlReader(s);
     using (var s = fileSystem.Open(files.Second + ".hva"))
         hva = new HvaReader(s, files.Second + ".hva");
     return new Voxel(this, vxl, hva);
 }