public GraphicsStreaming(BackendRouter backend, ExportMeshRequestManager meshRequestManager,
                                 CoordinateUtility coordinateUtility)
        {
            _backend            = backend;
            _meshRequestManager = meshRequestManager;
            _coordinateUtility  = coordinateUtility;

            _camera          = Camera.main;
            _cameraTransform = _camera.transform;

            _forceRequest = true; // force initial request
        }
Example #2
0
        private void Start()
        {
            Physics.queriesHitBackfaces = true;

            // Address must match ProtobufRpcServer.ts
            _backend = new BackendRouter("ws://localhost:3005", () =>
            {
                _isBackendSetup = true;
                _coordinateUtility.CalculateOffsetFromProjectExtents();
                _savedViews.RequestViewsFromBackend();
            });
            _coordinateUtility = new CoordinateUtility(_backend);
            _savedViews        = new SavedViews(Camera.main, _coordinateUtility, _backend);
            _userInput         = new DesktopUserInput(OpaqueMaterial, _backend, _savedViews);

            _meshReader         = new ElementMeshReader(_coordinateUtility);
            _meshRequestManager = new ExportMeshRequestManager(_backend, _meshReader);
            _graphicsStreaming  = new GraphicsStreaming(_backend, _meshRequestManager, _coordinateUtility);

            _textureCache = new TextureCache(_backend);
            _meshHandler  = new ElementGameObjectCreator(OpaqueMaterial, TransparentMaterial, _textureCache);
        }