コード例 #1
0
ファイル: Tile.cs プロジェクト: jjaspe/Libraries
 public Tile(double[] start, int _tileSize, int orientation = 3)
 {
     MyOrigin = new PointObj(start[0], start[1], start[2]);
     MyEnd = new PointObj(start[0] + _tileSize, start[1] + _tileSize, start[2]);
     this.TileSize = _tileSize;
     assignId();
 }
コード例 #2
0
ファイル: HighWall.cs プロジェクト: jjaspe/Libraries
        public HighWall(double altitude, double startX, double endX, int tileSize)
        {
            assignId();
            IPoint or = new PointObj(startX, altitude, 0);
            IPoint topOr = new PointObj(or.X, or.Y, or.Z + tileSize);
            //Create tiles
            myTiles = new tileObj[2,(int)(endX - startX)/tileSize];
            for (int i = 0; i < (endX-startX)/tileSize; i++)
            {
                myTiles[0,i] = new tileObj(new PointObj(or.X+ i * tileSize, or.Y, or.Z),
                    new PointObj(or.X + (i + 1) * tileSize, or.Y, or.Z+tileSize), Common.colorBrown, Common.colorBlack);
                myTiles[1, i] = new tileObj(new PointObj(topOr.X + i * tileSize, topOr.Y, topOr.Z),
                   new PointObj(topOr.X + (i + 1) * tileSize, topOr.Y, topOr.Z + tileSize), Common.colorBrown, Common.colorBlack);

            }
            MyOrigin = myTiles[0, 0].MyOrigin;
            TileSize = tileSize;
            Orientation = Common.planeOrientation.Y;
        }
コード例 #3
0
ファイル: Tile.cs プロジェクト: jjaspe/Libraries
 public Tile(double[] start, int[] end)
 {
     MyOrigin = new PointObj(start[0], start[1], start[2]);
     MyEnd = new PointObj(end[0], end[1], end[2]);
     assignId();
 }
コード例 #4
0
ファイル: HighWall.cs プロジェクト: jjaspe/Libraries
        public void turn()
        {
            if (MyOrigin == null || MyTiles == null || MyTiles.Length == 0)
                return;
            double startY = MyOrigin.Y, endY = MyOrigin.Y + MyTiles.Length/2 * TileSize;

            IPoint or = new PointObj(MyOrigin.X,startY, 0);
            IPoint topOr = new PointObj(or.X, or.Y, or.Z + TileSize);
            for (int i = 0; i < (endY - startY) / TileSize; i++)
            {
                myTiles[0, i] = new tileObj(new PointObj(or.X, or.Y + i * TileSize, or.Z),
                    new PointObj(or.X , or.Y + (i + 1) * TileSize, or.Z + TileSize), Common.colorBrown, Common.colorBlack);
                myTiles[1, i] = new tileObj(new PointObj(topOr.X , topOr.Y + i * TileSize , topOr.Z),
                   new PointObj(topOr.X, topOr.Y + (i + 1) * TileSize, topOr.Z + TileSize), Common.colorBrown, Common.colorBlack);

            }
            Orientation = Common.planeOrientation.X;
        }
コード例 #5
0
ファイル: HighBlock.cs プロジェクト: jjaspe/Libraries
        private void createBlock(IPoint or, int size, float[] color, float[] outlineColor)
        {
            IPoint topOr = new PointObj(or.X, or.Y, or.Z + size);
            //Create two cubes, one on top of the other
            myCubes = new cubeObj[2];
            myCubes[0] = new cubeObj(or, size, color, outlineColor);
            myCubes[1] = new cubeObj(topOr, size, color, outlineColor);
            myCubes[0].createCubeTiles();
            myCubes[1].createCubeTiles();

            myOrigin = myCubes[0].MyOrigin;
            height = myCubes[0].CubeSize * 2;
        }