Exemplo n.º 1
0
            static void Index1dTo2d_VS_PointToIndex2d(float2 position, float2 gridWorldSize, int gridWidth, int gridHeight)
            {
                int  Ai  = NativeGrid.PointToIndex(position, gridWorldSize, gridWidth, gridHeight);
                int2 Ai2 = NativeGrid.Index1dTo2d(Ai, gridWidth);
                int2 Bi2 = NativeGrid.PointToIndex2d(position, gridWorldSize, gridWidth, gridHeight);

                Assert.AreEqual(Ai2, Bi2, $"\tNativeGrid.Index1dTo2d(NativeGrid.PointToIndex(params)) returned: {Ai2}\n\tNativeGrid.PointToIndex2d returned: {Bi2}");
            }
 public static int PointToIndex(FLOAT2 point, FLOAT2 worldSize, INT width, INT height) => NativeGrid.PointToIndex(point, worldSize, width, height);