Esempio n. 1
0
 private void api_GetStreamKeyHandler(API sender, StreamKey key, object state)
 {
 }
Esempio n. 2
0
		private void ParseMesh(Scene scene, XElement mesh, MeshSkinAndMaterials skinAndMaterials, SeparateStreamsMesh dstMesh)
		{
			Dictionary<string, StreamKey> knownStreams = new Dictionary<string, StreamKey>();
			Dictionary<StreamKey, string> knownSemantics = new Dictionary<StreamKey, string>();
			foreach (var element in mesh.Elements())
			{
				foreach (var subElement in element.Elements().Where(x=>x.Name == this.schema.inputName))
				{
					var semanticAttribute = subElement.Attribute(schema.semanticName);
					var semantic = (semanticAttribute == null)?null:semanticAttribute.Value;
					var setAttribute = subElement.Attribute(schema.setName);
					var set = (setAttribute==null)?0:int.Parse(setAttribute.Value, CultureInfo.InvariantCulture);
					var sourceAttribute = subElement.Attribute(schema.sourceAttributeName);
					var source = (sourceAttribute == null)?null:sourceAttribute.Value;
					var key = new StreamKey(semantic, set);
					StreamKey knownStreamKey;
					if (!knownStreams.TryGetValue(source, out knownStreamKey))
					{
						knownStreams.Add(source,key);
					}
					else if (knownStreamKey != key)
					{
						throw new NotImplementedException();
					}

					string knownSemanticsKey;
					if (!knownSemantics.TryGetValue(key, out knownSemanticsKey))
					{
						knownSemantics.Add(key, source);
					}
					else if (knownSemanticsKey != source)
					{
						throw new NotImplementedException();
					}
				}
			}
			foreach (var streamName in knownStreams)
			{
				var s = mesh.ElementByUrl(streamName.Key);
				if (s != null)
				{
					if (s.Name == schema.verticesName)
					{
						
					}
					else
					{
						var source = ParseSource(s, schema);
						dstMesh.SetStream(streamName.Value.Key, streamName.Value.Channel, CreateMeshStream(source, streamName.Value.Key));
					}
				}
			}
			foreach (var element in mesh.Elements())
			{
				if (element.Name == this.schema.polygonsName)
				{
					this.ParsePolygons(skinAndMaterials, dstMesh, element);
				}
				else if (element.Name == this.schema.polylistName)
				{
					this.ParsePolylist(mesh, skinAndMaterials, dstMesh, element);
				}
				else if (element.Name == this.schema.trianglesName)
				{
					this.ParseTriangles(mesh, skinAndMaterials, dstMesh, element);
				}
				else if (element.Name == this.schema.verticesName || element.Name == this.schema.sourceName)
				{
				}
				else
				{
					throw new DaeException(message: "Unknown mesh element " + element.Name.LocalName);
				}
			}
		}
 public AssetEntry(StreamKey key, T asset)
 {
     this.key   = key;
     this.asset = asset;
 }