internal Sphere(XmlNode node) { if (node.ChildNodes.Count != 0 && node.ChildNodes[0].Name == "radius") { Radius = DoubleElement.ValueOf(node.ChildNodes[0]); } }
internal Visual(XmlNode node) { Name = node.Attributes?["name"]?.Value; Geometry?geometry = null; foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "cast_shadows": CastShadows = BoolElement.ValueOf(child); break; case "transparency": Transparency = DoubleElement.ValueOf(child); break; case "pose": Pose = new Pose(child); break; case "material": Material = new Material(child); break; case "geometry": geometry = new Geometry(child); break; } } Geometry = geometry ?? throw new MalformedSdfException(node, "Expected geometry!"); HasUri = Geometry.HasUri; }
internal Cylinder(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "radius": Radius = DoubleElement.ValueOf(child); break; case "length": Length = DoubleElement.ValueOf(child); break; } } }
internal Spot(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "inner_angle": InnerAngle = DoubleElement.ValueOf(child); break; case "outer_angle": OuterAngle = DoubleElement.ValueOf(child); break; case "falloff": Falloff = DoubleElement.ValueOf(child); break; } } }
internal Texture(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "size": Size = DoubleElement.ValueOf(child); break; case "diffuse": Diffuse = child.InnerText; break; case "normal": Normal = child.InnerText; break; } } }
internal Attenuation(XmlNode node) { foreach (XmlNode child in node.ChildNodes) { switch (child.Name) { case "range": Range = DoubleElement.ValueOf(child); break; case "linear": Linear = DoubleElement.ValueOf(child); break; case "constant": Constant = DoubleElement.ValueOf(child); break; case "quadratic": Quadratic = DoubleElement.ValueOf(child); break; } } }