LightElem RegisterToThreeScene(LightNode n) { LightElem node = null; if (n.Type == LightType.Point) { node = new PointLightElem(n); } else if (n.Type == LightType.Directional) { node = new DirectionalLightElem(n); } else if (n.Type == LightType.Spot) { node = new SpotLightElem(n); } if (node != null) { node.Uuid = n.Guid; var parent = objNodeTable[n.CurrentObject.GetInstanceID().ToString()]; parent.AddChild(node); return(node); } else { throw new NotImplementedException(); } }
public void Visit(SpotLightElem el) { using (var scope = new JsonScopeObjectWriter(writer)) { WriteCommonObjectNode(scope, el); var helper = new LightHelper(scope, el); helper.WriteColor(); helper.WriteIntensity(); helper.WriteDistance(); helper.WriteDecay(); } }
public AFrameNode Create(SpotLightElem el) { var node = new AFrameNode("a-light"); WriteCommonAFrameNode(el, node); node.AddAttribute("type", "spot"); var helper = new LightHelper(node, el); helper.WriteColor(); helper.WriteIntensity(); helper.WriteDecay(); return(node); }
public void Visit(SpotLightElem el) { Node = factory.Create(el); }