@tsparticles/updater-wobble 3.0.0-alpha.0 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/browser/Options/Classes/Wobble.js +2 -2
- package/browser/Types.js +1 -0
- package/browser/Utils.js +13 -0
- package/browser/WobbleUpdater.js +6 -21
- package/browser/index.js +2 -2
- package/cjs/Options/Classes/Wobble.js +2 -2
- package/cjs/Types.js +2 -0
- package/cjs/Utils.js +17 -0
- package/cjs/WobbleUpdater.js +6 -21
- package/cjs/index.js +2 -13
- package/esm/Options/Classes/Wobble.js +2 -2
- package/esm/Types.js +1 -0
- package/esm/Utils.js +13 -0
- package/esm/WobbleUpdater.js +6 -21
- package/esm/index.js +2 -2
- package/package.json +6 -5
- package/report.html +4 -4
- package/tsparticles.updater.wobble.js +33 -26
- package/tsparticles.updater.wobble.min.js +1 -1
- package/tsparticles.updater.wobble.min.js.LICENSE.txt +1 -8
- package/types/Options/Classes/Wobble.d.ts +1 -1
- package/types/Options/Classes/WobbleSpeed.d.ts +1 -1
- package/types/Types.d.ts +22 -0
- package/types/Utils.d.ts +3 -0
- package/types/WobbleUpdater.d.ts +2 -22
- package/types/index.d.ts +1 -1
- package/umd/Options/Classes/Wobble.js +3 -3
- package/umd/Types.js +12 -0
- package/umd/Utils.js +27 -0
- package/umd/WobbleUpdater.js +7 -22
- package/umd/index.js +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-
|
|
7
|
+
* v3.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -91,7 +91,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
91
91
|
|
|
92
92
|
// EXPORTS
|
|
93
93
|
__webpack_require__.d(__webpack_exports__, {
|
|
94
|
-
|
|
94
|
+
loadWobbleUpdater: () => (/* binding */ loadWobbleUpdater)
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
@@ -135,7 +135,7 @@ class Wobble {
|
|
|
135
135
|
this.enable = data.enable;
|
|
136
136
|
}
|
|
137
137
|
if (data.speed !== undefined) {
|
|
138
|
-
if (
|
|
138
|
+
if ((0,engine_root_window_.isNumber)(data.speed)) {
|
|
139
139
|
this.speed.load({
|
|
140
140
|
angle: data.speed
|
|
141
141
|
});
|
|
@@ -152,34 +152,42 @@ class Wobble {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
;// CONCATENATED MODULE: ./dist/browser/
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
;// CONCATENATED MODULE: ./dist/browser/Utils.js
|
|
158
156
|
function updateWobble(particle, delta) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
157
|
+
const {
|
|
158
|
+
wobble: wobbleOptions
|
|
159
|
+
} = particle.options,
|
|
160
|
+
{
|
|
161
|
+
wobble
|
|
162
|
+
} = particle;
|
|
163
|
+
if (!wobbleOptions?.enable || !wobble) {
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
|
-
const angleSpeed =
|
|
165
|
-
moveSpeed =
|
|
166
|
-
distance = moveSpeed * ((
|
|
167
|
-
max = 2 * Math.PI
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
const angleSpeed = wobble.angleSpeed * delta.factor,
|
|
167
|
+
moveSpeed = wobble.moveSpeed * delta.factor,
|
|
168
|
+
distance = moveSpeed * ((particle.retina.wobbleDistance ?? 0) * delta.factor) / (1000 / 60),
|
|
169
|
+
max = 2 * Math.PI,
|
|
170
|
+
{
|
|
171
|
+
position
|
|
172
|
+
} = particle;
|
|
173
|
+
wobble.angle += angleSpeed;
|
|
174
|
+
if (wobble.angle > max) {
|
|
175
|
+
wobble.angle -= max;
|
|
171
176
|
}
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
position.x += distance * Math.cos(wobble.angle);
|
|
178
|
+
position.y += distance * Math.abs(Math.sin(wobble.angle));
|
|
174
179
|
}
|
|
180
|
+
;// CONCATENATED MODULE: ./dist/browser/WobbleUpdater.js
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
175
184
|
class WobbleUpdater {
|
|
176
185
|
constructor(container) {
|
|
177
186
|
this.container = container;
|
|
178
187
|
}
|
|
179
188
|
init(particle) {
|
|
180
|
-
var _a;
|
|
181
189
|
const wobbleOpt = particle.options.wobble;
|
|
182
|
-
if (wobbleOpt
|
|
190
|
+
if (wobbleOpt?.enable) {
|
|
183
191
|
particle.wobble = {
|
|
184
192
|
angle: (0,engine_root_window_.getRandom)() * Math.PI * 2,
|
|
185
193
|
angleSpeed: (0,engine_root_window_.getRangeValue)(wobbleOpt.speed.angle) / 360,
|
|
@@ -192,18 +200,17 @@ class WobbleUpdater {
|
|
|
192
200
|
moveSpeed: 0
|
|
193
201
|
};
|
|
194
202
|
}
|
|
195
|
-
particle.retina.wobbleDistance = (0,engine_root_window_.getRangeValue)(
|
|
203
|
+
particle.retina.wobbleDistance = (0,engine_root_window_.getRangeValue)(wobbleOpt?.distance ?? 0) * this.container.retina.pixelRatio;
|
|
196
204
|
}
|
|
197
205
|
isEnabled(particle) {
|
|
198
|
-
|
|
199
|
-
return !particle.destroyed && !particle.spawning && !!((_a = particle.options.wobble) === null || _a === void 0 ? void 0 : _a.enable);
|
|
206
|
+
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
200
207
|
}
|
|
201
208
|
loadOptions(options, ...sources) {
|
|
202
209
|
if (!options.wobble) {
|
|
203
210
|
options.wobble = new Wobble();
|
|
204
211
|
}
|
|
205
212
|
for (const source of sources) {
|
|
206
|
-
options.wobble.load(source
|
|
213
|
+
options.wobble.load(source?.wobble);
|
|
207
214
|
}
|
|
208
215
|
}
|
|
209
216
|
update(particle, delta) {
|
|
@@ -215,8 +222,8 @@ class WobbleUpdater {
|
|
|
215
222
|
}
|
|
216
223
|
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
217
224
|
|
|
218
|
-
async function loadWobbleUpdater(engine) {
|
|
219
|
-
await engine.addParticleUpdater("wobble", container => new WobbleUpdater(container));
|
|
225
|
+
async function loadWobbleUpdater(engine, refresh = true) {
|
|
226
|
+
await engine.addParticleUpdater("wobble", container => new WobbleUpdater(container), refresh);
|
|
220
227
|
}
|
|
221
228
|
})();
|
|
222
229
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.updater.wobble.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(e=>(()=>{"use strict";var t={533:t=>{t.exports=e}},o={};function n(e){var a=o[e];if(void 0!==a)return a.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{n.r(a),n.d(a,{loadWobbleUpdater:()=>i});var e=n(533);class t{constructor(){this.angle=50,this.move=10}load(t){t&&(void 0!==t.angle&&(this.angle=(0,e.setRangeValue)(t.angle)),void 0!==t.move&&(this.move=(0,e.setRangeValue)(t.move)))}}class o{constructor(){this.distance=5,this.enable=!1,this.speed=new t}load(t){if(t&&(void 0!==t.distance&&(this.distance=(0,e.setRangeValue)(t.distance)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed))if((0,e.isNumber)(t.speed))this.speed.load({angle:t.speed});else{const e=t.speed;void 0!==e.min?this.speed.load({angle:e}):this.speed.load(t.speed)}}}class s{constructor(e){this.container=e}init(t){const o=t.options.wobble;t.wobble=o?.enable?{angle:(0,e.getRandom)()*Math.PI*2,angleSpeed:(0,e.getRangeValue)(o.speed.angle)/360,moveSpeed:(0,e.getRangeValue)(o.speed.move)/10}:{angle:0,angleSpeed:0,moveSpeed:0},t.retina.wobbleDistance=(0,e.getRangeValue)(o?.distance??0)*this.container.retina.pixelRatio}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.options.wobble?.enable}loadOptions(e,...t){e.wobble||(e.wobble=new o);for(const o of t)e.wobble.load(o?.wobble)}update(e,t){this.isEnabled(e)&&function(e,t){const{wobble:o}=e.options,{wobble:n}=e;if(!o?.enable||!n)return;const a=n.angleSpeed*t.factor,s=n.moveSpeed*t.factor*((e.retina.wobbleDistance??0)*t.factor)/(1e3/60),i=2*Math.PI,{position:l}=e;n.angle+=a,n.angle>i&&(n.angle-=i),l.x+=s*Math.cos(n.angle),l.y+=s*Math.abs(Math.sin(n.angle))}(e,t)}}async function i(e,t=!0){await e.addParticleUpdater("wobble",(e=>new s(e)),t)}})(),a})()));
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.0.0-alpha.0
|
|
8
|
-
*/
|
|
1
|
+
/*! tsParticles Wobble Updater v3.0.0-beta.0 by Matteo Bruni */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RangeValue, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IWobble } from "../Interfaces/IWobble";
|
|
3
3
|
import { WobbleSpeed } from "./WobbleSpeed";
|
|
4
4
|
export declare class Wobble implements IWobble, IOptionLoader<IWobble> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IOptionLoader, type RangeValue, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IWobbleSpeed } from "../Interfaces/IWobbleSpeed";
|
|
3
3
|
export declare class WobbleSpeed implements IWobbleSpeed, IOptionLoader<IWobbleSpeed> {
|
|
4
4
|
angle: RangeValue;
|
package/types/Types.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IParticlesOptions, Particle, ParticlesOptions } from "@tsparticles/engine";
|
|
2
|
+
import type { IWobble } from "./Options/Interfaces/IWobble";
|
|
3
|
+
import type { Wobble } from "./Options/Classes/Wobble";
|
|
4
|
+
interface IParticleWobble {
|
|
5
|
+
angle: number;
|
|
6
|
+
angleSpeed: number;
|
|
7
|
+
moveSpeed: number;
|
|
8
|
+
}
|
|
9
|
+
export type WobbleParticle = Particle & {
|
|
10
|
+
options: WobbleParticlesOptions;
|
|
11
|
+
retina: {
|
|
12
|
+
wobbleDistance?: number;
|
|
13
|
+
};
|
|
14
|
+
wobble?: IParticleWobble;
|
|
15
|
+
};
|
|
16
|
+
export type IWobbleParticlesOptions = IParticlesOptions & {
|
|
17
|
+
wobble?: IWobble;
|
|
18
|
+
};
|
|
19
|
+
export type WobbleParticlesOptions = ParticlesOptions & {
|
|
20
|
+
wobble?: Wobble;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
package/types/Utils.d.ts
ADDED
package/types/WobbleUpdater.d.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
import { Wobble } from "./Options/Classes/Wobble";
|
|
4
|
-
interface IParticleWobble {
|
|
5
|
-
angle: number;
|
|
6
|
-
angleSpeed: number;
|
|
7
|
-
moveSpeed: number;
|
|
8
|
-
}
|
|
9
|
-
type WobbleParticle = Particle & {
|
|
10
|
-
options: WobbleParticlesOptions;
|
|
11
|
-
retina: {
|
|
12
|
-
wobbleDistance?: number;
|
|
13
|
-
};
|
|
14
|
-
wobble?: IParticleWobble;
|
|
15
|
-
};
|
|
16
|
-
type IWobbleParticlesOptions = IParticlesOptions & {
|
|
17
|
-
wobble?: IWobble;
|
|
18
|
-
};
|
|
19
|
-
type WobbleParticlesOptions = ParticlesOptions & {
|
|
20
|
-
wobble?: Wobble;
|
|
21
|
-
};
|
|
1
|
+
import { type Container, type IDelta, type IParticleUpdater, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { IWobbleParticlesOptions, WobbleParticle, WobbleParticlesOptions } from "./Types";
|
|
22
3
|
export declare class WobbleUpdater implements IParticleUpdater {
|
|
23
4
|
private readonly container;
|
|
24
5
|
constructor(container: Container);
|
|
@@ -27,4 +8,3 @@ export declare class WobbleUpdater implements IParticleUpdater {
|
|
|
27
8
|
loadOptions(options: WobbleParticlesOptions, ...sources: (RecursivePartial<IWobbleParticlesOptions> | undefined)[]): void;
|
|
28
9
|
update(particle: WobbleParticle, delta: IDelta): void;
|
|
29
10
|
}
|
|
30
|
-
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadWobbleUpdater(engine: Engine): Promise<void>;
|
|
2
|
+
export declare function loadWobbleUpdater(engine: Engine, refresh?: boolean): Promise<void>;
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./WobbleSpeed"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Wobble = void 0;
|
|
13
|
-
const WobbleSpeed_1 = require("./WobbleSpeed");
|
|
14
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
+
const WobbleSpeed_1 = require("./WobbleSpeed");
|
|
15
15
|
class Wobble {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.distance = 5;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
this.enable = data.enable;
|
|
30
30
|
}
|
|
31
31
|
if (data.speed !== undefined) {
|
|
32
|
-
if (
|
|
32
|
+
if ((0, engine_1.isNumber)(data.speed)) {
|
|
33
33
|
this.speed.load({ angle: data.speed });
|
|
34
34
|
}
|
|
35
35
|
else {
|
package/umd/Types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
package/umd/Utils.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.updateWobble = void 0;
|
|
13
|
+
function updateWobble(particle, delta) {
|
|
14
|
+
const { wobble: wobbleOptions } = particle.options, { wobble } = particle;
|
|
15
|
+
if (!wobbleOptions?.enable || !wobble) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const angleSpeed = wobble.angleSpeed * delta.factor, moveSpeed = wobble.moveSpeed * delta.factor, distance = (moveSpeed * ((particle.retina.wobbleDistance ?? 0) * delta.factor)) / (1000 / 60), max = 2 * Math.PI, { position } = particle;
|
|
19
|
+
wobble.angle += angleSpeed;
|
|
20
|
+
if (wobble.angle > max) {
|
|
21
|
+
wobble.angle -= max;
|
|
22
|
+
}
|
|
23
|
+
position.x += distance * Math.cos(wobble.angle);
|
|
24
|
+
position.y += distance * Math.abs(Math.sin(wobble.angle));
|
|
25
|
+
}
|
|
26
|
+
exports.updateWobble = updateWobble;
|
|
27
|
+
});
|
package/umd/WobbleUpdater.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Wobble"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Wobble", "./Utils"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
@@ -12,28 +12,14 @@
|
|
|
12
12
|
exports.WobbleUpdater = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Wobble_1 = require("./Options/Classes/Wobble");
|
|
15
|
-
|
|
16
|
-
var _a;
|
|
17
|
-
const wobble = particle.options.wobble;
|
|
18
|
-
if (!(wobble === null || wobble === void 0 ? void 0 : wobble.enable) || !particle.wobble) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const angleSpeed = particle.wobble.angleSpeed * delta.factor, moveSpeed = particle.wobble.moveSpeed * delta.factor, distance = (moveSpeed * (((_a = particle.retina.wobbleDistance) !== null && _a !== void 0 ? _a : 0) * delta.factor)) / (1000 / 60), max = 2 * Math.PI;
|
|
22
|
-
particle.wobble.angle += angleSpeed;
|
|
23
|
-
if (particle.wobble.angle > max) {
|
|
24
|
-
particle.wobble.angle -= max;
|
|
25
|
-
}
|
|
26
|
-
particle.position.x += distance * Math.cos(particle.wobble.angle);
|
|
27
|
-
particle.position.y += distance * Math.abs(Math.sin(particle.wobble.angle));
|
|
28
|
-
}
|
|
15
|
+
const Utils_1 = require("./Utils");
|
|
29
16
|
class WobbleUpdater {
|
|
30
17
|
constructor(container) {
|
|
31
18
|
this.container = container;
|
|
32
19
|
}
|
|
33
20
|
init(particle) {
|
|
34
|
-
var _a;
|
|
35
21
|
const wobbleOpt = particle.options.wobble;
|
|
36
|
-
if (wobbleOpt
|
|
22
|
+
if (wobbleOpt?.enable) {
|
|
37
23
|
particle.wobble = {
|
|
38
24
|
angle: (0, engine_1.getRandom)() * Math.PI * 2,
|
|
39
25
|
angleSpeed: (0, engine_1.getRangeValue)(wobbleOpt.speed.angle) / 360,
|
|
@@ -47,25 +33,24 @@
|
|
|
47
33
|
moveSpeed: 0,
|
|
48
34
|
};
|
|
49
35
|
}
|
|
50
|
-
particle.retina.wobbleDistance = (0, engine_1.getRangeValue)(
|
|
36
|
+
particle.retina.wobbleDistance = (0, engine_1.getRangeValue)(wobbleOpt?.distance ?? 0) * this.container.retina.pixelRatio;
|
|
51
37
|
}
|
|
52
38
|
isEnabled(particle) {
|
|
53
|
-
|
|
54
|
-
return !particle.destroyed && !particle.spawning && !!((_a = particle.options.wobble) === null || _a === void 0 ? void 0 : _a.enable);
|
|
39
|
+
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
55
40
|
}
|
|
56
41
|
loadOptions(options, ...sources) {
|
|
57
42
|
if (!options.wobble) {
|
|
58
43
|
options.wobble = new Wobble_1.Wobble();
|
|
59
44
|
}
|
|
60
45
|
for (const source of sources) {
|
|
61
|
-
options.wobble.load(source
|
|
46
|
+
options.wobble.load(source?.wobble);
|
|
62
47
|
}
|
|
63
48
|
}
|
|
64
49
|
update(particle, delta) {
|
|
65
50
|
if (!this.isEnabled(particle)) {
|
|
66
51
|
return;
|
|
67
52
|
}
|
|
68
|
-
updateWobble(particle, delta);
|
|
53
|
+
(0, Utils_1.updateWobble)(particle, delta);
|
|
69
54
|
}
|
|
70
55
|
}
|
|
71
56
|
exports.WobbleUpdater = WobbleUpdater;
|
package/umd/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.loadWobbleUpdater = void 0;
|
|
13
13
|
const WobbleUpdater_1 = require("./WobbleUpdater");
|
|
14
|
-
async function loadWobbleUpdater(engine) {
|
|
15
|
-
await engine.addParticleUpdater("wobble", (container) => new WobbleUpdater_1.WobbleUpdater(container));
|
|
14
|
+
async function loadWobbleUpdater(engine, refresh = true) {
|
|
15
|
+
await engine.addParticleUpdater("wobble", (container) => new WobbleUpdater_1.WobbleUpdater(container), refresh);
|
|
16
16
|
}
|
|
17
17
|
exports.loadWobbleUpdater = loadWobbleUpdater;
|
|
18
18
|
});
|