protected override Vector2 GetCoordFromHit(RaycastHit hit)
        {
            LocalTerrainModel terrainModel = GetActiveTerrainModel();

            if (!terrainModel)
            {
                throw new Exception("Active localized terrain model not found.");
            }
            return(BoundingBoxUtils.UVToCoordinates(terrainModel.SquareBoundingBox, hit.textureCoord));
        }
        protected override Vector2 GetCoordFromHit(RaycastHit hit)
        {
            GlobeTerrainModel terrainModel = GetActiveTerrainModel();

            if (!terrainModel)
            {
                throw new Exception("Globe model is not currently active.");
            }
            return(BoundingBoxUtils.UVToCoordinates(UnrestrictedBoundingBox.Global, hit.textureCoord));
        }
Пример #3
0
        private void ControllerModalAddPoint(Vector2 uv)
        {
            ControllerModal controllerModal = GetControllerModal();

            if (!controllerModal)
            {
                return;
            }

            Vector2 latLon = BoundingBoxUtils.UVToCoordinates(GetBoundingBoxFromTerrainModel(), uv);

            string js =
                $"let component = {AngularComponentContainerPath}.{GetControllerModalName()};" +
                $"component && component.addPoint({latLon.x}, {latLon.y});";

            controllerModal.Browser.EvalJS(js);
            _framesSinceLastControllerModalUpdate = 0;
        }
        private Vector2 GetCoordinatesFromHit(RaycastHit hit)
        {
            BoundingBox bbox = _terrainModel.SquareBoundingBox;

            return(BoundingBoxUtils.UVToCoordinates(bbox, hit.textureCoord));
        }