32 lines
670 B
C#
32 lines
670 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Voxel
|
|
{
|
|
public class ChunkMesh
|
|
{
|
|
public int X;
|
|
public int Y;
|
|
public byte[] PackedData;
|
|
public bool NeedsUpdate = true;
|
|
public int Length = 0;
|
|
|
|
public ChunkMesh(int x, int y)
|
|
{
|
|
PackedData = new byte[0];
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
|
|
public void SetFaces(List<FaceData> faces)
|
|
{
|
|
Length = faces.Count;
|
|
PackedData = faces.SelectMany(f => f.Pack()).ToArray();
|
|
NeedsUpdate = true;
|
|
}
|
|
}
|
|
}
|