private void RenderDebugTileFlags(Renderer renderer)
 {
     for (var y = 0; y < gridlet.YLength; y++) {
     for (var x = 0; x < gridlet.XLength; x++) {
        var cellIndex = y * gridlet.XLength + x;
        var cellHeight = gridlet.Cells[cellIndex].Height;
        var cellFlags = gridlet.Cells[cellIndex].Flags;
        var transform = gridlet.Cells[cellIndex].OrientedBoundingBox.Transformation;
        Vector4 color;
        if (cellFlags.HasFlag(CellFlags.Connector)) {
           var derp = ((x + y) % 2 == 0) ? 0.6f : 0.8f;
           color = new Vector4(derp, derp / 2, 0, 1.0f);
        } else if (cellFlags.HasFlag(CellFlags.Debug)) {
           var derp = ((x + y) % 2 == 0) ? 0.6f : 0.8f;
           color = new Vector4(0.0f, 0, derp, 1.0f);
        } else if (cellFlags.HasFlag(CellFlags.Blocked)) {
           var derp = ((x + y) % 2 == 0) ? 0.6f : 0.8f;
           color = new Vector4(derp, 0.0f, 0, 1.0f);
        } else if (cellFlags.HasFlag(CellFlags.Edge)) {
           var derp = ((x + y) % 2 == 0) ? 0.6f : 0.8f;
           color = new Vector4(0.0f, derp, 0, 1.0f);
        } else {
           var derp = ((x + y) % 2 == 0) ? 0.2f : 0.4f;
           color = new Vector4(derp, derp, derp, 1.0f);
        }
        renderer.DrawCube(transform, color, false);
     }
      }
 }
Ejemplo n.º 2
0
 public override void Render(Renderer renderer)
 {
     var worldMatrix = kModelTransform * Matrix.Scaling(kCharacterSize) * Matrix.Translation(position);
      renderer.DrawCube(worldMatrix, color, false);
      renderer.DrawOrientedBoundingBox(Bounds, Color4.White);
 }