18 lines
360 B
C#
18 lines
360 B
C#
using Unity.Mathematics;
|
|
|
|
namespace SepCore.Simulation
|
|
{
|
|
internal static class SimulationCell
|
|
{
|
|
public static long Key(int x, int z)
|
|
{
|
|
return ((long)x << 32) ^ (uint)z;
|
|
}
|
|
|
|
public static int ToCell(float value, float cellSize)
|
|
{
|
|
return (int)math.floor(value / cellSize);
|
|
}
|
|
}
|
|
}
|