text: import { World, VRSPACEUI, WorldManager, WorldEditor } from './js/vrspace-min.js';
  
  export class WorldEditorExample extends World {
    async load() {
      // we're not loading any models
      // but we're displaying UI instead
      this.connect();
    }
    async createCamera() {
      this.camera = this.universalCamera(new BABYLON.Vector3(0, 2, -2));
      this.camera.ellipsoid = new BABYLON.Vector3(.1, .1, .1); // dolphins are not humans
      this.camera.setTarget(new BABYLON.Vector3(0,2,0));
      this.camera.speed = .2;
      this.camera.applyGravity = false;
      return this.camera;
    }
  
    async createGround() {
      this.ground = BABYLON.MeshBuilder.CreateDisc("ground", {radius:1000}, this.scene);
      this.ground.rotation = new BABYLON.Vector3( Math.PI/2, 0, 0 );
      this.ground.position = new BABYLON.Vector3( 0, -0.05, 0 );
      this.ground.parent = this.floorGroup;
      //this.ground.isVisible = false;
      this.ground.checkCollisions = false;
      
      // handy function for dynamic script loading
      await VRSPACEUI.loadScriptsToDocument([ 
        //"//www.vrspace.org/babylon/babylon.gridMaterial.min.js"
        "/babylon/js/lib/babylon.gridMaterial.min.js"
      ]);
      // handy material
      this.ground.material = new BABYLON.GridMaterial("groundMaterial", this.scene);
      this.ground.material.opacity = 0.999;
      this.ground.material.backFaceCulling = false;
      this.ground.material.alphaMode = BABYLON.Constants.ALPHA_PREMULTIPLIED;
      //this.ground.material.alphaMode = BABYLON.Constants.ALPHA_ONEONE; // also fine
      return this.ground;
    }
    
    async createLights() {
      var light = new BABYLON.DirectionalLight("light", new BABYLON.Vector3(-1, -1, 0), this.scene);
      light.intensity = 2;
      var light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), this.scene);
      return light1;
    }
    
    async createSkyBox() {
      var skybox = BABYLON.Mesh.CreateBox("skyBox", 10000, this.scene);
      var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", this.scene);
      skyboxMaterial.backFaceCulling = false;
      skyboxMaterial.disableLighting = true;
      skybox.material = skyboxMaterial;
      skybox.infiniteDistance = true;
      skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("/content/skybox/eso_milkyway/milkyway", this.scene);
      skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
      return skybox;
    }
    
    connect() {
      new WorldManager(this);
      //this.worldManager.debug = true; // multi-user debug info
      //this.worldManager.VRSPACE.debug = true; // network debug info
      this.worldManager.enter({mesh:'//www.vrspace.org/babylon/dolphin.glb'}).then(() => this.worldEditor = new WorldEditor(this, this.fileInputElement));
    }
    
    search( what, flags ) {
      this.worldEditor.search( what, flags );
    }
  }
  
  export const WORLD = new WorldEditorExample();