public void Test_SetGetVoxelData_Index([Random(0, 1f, 5)] float newVoxelData, [Random(0, 5 * 5 * 5 - 1, 5)] int index)
 {
     TestSetGetVoxelData(() =>
     {
         voxelDataVolume.SetVoxelData(newVoxelData, index);
         return(voxelDataVolume.GetVoxelData(index));
     }, newVoxelData);
 }
Esempio n. 2
0
 public void Test_Voxel_Datas_Are_Initialized_To_0()
 {
     voxelDataVolume = new VoxelDataVolume(5, Allocator.Temp);
     for (int i = 0; i < voxelDataVolume.Length; i++)
     {
         Assert.AreEqual(0, voxelDataVolume.GetVoxelData(i));
     }
 }
Esempio n. 3
0
        public void Test_SetGetVoxelData_Index([Random(0, 1f, 5)] float newVoxelData, [Random(0, 5 * 5 * 5 - 1, 5)] int index)
        {
            voxelDataVolume = new VoxelDataVolume(5, Allocator.Temp);

            voxelDataVolume.SetVoxelData(newVoxelData, index);
            float actualVoxelData = voxelDataVolume.GetVoxelData(index);

            Assert.IsTrue(AreVoxelDatasSame(newVoxelData, actualVoxelData), $"Expected {newVoxelData}, actual was {actualVoxelData}");
        }
Esempio n. 4
0
        public void Test_SetGetVoxelData_Int3([Random(0, 1f, 5)] float newVoxelData, [Random(0, 4, 3)] int x, [Random(0, 4, 3)] int y, [Random(0, 4, 3)] int z)
        {
            voxelDataVolume = new VoxelDataVolume(5, Allocator.Temp);

            voxelDataVolume.SetVoxelData(newVoxelData, new int3(x, y, z));
            float actualVoxelData = voxelDataVolume.GetVoxelData(new int3(x, y, z));

            Assert.IsTrue(AreVoxelDatasSame(newVoxelData, actualVoxelData), $"Expected {newVoxelData}, actual was {actualVoxelData}");
        }
Esempio n. 5
0
        public void Test_IncreaseVoxelData_Index(float increaseAmount, float originalVoxelData, float expectedVoxelData)
        {
            voxelDataVolume = new VoxelDataVolume(5, Allocator.Temp);
            int index = 36; // Just some arbitrary index to set the voxel data at

            voxelDataVolume.SetVoxelData(originalVoxelData, index);
            voxelDataVolume.IncreaseVoxelData(increaseAmount, index);

            float actualVoxelData = voxelDataVolume.GetVoxelData(index);

            Assert.IsTrue(AreVoxelDatasSame(expectedVoxelData, actualVoxelData), $"Expected {expectedVoxelData}, actual was {actualVoxelData}");
        }