-
Notifications
You must be signed in to change notification settings - Fork 35
/
MeshVisiter.cs
34 lines (30 loc) · 927 Bytes
/
MeshVisiter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace meshing;
public unsafe class MeshVisiter
{
const int BYTES = sizeof(int) * Constants.VOXELS_PER_CHUNK;
public int Comparison = 1;
public int* visitXN;
public int* visitXP;
public int* visitZN;
public int* visitZP;
public int* visitYN;
public int* visitYP;
public MeshVisiter()
{
visitXN = (int*)Allocator.AllocZeroed(BYTES);
visitXP = (int*)Allocator.AllocZeroed(BYTES);
visitZN = (int*)Allocator.AllocZeroed(BYTES);
visitZP = (int*)Allocator.AllocZeroed(BYTES);
visitYN = (int*)Allocator.AllocZeroed(BYTES);
visitYP = (int*)Allocator.AllocZeroed(BYTES);
}
public void Dispose()
{
Allocator.Free(ref visitXN);
Allocator.Free(ref visitXP);
Allocator.Free(ref visitZN);
Allocator.Free(ref visitZP);
Allocator.Free(ref visitYN);
Allocator.Free(ref visitYP);
}
}