diff --git a/src/godray/GodrayFilter.ts b/src/godray/GodrayFilter.ts index 7708fb036..fd5a9e7de 100644 --- a/src/godray/GodrayFilter.ts +++ b/src/godray/GodrayFilter.ts @@ -1,5 +1,4 @@ -// eslint-disable-next-line camelcase -import { DEG_TO_RAD, deprecation, Filter, GlProgram, GpuProgram, v8_0_0 } from 'pixi.js'; +import { DEG_TO_RAD, Filter, GlProgram, GpuProgram } from 'pixi.js'; import { vertex, wgslVertex } from '../defaults'; import fragment from './god-ray.frag'; import source from './god-ray.wgsl'; @@ -8,17 +7,6 @@ import sourcePerlin from './perlin.wgsl'; import type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js'; -interface DeprecatedGodrayFilterOptions -{ - angle: number; - gain: number; - lacunarity: number; - parallel: boolean; - time: number; - center: number[] | PointData; - alpha: number; -} - export interface GodrayFilterOptions { /** @@ -38,7 +26,7 @@ export interface GodrayFilterOptions * once defined in the constructor * @default {x:0,y:0} */ - center?: PointData; + center?: PointData | number[]; /** * General intensity of the effect. A value closer to 1 will produce a more intense effect, * where a value closer to 0 will produce a subtler effect. @@ -107,29 +95,8 @@ export class GodrayFilter extends Filter private _angle = 0; private _center!: PointData; - constructor(options?: GodrayFilterOptions); - /** - * @deprecated since 8.0.0 - * - * @param {object} [options] - Filter options - * @param {number} [options.angle=30] - Angle/Light-source of the rays. - * @param {number} [options.gain=0.5] - General intensity of the effect. - * @param {number} [options.lacunarity=2.5] - The density of the fractal noise. - * @param {boolean} [options.parallel=true] - `true` to use `angle`, `false` to use `center` - * @param {number} [options.time=0] - The current time position. - * @param {PIXI.PointData|number[]} [options.center=[0,0]] - Focal point for non-parallel rays, - * to use this `parallel` must be set to `false`. - * @param {number} [options.alpha=1.0] - the alpha, defaults to 1, affects transparency of rays - */ - constructor(options?: Partial); - constructor(options?: GodrayFilterOptions | Partial) + constructor(options?: GodrayFilterOptions) { - if (Array.isArray(options?.center)) - { - deprecation(v8_0_0, 'GodrayFilterOptions.center now only accepts {x, y} PointData type.'); - options.center = { x: options.center[0], y: options.center[1] }; - } - options = { ...GodrayFilter.DEFAULT_OPTIONS, ...options }; const gpuProgram = GpuProgram.from({ @@ -222,7 +189,15 @@ export class GodrayFilter extends Filter * @default {x:0,y:0} */ get center(): PointData { return this._center; } - set center(value: PointData) { this._center = value; } + set center(value: PointData | number[]) + { + if (Array.isArray(value)) + { + value = { x: value[0], y: value[1] }; + } + + this._center = value; + } /** * Focal point for non-parallel rays on the `x` axis, to use this `parallel` must be set to `false`.