Esempio n. 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();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public cQuadTreeOccupant(cAABB _bounds)
 {
     bounds = _bounds.ShallowCopy();
 }