public void UpdateJobsGerstnerCache(AsyncGPUReadbackRequest request)
        {
            NativeArray <ushort> resultData = request.GetData <ushort>();
            NativeArray <ushort> data       = new NativeArray <ushort>(resultData, Allocator.Temp);

            ShapeGerstnerJobs.AddNewOceanDepthCache(this, data);

            data.Dispose();
        }
Example #2
0
        private void LateUpdateGerstnerJobs()
        {
            ShapeGerstnerJobs.StartSettingWaveData();

            foreach (var gerstner in _gerstnerComponents)
            {
                // Run any Gerstner-related jobs
                if (gerstner._weight > 0.0001f)
                {
                    gerstner.AddGerstnerData();
                }
            }

            ShapeGerstnerJobs.FinishAddingWaveData();

            ShapeGerstnerJobs.ScheduleJobs();
        }
        public void AddGerstnerData()
        {
            float[] twoPis = new float[_wavelengths.Length];

            ShapeGerstnerJobs.AddWaveData(_wavelengths, _amplitudes, _angleDegs, _phases, _spectrum._chopScales, _spectrum._gravityScales, _componentsPerOctave);
        }
Example #4
0
 private void OnDisable()
 {
     ShapeGerstnerJobs.Cleanup();
 }
Example #5
0
 private void OnEnable()
 {
     ShapeGerstnerJobs.Init();
 }