public WaveQueryTask(WaveSpectrumBase spectrum, float level, Vector3 offset, IEnumerable <WaveQuery> querys, Action <IEnumerable <WaveQuery> > callBack) : base(true) { IDisplacementBuffer buffer = spectrum.DisplacementBuffer; buffer.CopyAndCreateDisplacements(out m_displacements); m_querys = querys; m_callBack = callBack; m_enabled = buffer.EnabledBuffers(); m_level = level; Vector4 invGridSizes = new Vector4(); invGridSizes.x = 1.0f / (spectrum.GridSizes.x * spectrum.GridScale); invGridSizes.y = 1.0f / (spectrum.GridSizes.y * spectrum.GridScale); invGridSizes.z = 1.0f / (spectrum.GridSizes.z * spectrum.GridScale); invGridSizes.w = 1.0f / (spectrum.GridSizes.w * spectrum.GridScale); m_scaling = new QueryGridScaling(); m_scaling.invGridSizes = invGridSizes; m_scaling.choppyness = spectrum.Choppyness * spectrum.GridScale; m_scaling.scaleY = spectrum.GridScale; m_scaling.offset = offset; //tmp buffer to reduce memory allocations. m_scaling.tmp = new float[QueryDisplacements.CHANNELS]; }
public WaveQueryTask(WaveSpectrumBase spectrum, float level, Vector3 offset, IEnumerable<WaveQuery> querys, Action<IEnumerable<WaveQuery>> callBack) : base(true) { IDisplacementBuffer buffer = spectrum.DisplacementBuffer; buffer.CopyAndCreateDisplacements(out m_displacements); m_querys = querys; m_callBack = callBack; m_enabled = buffer.EnabledBuffers(); m_level = level; Vector4 invGridSizes = new Vector4(); invGridSizes.x = 1.0f / (spectrum.GridSizes.x * spectrum.GridScale); invGridSizes.y = 1.0f / (spectrum.GridSizes.y * spectrum.GridScale); invGridSizes.z = 1.0f / (spectrum.GridSizes.z * spectrum.GridScale); invGridSizes.w = 1.0f / (spectrum.GridSizes.w * spectrum.GridScale); m_scaling = new QueryGridScaling(); m_scaling.invGridSizes = invGridSizes; m_scaling.choppyness = spectrum.Choppyness * spectrum.GridScale; m_scaling.scaleY = spectrum.GridScale; m_scaling.offset = offset; //tmp buffer to reduce memory allocations. m_scaling.tmp = new float[QueryDisplacements.CHANNELS]; }
public FindRangeTask(WaveSpectrumBase spectrum) : base(true) { this.m_spectrum = spectrum; this.m_choppyness = spectrum.Choppyness; this.m_gridScale = new Vector2(spectrum.GridScale, spectrum.GridScale); IDisplacementBuffer displacementBuffer = spectrum.DisplacementBuffer; displacementBuffer.CopyAndCreateDisplacements(out this.m_displacements); }