コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void Visit(SpotLightElem el)
 {
     Node = factory.Create(el);
 }