PlayerArea() public static method

public static PlayerArea ( int playerAreaSize, int centerAreaSize, Vector3i blockPosition ) : Point
playerAreaSize int
centerAreaSize int
blockPosition Vector3i
return Point
Example #1
0
        public void TryRemap()
        {
            var p = MapUtil.PlayerArea(mapAreaSize, centerAreaSize, PlayerBlockPosition());
            var newMapPosition = new Vector3i(p.X, p.Y, 0);

            if (CurrentRendererMapPositionG != newMapPosition)
            {
                //todo: check if complete terrain in new area is already downloaded.
                Remap(newMapPosition);
                CurrentRendererMapPositionG = newMapPosition;
            }
        }
Example #2
0
        public void StartTerrain()
        {
            //Toggle fog.
            var p = MapUtil.PlayerArea(mapAreaSize, centerAreaSize, PlayerBlockPosition());

            CurrentRendererMapPositionG = new Vector3i(p.X, p.Y, 0);
            if (RendererMap != null)
            {
                throw new NotImplementedException();
            }
            RendererMap = new RenderedChunk[(mapAreaSize / chunksize) * (mapAreaSize / chunksize) * (MapSizeZ / chunksize)];
            for (int i = 0; i < RendererMap.Length; i++)
            {
                RendererMap[i] = new RenderedChunk();
            }
        }