private LocalTerrainModel GetActiveTerrainModel()
        {
            TerrainModel terrainModel = TerrainModelManager.Instance.CurrentVisibleModel;

            if (terrainModel is LocalTerrainModel)
            {
                return((LocalTerrainModel)terrainModel);
            }
            return(null);
        }
 private void OnTerrainModelChange(TerrainModel terrainModel)
 {
     if (terrainModel is LocalTerrainModel)
     {
         _currentBoundingBox = ((LocalTerrainModel)terrainModel).SquareBoundingBox;
     }
     else
     {
         _currentBoundingBox = BoundingBox.Zero;
     }
 }
        public void GetCurrentViewSettings(string requestId)
        {
            // TODO Un-hardcode this data
            TerrainModelManager        terrainModelManager = TerrainModelManager.Instance;
            XRInteractableGlobeTerrain globe      = (XRInteractableGlobeTerrain)terrainModelManager.GlobeModel.InteractionController;
            TerrainModel currentTerrainModel      = terrainModelManager.CurrentVisibleModel;
            IDictionary <string, object> settings = new Dictionary <string, object>()
            {
                { "terrainType", currentTerrainModel is GlobeTerrainModel ? "globe" : "local" },
                { "heightExaggeration", terrainModelManager.HeightExagerration },
                { "textures", terrainModelManager.TerrainTexturesEnabled },
                { "coordinates", globe.EnableCoordinateLines },
                { "locationNames", globe.EnableNomenclatures },
            };

            ZFBrowserUtils.SendDataResponse(_browser, requestId, settings);
        }
Exemplo n.º 4
0
        private void Start()
        {
            _terrainModel = GetComponent <TerrainModel>();

            XRInteractableTerrain interactableTerrain = GetComponent <XRInteractableTerrain>();

            if (interactableTerrain is XRInteractableGlobeTerrain)
            {
                _overlayController = GlobeTerrainOverlayController.Instance;
            }
            else
            {
                _overlayController = LocalTerrainOverlayController.Instance;
            }

            // Disable script after initializing.
            enabled = false;
        }
        private void OnTerrainModelChange(TerrainModel terrainModel)
        {
            string terrainType = terrainModel is GlobeTerrainModel ? "globe" : "local";

            _browser.EvalJS($"{UnityGlobalObjectPath}.onTerrainTypeChange.next('{terrainType}');");
        }