コード例 #1
0
        public cWaterBlock(cAABB area)
        {
            this.area = area.ShallowCopy();

            int divider = Constants.TILE_SIZE; // / 2

            DIVISION   = (int)(this.area.dims.X / divider);
            unitLength = divider; // this.area.dims.X / (float)DIVISION;

            vertices = new VertexArray(PrimitiveType.TrianglesStrip);

            waterNodes = new List <cWaterNode>();

            Init();
        }
コード例 #2
0
ファイル: cWorld.cs プロジェクト: masums/platformerGame
        private void recalculateDrawBounds(cAABB viewRect)
        {
            drawTileBounds = viewRect.ShallowCopy();

            drawTileBounds.topLeft.X = (float)Math.Floor((drawTileBounds.topLeft.X / Constants.TILE_SIZE) - 1);
            drawTileBounds.topLeft.Y = (float)Math.Floor((drawTileBounds.topLeft.Y / Constants.TILE_SIZE) - 1);

            drawTileBounds.rightBottom.X = (float)Math.Ceiling((drawTileBounds.rightBottom.X / Constants.TILE_SIZE) + 1);
            drawTileBounds.rightBottom.Y = (float)Math.Ceiling((drawTileBounds.rightBottom.Y / Constants.TILE_SIZE) + 1);

            drawTileBounds.topLeft.X     = Math.Max(drawTileBounds.topLeft.X, 0.0f);
            drawTileBounds.topLeft.Y     = Math.Max(drawTileBounds.topLeft.Y, 0.0f);
            drawTileBounds.rightBottom.X = Math.Min(drawTileBounds.rightBottom.X, m_Level1.Width);
            drawTileBounds.rightBottom.Y = Math.Min(drawTileBounds.rightBottom.Y, m_Level1.Height);
        }
コード例 #3
0
 public cQuadTreeOccupant(cAABB _bounds)
 {
     bounds = _bounds.ShallowCopy();
 }