Exemplo n.º 1
0
 protected virtual void UpdateHeightMapEach(int y, DataForUpdateHeightMap arg)
 {
     for (var x = 0; x <= width; x++)
     {
         SetHeight(x, y, arg.H(arg.px.x * (x - 0.5f + _seeds.x), arg.px.y * (y - 0.5f + _seeds.y), arg.t));
     }
 }
Exemplo n.º 2
0
        protected virtual IEnumerator UpdateHeightMap()
        {
            var px  = new Vector2(noiseFreq * aspect / width, noiseFreq / width);
            var t   = Time.timeSinceLevelLoad * timeScale + _seeds.z;
            var H   = (HeightFunc == null ? DefaultHeightFunc : HeightFunc);
            var arg = new DataForUpdateHeightMap(px, t, H);

            return(Parallel.ForAsync(0, width + 1, UpdateHeightMapEach, arg));
        }
Exemplo n.º 3
0
        void UpdateHeightMap()
        {
            var px  = (float)noiseFreq / _height;
            var t   = Time.timeSinceLevelLoad * timeScale + _seeds.z;
            var H   = (HeightFunc == null ? DefaultHeightFunc : HeightFunc);
            var arg = new DataForUpdateHeightMap(px, t, H);

            Parallel.For(0, _height + 1, UpdateHeightMapEach, arg);
        }