#Polygon2D consistently does not render in some cases

1 messages · Page 1 of 1 (latest)

versed eagle
#

Code that instantiates polygon2d and line2d:

    {
        var chunk = _planetData.GetOrCreateChunk(newChunkId, OptionsNode.VoxelSize);
        // if (_chunkInstances.Contains(chunk.Id))
        // {
        //     return;
        // }

        // _chunkInstances.Add(chunk.Id);

        var polygons = chunk.GetOrCreateChunkPolygon(_planetData);
        if (polygons.Length == 0)
        {
            return;
        }

        // tmp clear of every poly and line
        foreach (var child in GetChildren())
        {
            if (child is Polygon2D || child is Line2D)
            {
                RemoveChild(child);
            }
        }
        ;

        foreach (var polygon in polygons)
        {
            var polyNode = new Polygon2D
            {
                Polygon = polygon,
                Color = DrawUtil.Colors.White(0.75f)
            };
            var lineNode = new Line2D
            {
                Points = DrawUtil.SimpleGeometry.ShrinkPolygon(polygon, 0.75f),
                DefaultColor = DrawUtil.Colors.RandomColor(),
                Closed = true
            };

            AddChild(polyNode);
            AddChild(lineNode);
        }
    }
#

Reuploded picture 1 and 3

Added new picture that marks "border" between picture 2 and 3