Exemple #1
0
        public RenderBatch(MarkupStylePart[] dashes, int count, Vector3 size, MaterialType materialType)
        {
            MaterialType = materialType;
            Count        = count;
            Locations    = new Vector4[Count];
            Indices      = new Vector4[Count];
            Colors       = new Vector4[Count];
            Size         = size;

            for (var i = 0; i < Count; i += 1)
            {
                var dash = dashes[i];
                Locations[i]   = dash.Position;
                Locations[i].w = dash.Angle;
                Indices[i]     = new Vector4(0f, 0f, 0f, 1f);
                Colors[i]      = dash.Color.ToX3Vector();
            }

            Mesh = RenderHelper.CreateMesh(Count, size);
        }