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

            if (terrainModel is LocalTerrainModel)
            {
                return((LocalTerrainModel)terrainModel);
            }
            return(null);
        }
コード例 #2
0
 private void OnTerrainModelChange(TerrainModel terrainModel)
 {
     if (terrainModel is LocalTerrainModel)
     {
         _currentBoundingBox = ((LocalTerrainModel)terrainModel).SquareBoundingBox;
     }
     else
     {
         _currentBoundingBox = BoundingBox.Zero;
     }
 }
コード例 #3
0
        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);
        }
コード例 #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;
        }
コード例 #5
0
        private void OnTerrainModelChange(TerrainModel terrainModel)
        {
            string terrainType = terrainModel is GlobeTerrainModel ? "globe" : "local";

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