Ejemplo n.º 1
0
        void RegisterMeshWithoutLightmap(MeshContainer n)
        {
            AbstractGeometryElem geo = null;

            if (n.Mesh.name == "Sphere")
            {
                geo = new SphereBufferGeometryElem(n);
            }
            else if (n.Mesh.name == "Cylinder")
            {
                geo = new CylinderBufferGeometryElem(n);
            }
            else if (n.Mesh.name == "Quad")
            {
                geo = new QuadBufferGeometry(n);
                //} else if(n.Mesh.name == "Cube") {
                //    geo = new BoxBufferGeometryElem(n);
            }
            else
            {
                geo = new BufferGeometryElem(n, false, Vector4.zero);
            }
            geo.Uuid = "geo-" + n.InstanceId;
            root.SharedNodeTable.Add(geo, n.InstanceId);
        }
        public AFrameNode Create(SphereBufferGeometryElem el)
        {
            var node = new AFrameNode("a-sphere");

            node.AddAttribute("radius", el.Radius);
            return(node);
        }
        public void Visit(SphereBufferGeometryElem el)
        {
            using (var scope = new JsonScopeObjectWriter(writer)) {
                scope.WriteKeyValue("uuid", el.Uuid);
                scope.WriteKeyValue("type", el.Type);

                scope.WriteKeyValue("radius", el.Radius.ToString());
                scope.WriteKeyValue("widthSegments", 16);
                scope.WriteKeyValue("heightSegments", 16);
            }
        }
Ejemplo n.º 4
0
 public void Visit(SphereBufferGeometryElem el)
 {
     Node = factory.Create(el);
 }