예제 #1
0
        public GeoClipMapCentre(Game game, short n) : base(game)
        {
            short m    = (short)((n + 1) / 4);
            short edge = (short)((n / 2) - 1);

            block = new GeoClipMapFootPrintBlock(game, n);

            block.Position = new Vector3(-edge, 0, -edge);
            block.color    = Color.MintCream;
        }
예제 #2
0
        public GeoClipMapLayer(Game game, short n, string heightMap) : base(game)
        {
            heightMapAsset = heightMap;

            short m    = (short)((n + 1) / 4);
            short edge = (short)((m * 2) - 1);

            for (int b = 0; b < blocks.Length; b++)
            {
                blocks[b] = new GeoClipMapFootPrintBlock(game, m);

                switch (b)
                {
                case 0:
                    blocks[b].Position  = new Vector3(-edge, 0, -edge);
                    blocks[b].BlockType = BlockTypesEnum.TopLeft;
                    break;

                case 1:
                    blocks[b].Position  = new Vector3(-m, 0, -edge);
                    blocks[b].BlockType = BlockTypesEnum.Top;
                    break;

                case 2:
                    blocks[b].Position  = new Vector3(1, 0, -edge);
                    blocks[b].BlockType = BlockTypesEnum.Top;
                    break;

                case 3:
                    blocks[b].Position  = new Vector3(m, 0, -edge);
                    blocks[b].BlockType = BlockTypesEnum.TopRight;
                    break;

                case 4:
                    blocks[b].Position  = new Vector3(-edge, 0, -m);
                    blocks[b].BlockType = BlockTypesEnum.Left;
                    break;

                case 5:
                    blocks[b].Position  = new Vector3(m, 0, -m);
                    blocks[b].BlockType = BlockTypesEnum.Right;
                    break;

                case 6:
                    blocks[b].Position  = new Vector3(-edge, 0, 1);
                    blocks[b].BlockType = BlockTypesEnum.Left;
                    break;

                case 7:
                    blocks[b].Position  = new Vector3(m, 0, 1);
                    blocks[b].BlockType = BlockTypesEnum.Right;
                    break;

                case 8:
                    blocks[b].Position  = new Vector3(-edge, 0, m);
                    blocks[b].BlockType = BlockTypesEnum.BottomLeft;
                    break;

                case 9:
                    blocks[b].Position  = new Vector3(-m, 0, m);
                    blocks[b].BlockType = BlockTypesEnum.Bottom;
                    break;

                case 10:
                    blocks[b].Position  = new Vector3(1, 0, m);
                    blocks[b].BlockType = BlockTypesEnum.Bottom;
                    break;

                case 11:
                    blocks[b].Position  = new Vector3(m, 0, m);
                    blocks[b].BlockType = BlockTypesEnum.BottomRight;
                    break;
                }
                blocks[b].Orientation *= Orientation;
            }

            for (int b = 0; b < fixup.Length; b++)
            {
                switch (b)
                {
                case 0:
                    fixup[b]           = new GeoClipMapFootPrintFixUp(game, m, false);
                    fixup[b].Position  = new Vector3(-1, 0, -edge);
                    fixup[b].FixUpType = FixUpTypesEnum.Top;
                    break;

                case 1:
                    fixup[b]           = new GeoClipMapFootPrintFixUp(game, m, false);
                    fixup[b].Position  = new Vector3(-1, 0, m);
                    fixup[b].FixUpType = FixUpTypesEnum.Bottom;
                    break;

                case 2:
                    fixup[b]           = new GeoClipMapFootPrintFixUp(game, m, true);
                    fixup[b].Position  = new Vector3(-edge, 0, -1);
                    fixup[b].FixUpType = FixUpTypesEnum.Left;
                    break;

                case 3:
                    fixup[b]           = new GeoClipMapFootPrintFixUp(game, m, true);
                    fixup[b].Position  = new Vector3(m, 0, -1);
                    fixup[b].FixUpType = FixUpTypesEnum.Right;
                    break;
                }
                fixup[b].Orientation *= Orientation;
            }

            for (int b = 0; b < trim.Length; b++)
            {
                switch (b)
                {
                case 0:
                    trim[b]          = new GeoClipMapFootPrintTrim(game, m, false);
                    trim[b].Position = new Vector3(-m, 0, -m);
                    break;

                case 1:
                    trim[b]          = new GeoClipMapFootPrintTrim(game, m, false);
                    trim[b].Position = new Vector3(0, 0, -m);
                    break;

                case 2:
                    trim[b]          = new GeoClipMapFootPrintTrim(game, m, true);
                    trim[b].Position = new Vector3(m - 1, 0, -m);
                    break;

                case 3:
                    trim[b]          = new GeoClipMapFootPrintTrim(game, m, true);
                    trim[b].Position = new Vector3(m - 1, 0, 0);
                    break;
                }
                trim[b].Orientation *= Orientation;
            }
        }