Esempio n. 1
0
        public virtual void LoadContent(IEditorGame game)
        {
            var effect = new BoxSelectEffect(game.LoadContent <Effect>("BoxSelect"))
            {
                Sampler = game.GraphicsDevice.SamplerStates.PointWrap,
                Main    = _texture
            };

            _effect  = effect;
            _texture = game.LoadContent <Texture2D>("Grid");

            foreach (var face in FacesUtils.AllFaces)
            {
                var mesh = new Mesh <VertexPositionTexture>(Buffer.Vertex.New(game.GraphicsDevice, CreateQuadUv(face)), effect.Effect);
                SetQuad(face, mesh);
            }
        }
Esempio n. 2
0
        void LoadContent(IEditorGame game)
        {
            var arrowDesc = new TruncatedConeDescription(
                new ConeSection(0, 0),
                new ConeSection(.03f, 0),
                new ConeSection(.03f, 2f / 3),
                new ConeSection(.10f, 2f / 3),
                new ConeSection(0, 1f));

            var arrowMesh   = new TruncatedConeBuilder().Build(arrowDesc);
            var arrowBuffer = Buffer.Vertex.New(game.GraphicsDevice, arrowMesh);
            var effect      = new FullColorEffect(game.LoadContent <Effect>("FullColor"));

            _effect    = effect;
            _arrowMesh = new Mesh <VertexPosition>(arrowBuffer, effect.Effect);
        }
Esempio n. 3
0
        public void LoadContent([NotNull] IEditorGame game)
        {
            _game      = game;
            _vertexLit = new VertexLitEffect(game.LoadContent <Effect>("VertexLit"));

            // TODO: settings
            var mesher = _meshalyzers.LastOrDefault();

            if (mesher == null)
            {
                return;
            }

            SwitchMeshalyzer(mesher);
            Policy = ChunkCreationPolicy.Run;
            game.World.ChunksModified += ChunksModified;
        }