protected override void DrawTopDown(MapGraphics graphics) { graphics.drawLayers[(int)MapGraphics.DrawLayers.FillBuffers].Add(() => { List <(float centerX, float centerZ, float radius)> dimensionList = Get2DDimensions(); var color = ColorUtilities.ColorToVec4(Color, OpacityByte); var outlineColor = ColorUtilities.ColorToVec4(OutlineColor); foreach (var dim in dimensionList) { var transform = graphics.BillboardMatrix * Matrix4.CreateScale(dim.radius) * Matrix4.CreateTranslation(dim.centerX, 0, dim.centerZ); graphics.circleRenderer.AddInstance( transform, OutlineWidth, color, outlineColor); } }); }
protected override void DrawTopDown(MapGraphics graphics) { graphics.drawLayers[(int)MapGraphics.DrawLayers.FillBuffers].Add(() => { List <(float centerX, float centerZ, float radius, float angle, float angleRadius)> dimenstionList = GetDimensions(); foreach ((float centerX, float centerZ, float radius, float angle, float angleRadius) in dimenstionList) { var pfft = MoreMath.AngleUnitsToRadians(angle - angleRadius); var pfft2 = MoreMath.AngleUnitsToRadians(angle + angleRadius); graphics.lineRenderer.Add( new Vector3(centerX, 0, centerZ), new Vector3(centerX + (float)Math.Sin(pfft) * radius, 0, centerZ + (float)Math.Cos(pfft) * radius), ColorUtilities.ColorToVec4(OutlineColor), OutlineWidth); graphics.lineRenderer.Add( new Vector3(centerX, 0, centerZ), new Vector3(centerX + (float)Math.Sin(pfft2) * radius, 0, centerZ + (float)Math.Cos(pfft2) * radius), ColorUtilities.ColorToVec4(OutlineColor), OutlineWidth); } }); }
protected override void DrawTopDown(MapGraphics graphics) { graphics.drawLayers[(int)MapGraphics.DrawLayers.FillBuffers].Add(() => { var data = GetData(); foreach (var dataPoint in data) { DrawIcon(graphics, graphics.view.mode == MapView.ViewMode.ThreeDimensional, dataPoint.x, dataPoint.y, dataPoint.z, dataPoint.angle, dataPoint.tex.Value, 1); } if (OutlineWidth != 0) { var color = ColorUtilities.ColorToVec4(OutlineColor, OpacityByte); for (int i = 0; i < data.Count - 1; i++) { graphics.lineRenderer.Add( new Vector3(data[i].x, data[i].y, data[i].z), new Vector3(data[i + 1].x, data[i + 1].y, data[i + 1].z), color, OutlineWidth); } } }); }
protected override void DrawTopDown(MapGraphics graphics) { if (OutlineWidth == 0) { return; } graphics.drawLayers[(int)MapGraphics.DrawLayers.FillBuffers].Add(() => { bool isFirstVertex = false; Vector3 lastVertex = default(Vector3); foreach (var vert in GetVertices(graphics)) { var newVertex = vert; if (isFirstVertex) { graphics.lineRenderer.Add(lastVertex, newVertex, ColorUtilities.ColorToVec4(OutlineColor, OpacityByte), OutlineWidth); } isFirstVertex = !isFirstVertex; lastVertex = newVertex; } }); }