예제 #1
0
        /// <summary>
        /// インスタンスを生成します。
        /// </summary>
        /// <param name="chunkManager">チャンク マネージャ。</param>
        /// <param name="position">チャンクの位置。</param>
        /// <param name="region">リージョン。</param>
        public Chunk(ChunkManager chunkManager, ChunkMeshManager meshManager, Region region, IntVector3 position)
        {
            if (chunkManager == null) throw new ArgumentNullException("manager");
            if (region == null) throw new ArgumentNullException("region");

            this.chunkManager = chunkManager;
            this.meshManager = meshManager;
            this.region = region;
            Position = position;

            opaqueMeshes = new ChunkMesh[meshManager.MeshSegments.X, meshManager.MeshSegments.Y, meshManager.MeshSegments.Z];
            translucentMeshes = new ChunkMesh[meshManager.MeshSegments.X, meshManager.MeshSegments.Y, meshManager.MeshSegments.Z];

            Node = chunkManager.CreateNode();
        }
예제 #2
0
        protected override void LoadContent()
        {
            logger.Info("LoadContent");

            //----------------------------------------------------------------
            // �X�g���[�W �}�l�[�W��

            StorageManager.SelectStorageContainer("Blocks.Demo.MainGame");

            //----------------------------------------------------------------
            // ���\�[�X ���[�_

            ResourceLoader.Register(ContentResourceLoader.Instance);
            ResourceLoader.Register(TitleResourceLoader.Instance);
            ResourceLoader.Register(StorageResourceLoader.Instance);
            ResourceLoader.Register(FileResourceLoader.Instance);

            //----------------------------------------------------------------
            // �r���[ �R���g���[��

            var viewport = GraphicsDevice.Viewport;
            viewInput.InitialMousePositionX = viewport.Width / 2;
            viewInput.InitialMousePositionY = viewport.Height / 2;
            viewInput.MoveVelocity = moveVelocity;
            viewInput.DashFactor = dashFactor;
            viewInput.Yaw(MathHelper.Pi);

            //----------------------------------------------------------------
            // ���[���h �}�l�[�W��

            worldManager = new WorldManager(Services, GraphicsDevice);
            worldManager.Initialize();

            //----------------------------------------------------------------
            // ���[�W����

            // TODO
            region = worldManager.Load("dummy");

            //----------------------------------------------------------------
            // �u���V �}�l�[�W��

            brushManager = new BrushManager(Services, GraphicsDevice, worldManager, commandManager);

            //----------------------------------------------------------------
            // ���̑�

            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("Fonts/Debug");
            fillTexture = Texture2DHelper.CreateFillTexture(GraphicsDevice);
            helpMessageFontSize = font.MeasureString(helpMessage);

            BuildInfoMessage();
            informationTextFontSize = font.MeasureString(stringBuilder);
        }