Esempio n. 1
0
 private void RenderNavMesh(NavMesh navMesh)
 {
     GLUtil.SetColor(new Color(0f, 0f, 1.0f, 0.5f));
     navMesh.PolygonList.ForEach(x => GLUtil.RenderPolygonFilled(x));
     GLUtil.SetColor(new Color(0.5f, 0.1f, 0.1f, 1f));
     navMesh.PolygonList.ForEach(x => GLUtil.RenderPolygon(x));
 }
Esempio n. 2
0
        public void Render()
        {
            GLUtil.Clear(new Color(0, 0, 0, 1));

            Gl.glEnable(Gl.GL_TEXTURE_2D);
            foreach (Layer layer in _scene.Layers)
            {
                layer.Render(_renderer);
            }



            _renderer.Render();
            Gl.glDisable(Gl.GL_TEXTURE_2D);

            if (_canWalkMousePosition)
            {
                GLUtil.DrawFilledCircle(_input.Mouse.Position, 10, new Color(0, 1, 0, 1));
            }
            else
            {
                GLUtil.DrawFilledCircle(_input.Mouse.Position, 10, new Color(1, 0, 0, 1));
            }

            // Draw the basic nav meshes
            GLUtil.SetColor(new Color(1, 0, 0, 1));
            _scene.NavMesh.PolygonList.ForEach(x => GLUtil.RenderPolygon(x));
            GLUtil.SetColor(new Color(1, 1, 1, 1));
            Gl.glLineWidth(4);
            Gl.glBegin(Gl.GL_LINE_STRIP);
            {
                foreach (Point point in _path)
                {
                    GLUtil.DrawPointVertex(point);
                }
            }
            Gl.glEnd();
            Gl.glLineWidth(1);

            Gl.glEnable(Gl.GL_TEXTURE_2D);
            _playerCharacter.Render(_renderer);
            _renderer.Render();
            Gl.glDisable(Gl.GL_TEXTURE_2D);
        }