Exemplo n.º 1
0
        private Ring1Root CreateRootNode(RootNodeCreationParameters parameters)
        {
            int maximumLodLevel = parameters.PrecisionDistances.Values.Max();
            int minimumLodLevel = parameters.PrecisionDistances.Values.Min();

            _visibilityResolver =
                new Ring1VisibilityResolver(new Ring1BoundsCalculator(parameters.UnityCoordsCalculator), parameters.InitialCameraPosition);
            _visibilityResolver.SetFovDataOverride(true);

            _nodeSplitController = new NodeSplitController(
                maximumLodLevel: maximumLodLevel,
                minimumLodLevel: minimumLodLevel,
                precisionDistances: parameters.PrecisionDistances,
                coordsCalculator: parameters.UnityCoordsCalculator
                );
            //_nodeSplitController.SetCameraPosition(parameters.InitialCameraPosition);
            //Debug.Log("F11 First camera position "+parameters.InitialCameraPosition);

            return(new Ring1Root(
                       new Ring1Node(
                           _nodeSplitController,
                           parameters.NodeListener,
                           _visibilityResolver,
                           new MyRectangle(0, 0, 0.5f, 0.5f),
                           1, Ring1NodePositionEnum.DOWN_LEFT),
                       new Ring1Node(
                           _nodeSplitController,
                           parameters.NodeListener,
                           _visibilityResolver,
                           new MyRectangle(0.5f, 0, 0.5f, 0.5f),
                           1, Ring1NodePositionEnum.DOWN_RIGHT),
                       new Ring1Node(
                           _nodeSplitController,
                           parameters.NodeListener,
                           _visibilityResolver,
                           new MyRectangle(0, 0.5f, 0.5f, 0.5f),
                           1, Ring1NodePositionEnum.TOP_LEFT),
                       new Ring1Node(
                           _nodeSplitController,
                           parameters.NodeListener,
                           _visibilityResolver,
                           new MyRectangle(0.5f, 0.5f, 0.5f, 0.5f),
                           1, Ring1NodePositionEnum.TOP_RIGHT),
                       parameters.NodeListener
                       ));
        }
Exemplo n.º 2
0
 public void CreateHeightmap(RootNodeCreationParameters parameters)
 {
     _rootNode = CreateRootNode(parameters);
     Update(new FovData(parameters.InitialCameraPosition, null));
 }