private void HandleScheduleHeights(NativeArray <double3> points, NativeArray <double> heights, ref JobHandle handle)
        {
            var job = new HeightsJob();

            job.Frequency = frequency;
            job.Amplitude = amplitude;
            job.Octaves   = octaves;
            job.Points    = points;
            job.Heights   = heights;

            if (cachedTerrain.Areas != null && cachedTerrain.Areas.SplatCount > 0)
            {
                job.Area           = math.clamp(area, 0, cachedTerrain.Areas.SplatCount - 1);
                job.AreaSize       = cachedTerrain.Areas.Size;
                job.AreaSplatCount = cachedTerrain.Areas.SplatCount;
                job.AreaWeights    = cachedTerrain.Areas.Weights;
            }
            else
            {
                job.Area           = 0;
                job.AreaSize       = int2.zero;
                job.AreaSplatCount = 0;
                job.AreaWeights    = tempWeights;
            }

            handle = job.Schedule(heights.Length, 32, handle);
        }
        private void HandleScheduleHeights(NativeArray <double3> points, NativeArray <double> heights, ref JobHandle handle)
        {
            if (heightmap != null)
            {
                var job = new HeightsJob();

                job.Size         = new int2(heightmap.width, heightmap.height);
                job.Displacement = displacement;
                job.Stride       = SgtHelper.GetStride(heightmap.format);
                job.Offset       = SgtHelper.GetOffset(heightmap.format, (int)channel);
                job.Data         = heightmap.GetRawTextureData <byte>();
                job.Points       = points;
                job.Heights      = heights;

                handle = job.Schedule(heights.Length, 32, handle);
            }
        }
        private void HandleScheduleHeights(NativeArray <double3> points, NativeArray <double> heights, ref JobHandle handle)
        {
            if (clampHeights == true)
            {
                var terrainHeightmap = GetComponent <SgtTerrainHeightmap>();

                if (terrainHeightmap != null)
                {
                    var job          = new HeightsJob();
                    var displacement = terrainHeightmap.Displacement;

                    job.WaterLevel = cachedTerrain.Radius + displacement * waterLevel + displacement * heightmapBias;
                    job.Heights    = heights;

                    handle = job.Schedule(heights.Length, 32, handle);
                }
            }
        }