Exemplo n.º 1
0
            public ColladaMesh(ColladaRoot collada, XElement node)
            {
                foreach (XElement current in node.Elements(ColladaRoot.Namespace + "source"))
                {
                    Sources.Add(new ColladaSource(collada, current));
                }
                XElement node2 = node.Element(ColladaRoot.Namespace + "vertices");

                Vertices = new ColladaVertices(collada, node2);
                foreach (XElement current2 in node.Elements(ColladaRoot.Namespace + "polygons").Concat(node.Elements(ColladaRoot.Namespace + "polylist")).Concat(node.Elements(ColladaRoot.Namespace + "triangles")))
                {
                    Polygons.Add(new ColladaPolygons(collada, current2));
                }
            }
Exemplo n.º 2
0
            public ColladaInput(ColladaRoot collada, XElement node)
            {
                Offset   = int.Parse(node.Attribute("offset").Value, CultureInfo.InvariantCulture);
                Semantic = node.Attribute("semantic").Value;
                XAttribute xAttribute = node.Attribute("set");

                if (xAttribute != null)
                {
                    Set = int.Parse(xAttribute.Value, CultureInfo.InvariantCulture);
                }
                ColladaNameId colladaNameId = collada.ObjectsById[node.Attribute("source").Value.Substring(1)];

                if (colladaNameId is ColladaVertices)
                {
                    ColladaVertices colladaVertices = (ColladaVertices)colladaNameId;
                    Source   = colladaVertices.Source;
                    Semantic = colladaVertices.Semantic;
                    return;
                }
                Source = (ColladaSource)colladaNameId;
            }