Esempio n. 1
0
 /// <summary>
 /// Adds a vertex to the mesh data.
 /// </summary>
 /// <param name="model">The mesh data.</param>
 /// <param name="x">X position of the vertex.</param>
 /// <param name="y">Y position of the vertex.</param>
 /// <param name="z">Z position of the vertex.</param>
 /// <param name="color">The color of the vertex.</param>
 public static void AddVertex(MeshData model, float x, float y, float z, int color)
 {
     model.xyz[model.XyzCount + 0]   = x;
     model.xyz[model.XyzCount + 1]   = y;
     model.xyz[model.XyzCount + 2]   = z;
     model.Rgba[model.RgbaCount + 0] = (byte)(ColorUtil.ColorR(color));
     model.Rgba[model.RgbaCount + 1] = (byte)(ColorUtil.ColorG(color));
     model.Rgba[model.RgbaCount + 2] = (byte)(ColorUtil.ColorB(color));
     model.Rgba[model.RgbaCount + 3] = (byte)(ColorUtil.ColorA(color));
     model.VerticesCount++;
 }