Ejemplo n.º 1
0
        public override void Draw(Gem.Render.RenderContext context)
        {
            if (Hidden) return;

            context.Color = Color;
            if (Texture != null) context.Texture = Texture;
            if (NormalMap != null) context.NormalMap = NormalMap;
            else context.NormalMap = context.NeutralNormals;
            context.World = WorldTransform;
            context.UVTransform = UVTransform;
            context.LightingEnabled = true;
            context.Alpha = Alpha;
            context.ApplyChanges();
            context.Draw(Mesh);
            context.NormalMap = context.NeutralNormals;

            if (Hilite && HiliteMesh != null)
            {
                context.Texture = context.White;
                context.Color = HiliteColor;
                context.LightingEnabled = false;
                context.ApplyChanges();
                context.Draw(HiliteMesh);
            }

            context.UVTransform = Matrix.Identity;
        }
Ejemplo n.º 2
0
 public void DebugRenderFace(Gem.Render.RenderContext Context, Gem.Geo.EMFace Face)
 {
     Context.Color = new Vector3(0, 1, 1);
     Context.LightingEnabled = false;
     Context.ApplyChanges();
     foreach (var edge in Face.edges)
         Context.DrawLineIM(Mesh.Verticies[edge.Verticies[0]], Mesh.Verticies[edge.Verticies[1]]);
 }
Ejemplo n.º 3
0
 public void DebugRender(Gem.Render.RenderContext Context)
 {
     Context.Color = new Vector3(1, 0, 0);
     Context.LightingEnabled = false;
     Context.ApplyChanges();
     foreach (var edge in Mesh.Edges)
         Context.DrawLineIM(Mesh.Verticies[edge.Verticies[0]], Mesh.Verticies[edge.Verticies[1]]);
 }
Ejemplo n.º 4
0
        public override void Draw(Gem.Render.RenderContext Context)
        {
            Context.Color = new Vector3(1, 1, 1);
            Context.World = Orientation.Transform;
            Context.NormalMap = Context.NeutralNormals;
            Context.LightingEnabled = false;

            Grid.Cells.forAll((c, x, y, z) =>
                {
                    if (c != null && c.Visible)
                    {
                        Context.Texture = TextureTable[c.Texture];
                        Context.ApplyChanges();
                        Context.Draw(c.Mesh);

                        if (HoverTexture != null && MouseHover && Object.ReferenceEquals(CellUnderMouse, c))
                        {
                            Context.Texture = HoverTexture;
                            Context.ApplyChanges();
                            Context.Draw(c.Mesh);
                        }
                    }
                });
        }
Ejemplo n.º 5
0
        public override void Draw(Gem.Render.RenderContext Context)
        {
            Context.Color = new Vector3(1, 0, 0);
            Context.Texture = Context.White;
            Context.NormalMap = Context.NeutralNormals;
            Context.World = Orientation.Transform;
            Context.LightingEnabled = false;
            Context.ApplyChanges();
            Context.Draw(GridMesh);

            Context.World =
                Orientation.Transform
                * Matrix.CreateScale(cellWidth, cellHeight, 1.0f)
                * Matrix.CreateTranslation(LocalMouseX, LocalMouseY, 0.0f);
            Context.Draw(QuadMesh);
        }
Ejemplo n.º 6
0
        public override void Draw(Gem.Render.RenderContext context)
        {
            context.Color = Color;
            if (Texture != null) context.Texture = Texture;
            context.NormalMap = NormalMap == null ? context.NeutralNormals : NormalMap;
            context.World = WorldTransform;
            context.UVTransform = UVTransform;
            context.LightingEnabled = true;
            context.ApplyChanges();
            context.Draw(Mesh);
            context.NormalMap = context.NeutralNormals;

            if (HiliteOnHover && MouseHover)
            {
                context.Texture = HoverOverlay;
                context.LightingEnabled = false;
                context.ApplyChanges();
                context.Draw(Mesh);
            }

            context.UVTransform = Matrix.Identity;
        }
Ejemplo n.º 7
0
        public override void Draw(Gem.Render.RenderContext Context)
        {
            Context.Color = Vector3.One;
            Context.Texture = Blocks.Tiles.Texture;
            Context.NormalMap = Context.NeutralNormals;
            Context.World = WorldTransform;
            Context.LightingEnabled = true;
            Context.ApplyChanges();
            Context.Draw(ChunkMesh);

            if (MouseHover)
            {
                Context.LightingEnabled = false;
                Context.UVTransform = Blocks.Tiles.TileMatrix(HiliteTexture);
                Context.ApplyChanges();
                Context.Draw(HiliteQuad);
            }
        }