three-nebula 11.1.0 → 11.1.1
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/dist/three-nebula.mjs
CHANGED
|
@@ -15,7 +15,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
15
15
|
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
16
|
value: n,
|
|
17
17
|
enumerable: !0
|
|
18
|
-
}) : a, n)), u = "Behaviour", d = "Alpha", f = "Attraction", p = "Collision", m = "Color", h = "CrossZone", g = "Force", _ = "Gravity", v = "RandomDrift", y = "Repulsion", b = "Rotate", x = "Scale", S = "Spring", C = "Initializer", w = "Body", T = "BodySprite", E = "Texture", D = "Life", O = "Mass", k = "Position", A = "Rotation", j = "Radius", M = "VectorVelocity", N = "PolarVelocity",
|
|
18
|
+
}) : a, n)), u = "Behaviour", d = "Alpha", f = "Attraction", p = "Collision", m = "Color", h = "CrossZone", g = "Force", _ = "Gravity", v = "RandomDrift", y = "Repulsion", b = "Rotate", x = "Scale", S = "Spring", C = "Initializer", w = "Body", T = "BodySprite", E = "Texture", D = "Life", O = "Mass", k = "Position", A = "Rotation", j = "Radius", M = "VectorVelocity", N = "PolarVelocity", ee = "RadialVelocity", te = "Rate", P = [T, E], ne = "Zone", re = "BoxZone", ie = "LineZone", ae = "MeshZone", oe = "PointZone", se = "ScreenZone", ce = "SphereZone", le = "BaseRenderer", ue = "CustomRenderer", de = "SpriteRenderer", fe = "MeshRenderer", pe = "GPURenderer", me = "MobileGPURenderer", he = "DesktopGPURenderer", F = 3.142, I = F / 180, ge = "euler", _e = () => !(!process || !process.env || !process.env.NODE_ENV || process.env.NODE_ENV !== "development"), L = {
|
|
19
19
|
easeLinear: function(e) {
|
|
20
20
|
return e;
|
|
21
21
|
},
|
|
@@ -47,13 +47,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
47
47
|
return (e /= .5) < 1 ? .5 * e ** 4 : -.5 * ((e -= 2) * e ** 3 - 2);
|
|
48
48
|
},
|
|
49
49
|
easeInSine: function(e) {
|
|
50
|
-
return -Math.cos(
|
|
50
|
+
return -Math.cos(F / 2 * e) + 1;
|
|
51
51
|
},
|
|
52
52
|
easeOutSine: function(e) {
|
|
53
|
-
return Math.sin(
|
|
53
|
+
return Math.sin(F / 2 * e);
|
|
54
54
|
},
|
|
55
55
|
easeInOutSine: function(e) {
|
|
56
|
-
return -.5 * (Math.cos(
|
|
56
|
+
return -.5 * (Math.cos(F * e) - 1);
|
|
57
57
|
},
|
|
58
58
|
easeInExpo: function(e) {
|
|
59
59
|
return e === 0 ? 0 : 2 ** (10 * (e - 1));
|
|
@@ -85,7 +85,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
85
85
|
var t = 1.70158;
|
|
86
86
|
return (e /= .5) < 1 ? .5 * (e * e * (((t *= 1.525) + 1) * e - t)) : .5 * ((e -= 2) * e * (((t *= 1.525) + 1) * e + t) + 2);
|
|
87
87
|
}
|
|
88
|
-
}, { easeLinear:
|
|
88
|
+
}, { easeLinear: ve, easeInQuad: ye, easeOutQuad: be, easeInOutQuad: xe, easeInCubic: Se, easeOutCubic: Ce, easeInOutCubic: we, easeInQuart: Te, easeOutQuart: Ee, easeInOutQuart: De, easeInSine: Oe, easeOutSine: ke, easeInOutSine: Ae, easeInExpo: je, easeOutExpo: Me, easeInOutExpo: Ne, easeInCirc: Pe, easeOutCirc: Fe, easeInOutCirc: Ie, easeInBack: Le, easeOutBack: Re, easeInOutBack: ze } = L, Be = (e) => L[e] ? L[e] : L.easeLinear, R = (e) => L[e] ? L[e] : L.easeLinear, Ve = Infinity, He = ve, Ue = .0167, We = [
|
|
89
89
|
k,
|
|
90
90
|
A,
|
|
91
91
|
D,
|
|
@@ -95,9 +95,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
95
95
|
T,
|
|
96
96
|
E,
|
|
97
97
|
N,
|
|
98
|
-
|
|
98
|
+
ee,
|
|
99
99
|
M
|
|
100
|
-
],
|
|
100
|
+
], Ge = [
|
|
101
101
|
d,
|
|
102
102
|
f,
|
|
103
103
|
m,
|
|
@@ -109,13 +109,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
109
109
|
b,
|
|
110
110
|
x,
|
|
111
111
|
S
|
|
112
|
-
],
|
|
113
|
-
ne,
|
|
112
|
+
], Ke = [
|
|
114
113
|
re,
|
|
115
114
|
ie,
|
|
116
115
|
ae,
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
oe,
|
|
117
|
+
ce
|
|
118
|
+
], qe = { getRGB: function(e) {
|
|
119
119
|
var t = {};
|
|
120
120
|
if (typeof e == "number") r = Math.floor(e), t.r = (e >> 16 & 255) / 255, t.g = (e >> 8 & 255) / 255, t.b = (e & 255) / 255;
|
|
121
121
|
else if (typeof e == "string") {
|
|
@@ -127,7 +127,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
127
127
|
}
|
|
128
128
|
} else t.r = e.r, t.g = e.g, t.b = e.b;
|
|
129
129
|
return t;
|
|
130
|
-
} },
|
|
130
|
+
} }, Je = {
|
|
131
131
|
_id: 0,
|
|
132
132
|
_uids: /* @__PURE__ */ new Map(),
|
|
133
133
|
getNewId: function() {
|
|
@@ -138,7 +138,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
138
138
|
let t = this.getNewId();
|
|
139
139
|
return this._uids.set(e, t), t;
|
|
140
140
|
}
|
|
141
|
-
},
|
|
141
|
+
}, Ye = {
|
|
142
142
|
DEG2RAD: Math.PI / 180,
|
|
143
143
|
RAD2DEG: 180 / Math.PI,
|
|
144
144
|
generateUUID: (function() {
|
|
@@ -176,10 +176,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
176
176
|
return e * (.5 - Math.random());
|
|
177
177
|
},
|
|
178
178
|
degToRad: function(e) {
|
|
179
|
-
return e *
|
|
179
|
+
return e * Ye.DEG2RAD;
|
|
180
180
|
},
|
|
181
181
|
radToDeg: function(e) {
|
|
182
|
-
return e *
|
|
182
|
+
return e * Ye.RAD2DEG;
|
|
183
183
|
},
|
|
184
184
|
isPowerOfTwo: function(e) {
|
|
185
185
|
return (e & e - 1) == 0 && e !== 0;
|
|
@@ -193,10 +193,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
193
193
|
};
|
|
194
194
|
//#endregion
|
|
195
195
|
//#region src/core/three/Quaternion.js
|
|
196
|
-
function
|
|
196
|
+
function z(e, t, n, r) {
|
|
197
197
|
this._x = e || 0, this._y = t || 0, this._z = n || 0, this._w = r === void 0 ? 1 : r;
|
|
198
198
|
}
|
|
199
|
-
Object.assign(
|
|
199
|
+
Object.assign(z, {
|
|
200
200
|
slerp: function(e, t, n, r) {
|
|
201
201
|
return n.copy(e).slerp(t, r);
|
|
202
202
|
},
|
|
@@ -216,7 +216,7 @@ Object.assign(Ye, {
|
|
|
216
216
|
}
|
|
217
217
|
e[t] = s, e[t + 1] = c, e[t + 2] = l, e[t + 3] = u;
|
|
218
218
|
}
|
|
219
|
-
}), Object.defineProperties(
|
|
219
|
+
}), Object.defineProperties(z.prototype, {
|
|
220
220
|
x: {
|
|
221
221
|
get: function() {
|
|
222
222
|
return this._x;
|
|
@@ -249,7 +249,7 @@ Object.assign(Ye, {
|
|
|
249
249
|
this._w = e, this._onChangeCallback();
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
}), Object.assign(
|
|
252
|
+
}), Object.assign(z.prototype, {
|
|
253
253
|
isQuaternion: !0,
|
|
254
254
|
set: function(e, t, n, r) {
|
|
255
255
|
return this._x = e, this._y = t, this._z = n, this._w = r, this._onChangeCallback(), this;
|
|
@@ -278,7 +278,7 @@ Object.assign(Ye, {
|
|
|
278
278
|
return r < n ? (r = 0, Math.abs(e.x) > Math.abs(e.z) ? (this._x = -e.y, this._y = e.x, this._z = 0, this._w = r) : (this._x = 0, this._y = -e.z, this._z = e.y, this._w = r)) : (this._x = e.y * t.z - e.z * t.y, this._y = e.z * t.x - e.x * t.z, this._z = e.x * t.y - e.y * t.x, this._w = r), this.normalize();
|
|
279
279
|
},
|
|
280
280
|
angleTo: function(e) {
|
|
281
|
-
return 2 * Math.acos(Math.abs(
|
|
281
|
+
return 2 * Math.acos(Math.abs(Ye.clamp(this.dot(e), -1, 1)));
|
|
282
282
|
},
|
|
283
283
|
rotateTowards: function(e, t) {
|
|
284
284
|
var n = this.angleTo(e);
|
|
@@ -424,13 +424,13 @@ Object.assign(B.prototype, {
|
|
|
424
424
|
return this.x = e.x * t.x, this.y = e.y * t.y, this.z = e.z * t.z, this;
|
|
425
425
|
},
|
|
426
426
|
applyEuler: function() {
|
|
427
|
-
var e = new
|
|
427
|
+
var e = new z();
|
|
428
428
|
return function(t) {
|
|
429
429
|
return t && t.isEuler || console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."), this.applyQuaternion(e.setFromEuler(t));
|
|
430
430
|
};
|
|
431
431
|
}(),
|
|
432
432
|
applyAxisAngle: function() {
|
|
433
|
-
var e = new
|
|
433
|
+
var e = new z();
|
|
434
434
|
return function(t, n) {
|
|
435
435
|
return this.applyQuaternion(e.setFromAxisAngle(t, n));
|
|
436
436
|
};
|
|
@@ -543,7 +543,7 @@ Object.assign(B.prototype, {
|
|
|
543
543
|
}(),
|
|
544
544
|
angleTo: function(e) {
|
|
545
545
|
var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
|
|
546
|
-
return Math.acos(
|
|
546
|
+
return Math.acos(Ye.clamp(t, -1, 1));
|
|
547
547
|
},
|
|
548
548
|
distanceTo: function(e) {
|
|
549
549
|
return Math.sqrt(this.distanceToSquared(e));
|
|
@@ -691,8 +691,8 @@ Object.assign(Xe.prototype, {
|
|
|
691
691
|
return this.multiplyMatrices(e, this);
|
|
692
692
|
},
|
|
693
693
|
multiplyMatrices: function(e, t) {
|
|
694
|
-
var n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3],
|
|
695
|
-
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c *
|
|
694
|
+
var n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], ee = r[7], te = r[11], P = r[15];
|
|
695
|
+
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * ee, i[8] = a * C + o * D + s * j + c * te, i[12] = a * w + o * O + s * M + c * P, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * ee, i[9] = l * C + u * D + d * j + f * te, i[13] = l * w + u * O + d * M + f * P, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * ee, i[10] = p * C + m * D + h * j + g * te, i[14] = p * w + m * O + h * M + g * P, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * ee, i[11] = _ * C + v * D + y * j + b * te, i[15] = _ * w + v * O + y * M + b * P, this;
|
|
696
696
|
},
|
|
697
697
|
multiplyScalar: function(e) {
|
|
698
698
|
var t = this.elements;
|
|
@@ -854,7 +854,7 @@ V.RotationOrders = [
|
|
|
854
854
|
return this._x = e._x, this._y = e._y, this._z = e._z, this._order = e._order, this._onChangeCallback(), this;
|
|
855
855
|
},
|
|
856
856
|
setFromRotationMatrix: function(e, t, n) {
|
|
857
|
-
var r =
|
|
857
|
+
var r = Ye.clamp, i = e.elements, a = i[0], o = i[4], s = i[8], c = i[1], l = i[5], u = i[9], d = i[2], f = i[6], p = i[10];
|
|
858
858
|
return t = t || this._order, t === "XYZ" ? (this._y = Math.asin(r(s, -1, 1)), Math.abs(s) < .99999 ? (this._x = Math.atan2(-u, p), this._z = Math.atan2(-o, a)) : (this._x = Math.atan2(f, l), this._z = 0)) : t === "YXZ" ? (this._x = Math.asin(-r(u, -1, 1)), Math.abs(u) < .99999 ? (this._y = Math.atan2(s, p), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-d, a), this._z = 0)) : t === "ZXY" ? (this._x = Math.asin(r(f, -1, 1)), Math.abs(f) < .99999 ? (this._y = Math.atan2(-d, p), this._z = Math.atan2(-o, l)) : (this._y = 0, this._z = Math.atan2(c, a))) : t === "ZYX" ? (this._y = Math.asin(-r(d, -1, 1)), Math.abs(d) < .99999 ? (this._x = Math.atan2(f, p), this._z = Math.atan2(c, a)) : (this._x = 0, this._z = Math.atan2(-o, l))) : t === "YZX" ? (this._z = Math.asin(r(c, -1, 1)), Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, l), this._y = Math.atan2(-d, a)) : (this._x = 0, this._y = Math.atan2(s, p))) : t === "XZY" ? (this._z = Math.asin(-r(o, -1, 1)), Math.abs(o) < .99999 ? (this._x = Math.atan2(f, l), this._y = Math.atan2(s, a)) : (this._x = Math.atan2(-u, p), this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t), this._order = t, n !== !1 && this._onChangeCallback(), this;
|
|
859
859
|
},
|
|
860
860
|
setFromQuaternion: function() {
|
|
@@ -867,7 +867,7 @@ V.RotationOrders = [
|
|
|
867
867
|
return this.set(e.x, e.y, e.z, t || this._order);
|
|
868
868
|
},
|
|
869
869
|
reorder: function() {
|
|
870
|
-
var e = new
|
|
870
|
+
var e = new z();
|
|
871
871
|
return function(t) {
|
|
872
872
|
return e.setFromEuler(this), this.setFromQuaternion(e, t);
|
|
873
873
|
};
|
|
@@ -991,7 +991,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
991
991
|
},
|
|
992
992
|
randomZone: function(e) {},
|
|
993
993
|
degreeTransform: function(e) {
|
|
994
|
-
return e *
|
|
994
|
+
return e * F / 180;
|
|
995
995
|
},
|
|
996
996
|
toColor16: function(e) {
|
|
997
997
|
return "#" + e.toString(16);
|
|
@@ -1312,17 +1312,17 @@ var at = nt, ot = (e, t) => ({
|
|
|
1312
1312
|
}
|
|
1313
1313
|
}, an = "Particle", on = "Pool", sn = "System", cn = class {
|
|
1314
1314
|
constructor(e) {
|
|
1315
|
-
this.id = `particle-${at()}`, this.type = an, this.life =
|
|
1315
|
+
this.id = `particle-${at()}`, this.type = an, this.life = Ve, this.age = 0, this.energy = 1, this.dead = !1, this.sleep = !1, this.body = null, this.parent = null, this.mass = 1, this.radius = 10, this.alpha = 1, this.scale = 1, this.useColor = !1, this.useAlpha = !1, this.easing = He, this.position = new J(), this.velocity = new J(), this.acceleration = new J(), this.old = {}, this.old.position = this.position.clone(), this.old.velocity = this.velocity.clone(), this.old.acceleration = this.acceleration.clone(), this.behaviours = [], this.transform = {}, this.color = {
|
|
1316
1316
|
r: 0,
|
|
1317
1317
|
g: 0,
|
|
1318
1318
|
b: 0
|
|
1319
1319
|
}, this.rotation = new J(), this.distanceToCamera = 0, U.setPrototypeByObj(this, e);
|
|
1320
1320
|
}
|
|
1321
1321
|
getDirection() {
|
|
1322
|
-
return Math.atan2(this.velocity.x, -this.velocity.y) * (180 /
|
|
1322
|
+
return Math.atan2(this.velocity.x, -this.velocity.y) * (180 / F);
|
|
1323
1323
|
}
|
|
1324
1324
|
reset() {
|
|
1325
|
-
return this.life =
|
|
1325
|
+
return this.life = Ve, this.age = 0, this.energy = 1, this.dead = !1, this.sleep = !1, this.body = null, this.parent = null, this.mass = 1, this.radius = 10, this.alpha = 1, this.scale = 1, this.useColor = !1, this.useAlpha = !1, this.easing = He, this.position.set(0, 0, 0), this.velocity.set(0, 0, 0), this.acceleration.set(0, 0, 0), this.old.position.set(0, 0, 0), this.old.velocity.set(0, 0, 0), this.old.acceleration.set(0, 0, 0), this.color.r = 0, this.color.g = 0, this.color.b = 0, this.rotation.clear(), U.destroyObject(this.transform), this.removeAllBehaviours(), this;
|
|
1326
1326
|
}
|
|
1327
1327
|
update(e, t) {
|
|
1328
1328
|
if (!this.sleep) {
|
|
@@ -1377,7 +1377,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1377
1377
|
return e++;
|
|
1378
1378
|
}
|
|
1379
1379
|
get(e, ...t) {
|
|
1380
|
-
var n, r = e.__puid ||
|
|
1380
|
+
var n, r = e.__puid || Je.id(e);
|
|
1381
1381
|
return n = this.list[r] && this.list[r].length > 0 ? this.list[r].pop() : this.create(e, ...t), n.__puid = e.__puid || r, n;
|
|
1382
1382
|
}
|
|
1383
1383
|
expire(e) {
|
|
@@ -1530,7 +1530,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1530
1530
|
return new e(n, r, i, a);
|
|
1531
1531
|
}
|
|
1532
1532
|
}, On = class {
|
|
1533
|
-
constructor(e =
|
|
1533
|
+
constructor(e = ne) {
|
|
1534
1534
|
this.type = e, this.vector = new J(0, 0, 0), this.random = 0, this.crossType = "dead", this.log = !0, this.supportsCrossing = !0;
|
|
1535
1535
|
}
|
|
1536
1536
|
getPosition() {
|
|
@@ -1573,7 +1573,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1573
1573
|
_cross(e) {}
|
|
1574
1574
|
}, kn = class extends On {
|
|
1575
1575
|
constructor(e, t, n, r, i, a) {
|
|
1576
|
-
super(
|
|
1576
|
+
super(re);
|
|
1577
1577
|
var o, s, c, l, u, r;
|
|
1578
1578
|
U.isUndefined(t, n, r, i, a) ? (o = s = c = 0, l = u = r = e || 100) : U.isUndefined(r, i, a) ? (o = s = c = 0, l = e, u = t, r = n) : (o = e, s = t, c = n, l = r, u = i, r = a), this.x = o, this.y = s, this.z = c, this.width = l, this.height = u, this.depth = r, this.friction = .85, this.max = 6;
|
|
1579
1579
|
}
|
|
@@ -1597,7 +1597,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1597
1597
|
}
|
|
1598
1598
|
}, An = class extends On {
|
|
1599
1599
|
constructor(e, t, n, r, i, a) {
|
|
1600
|
-
super(
|
|
1600
|
+
super(ie), e instanceof J ? (this.x1 = e.x, this.y1 = e.y, this.z1 = e.z, this.x2 = r.x, this.y2 = r.y, this.z2 = r.z) : (this.x1 = e, this.y1 = t, this.z1 = n, this.x2 = r, this.y2 = i, this.z2 = a), this.supportsCrossing = !1;
|
|
1601
1601
|
}
|
|
1602
1602
|
isLineZone() {
|
|
1603
1603
|
return !0;
|
|
@@ -1607,7 +1607,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1607
1607
|
}
|
|
1608
1608
|
}, jn = class extends On {
|
|
1609
1609
|
constructor(e, t = 1, n) {
|
|
1610
|
-
if (super(
|
|
1610
|
+
if (super(ae), this.geometry = null, this.scale = t, this.supportsCrossing = !1, e.type && e.type === "Geometry" && (this.geometry = e), e.geometry && (this.geometry = e.geometry), !this.geometry) throw Error("MeshZone unable to set geometry from the supplied bounds");
|
|
1611
1611
|
this.geometry.isBufferGeometry && (this.geometry = new n().fromBufferGeometry(this.geometry));
|
|
1612
1612
|
}
|
|
1613
1613
|
isMeshZone() {
|
|
@@ -1619,7 +1619,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1619
1619
|
}
|
|
1620
1620
|
}, Mn = class extends On {
|
|
1621
1621
|
constructor(e, t, n) {
|
|
1622
|
-
super(
|
|
1622
|
+
super(oe);
|
|
1623
1623
|
var r = U.isUndefined(e, t, n) ? 0 : e;
|
|
1624
1624
|
this.x = r, this.y = r, this.z = r, this.supportsCrossing = !1;
|
|
1625
1625
|
}
|
|
@@ -1631,7 +1631,7 @@ var at = nt, ot = (e, t) => ({
|
|
|
1631
1631
|
}
|
|
1632
1632
|
}, Nn = class extends On {
|
|
1633
1633
|
constructor(e, t, n, r) {
|
|
1634
|
-
super(
|
|
1634
|
+
super(se), this.camera = e, this.renderer = t, this.dis = n || 20, r = r || "1234";
|
|
1635
1635
|
for (var i = 1; i < 5; i++) this["d" + i] = r.indexOf(i + "") >= 0;
|
|
1636
1636
|
}
|
|
1637
1637
|
isScreenZone() {
|
|
@@ -1662,7 +1662,7 @@ Nn.prototype.getPosition = (function() {
|
|
|
1662
1662
|
//#region src/zone/SphereZone.js
|
|
1663
1663
|
var Pn = class extends On {
|
|
1664
1664
|
constructor(e, t, n, r) {
|
|
1665
|
-
super(
|
|
1665
|
+
super(ce);
|
|
1666
1666
|
let i, a;
|
|
1667
1667
|
U.isUndefined(t, n, r) ? (i = 0, a = e || 100) : (i = e, a = r), this.x = i, this.y = i, this.z = i, this.radius = a, this.the = this.phi = 0;
|
|
1668
1668
|
}
|
|
@@ -1679,7 +1679,7 @@ var Pn = class extends On {
|
|
|
1679
1679
|
Pn.prototype.getPosition = (function() {
|
|
1680
1680
|
var e, t, n;
|
|
1681
1681
|
return function() {
|
|
1682
|
-
return this.random = Math.random(), n = this.random * this.radius, e =
|
|
1682
|
+
return this.random = Math.random(), n = this.random * this.radius, e = F * Math.random(), t = F * 2 * Math.random(), this.vector.x = this.x + n * Math.sin(e) * Math.cos(t), this.vector.y = this.y + n * Math.sin(t) * Math.sin(e), this.vector.z = this.z + n * Math.cos(e), this.vector;
|
|
1683
1683
|
};
|
|
1684
1684
|
})(), Pn.prototype._bound = (function() {
|
|
1685
1685
|
var e = new J(), t = new J(), n;
|
|
@@ -1708,7 +1708,7 @@ var Fn = /* @__PURE__ */ s({
|
|
|
1708
1708
|
}
|
|
1709
1709
|
static fromJSON(t) {
|
|
1710
1710
|
let { zoneType: n, ...r } = t;
|
|
1711
|
-
if (!
|
|
1711
|
+
if (!Ke.includes(n)) throw Error(`The zone type ${n} is invalid or not yet supported`);
|
|
1712
1712
|
return new e(new Fn[n](...Object.values(r)));
|
|
1713
1713
|
}
|
|
1714
1714
|
};
|
|
@@ -1747,7 +1747,7 @@ var Ln = class e extends X {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
}, zn = class e extends X {
|
|
1749
1749
|
constructor(e = 1, t = 1) {
|
|
1750
|
-
super(
|
|
1750
|
+
super(te), this.numPan = q(e), this.timePan = q(t), this.startTime = 0, this.nextTime = 0, this.init();
|
|
1751
1751
|
}
|
|
1752
1752
|
init() {
|
|
1753
1753
|
this.startTime = 0, this.nextTime = this.timePan.getValue();
|
|
@@ -1792,14 +1792,14 @@ var Ln = class e extends X {
|
|
|
1792
1792
|
Vn.prototype.initialize = (function() {
|
|
1793
1793
|
var e, t = new J(0, 0, 1), n = new J(0, 0, 0);
|
|
1794
1794
|
return function(r) {
|
|
1795
|
-
return e = this.tha * Math.random(), this._useV && this.dirVec.copy(this.dir).scalar(this.radiusPan.getValue()), G.getNormal(this.dirVec, t), n.copy(this.dirVec).applyAxisAngle(t, e), n.applyAxisAngle(this.dirVec.normalize(), Math.random() *
|
|
1795
|
+
return e = this.tha * Math.random(), this._useV && this.dirVec.copy(this.dir).scalar(this.radiusPan.getValue()), G.getNormal(this.dirVec, t), n.copy(this.dirVec).applyAxisAngle(t, e), n.applyAxisAngle(this.dirVec.normalize(), Math.random() * F * 2), r.velocity.copy(n), this;
|
|
1796
1796
|
};
|
|
1797
1797
|
})();
|
|
1798
1798
|
//#endregion
|
|
1799
1799
|
//#region src/initializer/Velocity/PolarVelocity.js
|
|
1800
1800
|
var Hn = class e extends Vn {
|
|
1801
1801
|
constructor(e, t, n = !0) {
|
|
1802
|
-
super(N, n), this.tha = t *
|
|
1802
|
+
super(N, n), this.tha = t * I, this.dirVec = e.toVector3D(), this._useV = !1;
|
|
1803
1803
|
}
|
|
1804
1804
|
static fromJSON(t) {
|
|
1805
1805
|
let { polarRadius: n, polarTheta: r, polarPhi: i, velocityTheta: a, isEnabled: o = !0 } = t;
|
|
@@ -1807,7 +1807,7 @@ var Hn = class e extends Vn {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
}, Un = class e extends Vn {
|
|
1809
1809
|
constructor(e, t, n, r = !0) {
|
|
1810
|
-
super(
|
|
1810
|
+
super(ee, r), this.radiusPan = q(e), this.dir = t.clone().normalize(), this.tha = n * I, this._useV = !0;
|
|
1811
1811
|
}
|
|
1812
1812
|
static fromJSON(t) {
|
|
1813
1813
|
let { radius: n, x: r, y: i, z: a, theta: o, isEnabled: s = !0 } = t;
|
|
@@ -1815,7 +1815,7 @@ var Hn = class e extends Vn {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
}, Wn = class e extends Vn {
|
|
1817
1817
|
constructor(e, t, n = !0) {
|
|
1818
|
-
super(M, n), this.radiusPan = q(1), this.dir = e.clone(), this.tha = t *
|
|
1818
|
+
super(M, n), this.radiusPan = q(1), this.dir = e.clone(), this.tha = t * I, this._useV = !0;
|
|
1819
1819
|
}
|
|
1820
1820
|
static fromJSON(t) {
|
|
1821
1821
|
let { x: n, y: r, z: i, theta: a, isEnabled: o = !0 } = t;
|
|
@@ -1986,7 +1986,7 @@ var Hn = class e extends Vn {
|
|
|
1986
1986
|
destroy() {
|
|
1987
1987
|
this.dead = !0, this.energy = 0, this.totalEmitTimes = -1, this.particles.length == 0 && (this.isEmitting = !1, this.removeAllInitializers(), this.removeAllBehaviours(), this.dispatch(`${this.id}_${gn}`), this.parent && this.parent.removeEmitter(this));
|
|
1988
1988
|
}
|
|
1989
|
-
}, Qn = Infinity, $n = 1e3, er =
|
|
1989
|
+
}, Qn = Infinity, $n = 1e3, er = ve, tr = .03, nr = "dead", Z = class {
|
|
1990
1990
|
constructor(e = Infinity, t = er, n = u, r = !0) {
|
|
1991
1991
|
this.type = n, this.isEnabled = r, this.id = `behaviour-${at()}`, this.life = e, this.easing = t, this.age = 0, this.energy = 1, this.dead = !1;
|
|
1992
1992
|
}
|
|
@@ -2042,7 +2042,7 @@ var Hn = class e extends Vn {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
static fromJSON(t) {
|
|
2044
2044
|
let { alphaA: n, alphaB: r, life: i, easing: a, isEnabled: o = !0 } = t;
|
|
2045
|
-
return new e(n, r, i,
|
|
2045
|
+
return new e(n, r, i, R(a), o);
|
|
2046
2046
|
}
|
|
2047
2047
|
}, ir = class e extends Z {
|
|
2048
2048
|
constructor(e = new J(), t = 100, n = $n, r = Qn, i = er, a = !0) {
|
|
@@ -2056,7 +2056,7 @@ var Hn = class e extends Vn {
|
|
|
2056
2056
|
}
|
|
2057
2057
|
static fromJSON(t) {
|
|
2058
2058
|
let { x: n, y: r, z: i, force: a, radius: o, life: s, easing: c, isEnabled: l = !0 } = t;
|
|
2059
|
-
return new e(new J(n, r, i), a, o, s,
|
|
2059
|
+
return new e(new J(n, r, i), a, o, s, R(c), l);
|
|
2060
2060
|
}
|
|
2061
2061
|
}, ar = class extends Z {
|
|
2062
2062
|
constructor(e, t, n, r, i, a = !0) {
|
|
@@ -2087,14 +2087,14 @@ var Hn = class e extends Vn {
|
|
|
2087
2087
|
this.same = t == null, this.colorA = Yt(e), this.colorB = Yt(t), n && super.reset(n, r);
|
|
2088
2088
|
}
|
|
2089
2089
|
initialize(e) {
|
|
2090
|
-
e.transform.colorA =
|
|
2090
|
+
e.transform.colorA = qe.getRGB(this.colorA.getValue()), e.useColor = !0, e.transform.colorB = this.same ? e.transform.colorA : qe.getRGB(this.colorB.getValue());
|
|
2091
2091
|
}
|
|
2092
2092
|
mutate(e, t, n) {
|
|
2093
2093
|
this.energize(e, t, n), this._same ? (e.color.r = e.transform.colorA.r, e.color.g = e.transform.colorA.g, e.color.b = e.transform.colorA.b) : (e.color.r = G.lerp(e.transform.colorA.r, e.transform.colorB.r, this.energy), e.color.g = G.lerp(e.transform.colorA.g, e.transform.colorB.g, this.energy), e.color.b = G.lerp(e.transform.colorA.b, e.transform.colorB.b, this.energy));
|
|
2094
2094
|
}
|
|
2095
2095
|
static fromJSON(t) {
|
|
2096
2096
|
let { colorA: n, colorB: r, life: i, easing: a, isEnabled: o = !0 } = t;
|
|
2097
|
-
return new e(n, r, i,
|
|
2097
|
+
return new e(n, r, i, R(a), o);
|
|
2098
2098
|
}
|
|
2099
2099
|
}, sr = class e extends Z {
|
|
2100
2100
|
constructor(e, t, n, r, i) {
|
|
@@ -2108,7 +2108,7 @@ var Hn = class e extends Vn {
|
|
|
2108
2108
|
}
|
|
2109
2109
|
static fromJSON(t) {
|
|
2110
2110
|
let { zoneType: n, zoneParams: r, crossType: i, life: a, easing: o, isEnabled: s = !0 } = t, c = new Fn[n](...Object.values(r));
|
|
2111
|
-
return new e(c, i, a,
|
|
2111
|
+
return new e(c, i, a, R(o), s);
|
|
2112
2112
|
}
|
|
2113
2113
|
}, cr = class e extends Z {
|
|
2114
2114
|
constructor(e, t, n, r, i, a = !0) {
|
|
@@ -2122,7 +2122,7 @@ var Hn = class e extends Vn {
|
|
|
2122
2122
|
}
|
|
2123
2123
|
static fromJSON(t) {
|
|
2124
2124
|
let { fx: n, fy: r, fz: i, life: a, easing: o, isEnabled: s = !0 } = t;
|
|
2125
|
-
return new e(n, r, i, a,
|
|
2125
|
+
return new e(n, r, i, a, R(o), s);
|
|
2126
2126
|
}
|
|
2127
2127
|
}, lr = class e extends cr {
|
|
2128
2128
|
constructor(e, t, n, r = !0) {
|
|
@@ -2130,7 +2130,7 @@ var Hn = class e extends Vn {
|
|
|
2130
2130
|
}
|
|
2131
2131
|
static fromJSON(t) {
|
|
2132
2132
|
let { gravity: n, life: r, easing: i, isEnabled: a = !0 } = t;
|
|
2133
|
-
return new e(n, r,
|
|
2133
|
+
return new e(n, r, R(i), a);
|
|
2134
2134
|
}
|
|
2135
2135
|
}, ur = class e extends Z {
|
|
2136
2136
|
constructor(e, t, n, r = tr, i, a, o = !0) {
|
|
@@ -2147,7 +2147,7 @@ var Hn = class e extends Vn {
|
|
|
2147
2147
|
}
|
|
2148
2148
|
static fromJSON(t) {
|
|
2149
2149
|
let { x: n, y: r, z: i, delay: a, life: o, easing: s, isEnabled: c = !0 } = t;
|
|
2150
|
-
return new e(n, r, i, a, o,
|
|
2150
|
+
return new e(n, r, i, a, o, R(s), c);
|
|
2151
2151
|
}
|
|
2152
2152
|
}, dr = class e extends ir {
|
|
2153
2153
|
constructor(e, t, n, r, i, a = !0) {
|
|
@@ -2158,7 +2158,7 @@ var Hn = class e extends Vn {
|
|
|
2158
2158
|
}
|
|
2159
2159
|
static fromJSON(t) {
|
|
2160
2160
|
let { x: n, y: r, z: i, force: a, radius: o, life: s, easing: c, isEnabled: l = !0 } = t;
|
|
2161
|
-
return new e(new J(n, r, i), a, o, s,
|
|
2161
|
+
return new e(new J(n, r, i), a, o, s, R(c), l);
|
|
2162
2162
|
}
|
|
2163
2163
|
}, fr = class e extends Z {
|
|
2164
2164
|
constructor(e, t, n, r, i, a = !0) {
|
|
@@ -2171,7 +2171,7 @@ var Hn = class e extends Vn {
|
|
|
2171
2171
|
this._rotationType = e;
|
|
2172
2172
|
}
|
|
2173
2173
|
reset(e, t, n, r, i) {
|
|
2174
|
-
this.x = e || 0, this.y = t || 0, this.z = n || 0, e === void 0 || e == "same" ? this.rotationType = "same" : t == null ? this.rotationType = "set" : n === void 0 ? this.rotationType = "to" : (this.rotationType = "add", this.x = q(this.x *
|
|
2174
|
+
this.x = e || 0, this.y = t || 0, this.z = n || 0, e === void 0 || e == "same" ? this.rotationType = "same" : t == null ? this.rotationType = "set" : n === void 0 ? this.rotationType = "to" : (this.rotationType = "add", this.x = q(this.x * I), this.y = q(this.y * I), this.z = q(this.z * I)), r && super.reset(r, i);
|
|
2175
2175
|
}
|
|
2176
2176
|
initialize(e) {
|
|
2177
2177
|
switch (this.rotationType) {
|
|
@@ -2189,7 +2189,7 @@ var Hn = class e extends Vn {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
_setRotation(e, t) {
|
|
2191
2191
|
if (e = e || new J(), t == "random") {
|
|
2192
|
-
var n = G.randomAToB(-
|
|
2192
|
+
var n = G.randomAToB(-F, F), r = G.randomAToB(-F, F), i = G.randomAToB(-F, F);
|
|
2193
2193
|
e.set(n, r, i);
|
|
2194
2194
|
} else t instanceof J && e.copy(t);
|
|
2195
2195
|
}
|
|
@@ -2209,7 +2209,7 @@ var Hn = class e extends Vn {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
static fromJSON(t) {
|
|
2211
2211
|
let { x: n, y: r, z: i, life: a, easing: o, isEnabled: s = !0 } = t;
|
|
2212
|
-
return new e(n, r, i, a,
|
|
2212
|
+
return new e(n, r, i, a, R(o), s);
|
|
2213
2213
|
}
|
|
2214
2214
|
}, pr = class e extends Z {
|
|
2215
2215
|
constructor(e, t, n, r, i = !0) {
|
|
@@ -2232,7 +2232,7 @@ var Hn = class e extends Vn {
|
|
|
2232
2232
|
}
|
|
2233
2233
|
static fromJSON(t) {
|
|
2234
2234
|
let { scaleA: n, scaleB: r, life: i, easing: a, isEnabled: o = !0 } = t;
|
|
2235
|
-
return new e(n, r, i,
|
|
2235
|
+
return new e(n, r, i, R(a), o);
|
|
2236
2236
|
}
|
|
2237
2237
|
}, mr = class e extends Z {
|
|
2238
2238
|
constructor(e, t, n, r, i, a, o, s = !0) {
|
|
@@ -2246,7 +2246,7 @@ var Hn = class e extends Vn {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
static fromJSON(t) {
|
|
2248
2248
|
let { x: n, y: r, z: i, spring: a, friction: o, life: s, easing: c, isEnabled: l = !0 } = t;
|
|
2249
|
-
return new e(n, r, i, a, o, s,
|
|
2249
|
+
return new e(n, r, i, a, o, s, R(c), l);
|
|
2250
2250
|
}
|
|
2251
2251
|
}, hr = /* @__PURE__ */ s({
|
|
2252
2252
|
Alpha: () => rr,
|
|
@@ -2266,59 +2266,60 @@ var Hn = class e extends Vn {
|
|
|
2266
2266
|
let n = [];
|
|
2267
2267
|
return e.forEach((e) => {
|
|
2268
2268
|
let { type: r, properties: i } = e;
|
|
2269
|
-
if (!
|
|
2270
|
-
|
|
2269
|
+
if (!We.includes(r)) throw Error(`The initializer type ${r} is invalid or not yet supported`);
|
|
2270
|
+
P.includes(r) ? n.push(Gn[r].fromJSON(i, t)) : n.push(Gn[r].fromJSON(i));
|
|
2271
2271
|
}), n;
|
|
2272
2272
|
}, vr = (e) => {
|
|
2273
2273
|
let t = [];
|
|
2274
2274
|
return e.forEach((e) => {
|
|
2275
2275
|
let { type: n, properties: r } = e;
|
|
2276
|
-
if (!
|
|
2276
|
+
if (!Ge.includes(n)) throw Error(`The behaviour type ${n} is invalid or not yet supported`);
|
|
2277
2277
|
t.push(hr[n].fromJSON(r));
|
|
2278
2278
|
}), t;
|
|
2279
2279
|
}, yr = (e, t, n, r) => {
|
|
2280
|
-
let { preParticles: i = 500, integrationType: a =
|
|
2280
|
+
let { preParticles: i = 500, integrationType: a = ge, emitters: o = [] } = e, s = new n(t, i, a);
|
|
2281
2281
|
return o.forEach((e) => {
|
|
2282
2282
|
let n = new r(), { rate: i, rotation: a, initializers: o, behaviours: c, emitterBehaviours: l = [], position: u, totalEmitTimes: d = Infinity, life: f = Infinity, damping: p = Kn } = e;
|
|
2283
2283
|
n.damping = p, n.setRate(gr(i)).setRotation(a).setInitializers(_r(o, t)).setBehaviours(vr(c)).setEmitterBehaviours(vr(l)).setPosition(u).emit(d, f), s.addEmitter(n);
|
|
2284
2284
|
}), s;
|
|
2285
2285
|
}, br = { shouldAutoEmit: !0 }, xr = (e) => zn.fromJSON(e), Sr = (e, t) => new Promise((n, r) => {
|
|
2286
2286
|
if (!e.length) return n([]);
|
|
2287
|
-
let i = e.length, a =
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
if (a.push(Bn.fromJSON({
|
|
2297
|
-
...s,
|
|
2287
|
+
let i = e.length, a = Array(i), o = 0, s = (e, t) => {
|
|
2288
|
+
if (a[e] = t, o += 1, o === i) return n(a);
|
|
2289
|
+
};
|
|
2290
|
+
e.forEach((e, n) => {
|
|
2291
|
+
let { type: i, properties: a } = e;
|
|
2292
|
+
if (!We.includes(i)) return r(`The initializer type ${i} is invalid or not yet supported`);
|
|
2293
|
+
if (a.texture) {
|
|
2294
|
+
new t.TextureLoader().load(a.texture, (e) => s(n, Bn.fromJSON({
|
|
2295
|
+
...a,
|
|
2298
2296
|
loadedTexture: e
|
|
2299
|
-
}, t)),
|
|
2300
|
-
|
|
2297
|
+
}, t)), void 0, r);
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
s(n, P.includes(i) ? Gn[i].fromJSON(a, t) : Gn[i].fromJSON(a));
|
|
2301
2301
|
});
|
|
2302
2302
|
}), Cr = (e) => new Promise((t, n) => {
|
|
2303
2303
|
if (!e.length) return t([]);
|
|
2304
2304
|
let r = e.length, i = [];
|
|
2305
2305
|
e.forEach((e) => {
|
|
2306
2306
|
let { type: a, properties: o } = e;
|
|
2307
|
-
if (!
|
|
2307
|
+
if (!Ge.includes(a)) return n(`The behaviour type ${a} is invalid or not yet supported`);
|
|
2308
2308
|
if (i.push(hr[a].fromJSON(o)), i.length === r) return t(i);
|
|
2309
2309
|
});
|
|
2310
2310
|
}), wr = (e, t, n, r) => new Promise((i, a) => {
|
|
2311
2311
|
if (!e.length) return i([]);
|
|
2312
|
-
let o =
|
|
2313
|
-
if (!
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2312
|
+
let o = e.length;
|
|
2313
|
+
if (!o) return i([]);
|
|
2314
|
+
let s = Array(o), c = 0;
|
|
2315
|
+
e.forEach((e, l) => {
|
|
2316
|
+
let u = new t(), { rate: d, rotation: f, initializers: p, behaviours: m, emitterBehaviours: h = [], position: g, totalEmitTimes: _ = Infinity, life: v = Infinity, damping: y = Kn } = e;
|
|
2317
|
+
u.damping = y, u.setRate(xr(d)).setRotation(f).setPosition(g), Sr(p, n).then((e) => (u.setInitializers(e), Cr(m))).then((e) => (u.setBehaviours(e), Cr(h))).then((e) => (u.setEmitterBehaviours(e), Promise.resolve(u))).then((e) => {
|
|
2318
|
+
if (s[l] = r ? e.emit(_, v) : e.setTotalEmitTimes(_).setLife(v), c += 1, c === o) return i(s);
|
|
2318
2319
|
}).catch(a);
|
|
2319
2320
|
});
|
|
2320
2321
|
}), Tr = (e, t, n, r, i = {}) => new Promise((a, o) => {
|
|
2321
|
-
let { preParticles: s = 500, integrationType: c =
|
|
2322
|
+
let { preParticles: s = 500, integrationType: c = ge, emitters: l = [] } = e, u = new n(s, c), { shouldAutoEmit: d } = {
|
|
2322
2323
|
...br,
|
|
2323
2324
|
...i
|
|
2324
2325
|
};
|
|
@@ -2371,7 +2372,7 @@ var Hn = class e extends Vn {
|
|
|
2371
2372
|
console.warn(e);
|
|
2372
2373
|
}
|
|
2373
2374
|
}
|
|
2374
|
-
update(e =
|
|
2375
|
+
update(e = Ue) {
|
|
2375
2376
|
let t = e || .0167;
|
|
2376
2377
|
if (this.canUpdate) {
|
|
2377
2378
|
if (t > 0) {
|
|
@@ -2516,7 +2517,7 @@ var kr = class extends Zn {
|
|
|
2516
2517
|
super.destroy(), this.mouseTarget.removeEventListener("mousemove", this.mousemoveHandler, !1);
|
|
2517
2518
|
}
|
|
2518
2519
|
}, Ar = class {
|
|
2519
|
-
constructor(e =
|
|
2520
|
+
constructor(e = le) {
|
|
2520
2521
|
this.type = e;
|
|
2521
2522
|
}
|
|
2522
2523
|
init(e) {
|
|
@@ -2539,11 +2540,11 @@ var kr = class extends Zn {
|
|
|
2539
2540
|
onParticleDead(e) {}
|
|
2540
2541
|
onSystemUpdate(e) {}
|
|
2541
2542
|
logRendererType() {
|
|
2542
|
-
|
|
2543
|
+
_e && console.log(`${this.type}`);
|
|
2543
2544
|
}
|
|
2544
2545
|
}, jr = class extends Ar {
|
|
2545
2546
|
constructor() {
|
|
2546
|
-
super(
|
|
2547
|
+
super(ue), this.targetPool = new Y(), this.materialPool = new Y();
|
|
2547
2548
|
}
|
|
2548
2549
|
onSystemUpdate() {}
|
|
2549
2550
|
onParticleCreated(e) {}
|
|
@@ -2551,14 +2552,14 @@ var kr = class extends Zn {
|
|
|
2551
2552
|
onParticleDead(e) {}
|
|
2552
2553
|
}, Mr = class extends Ar {
|
|
2553
2554
|
constructor(e, t) {
|
|
2554
|
-
super(
|
|
2555
|
+
super(fe), this.container = e, this._targetPool = new Y(), this._materialPool = new Y(), this._body = new t.Mesh(new t.BoxGeometry(50, 50, 50), new t.MeshLambertMaterial({ color: "#ff0000" }));
|
|
2555
2556
|
}
|
|
2556
2557
|
isThreeSprite(e) {
|
|
2557
2558
|
return e.target.isSprite;
|
|
2558
2559
|
}
|
|
2559
2560
|
onSystemUpdate() {}
|
|
2560
2561
|
onParticleCreated(e) {
|
|
2561
|
-
e.target || (e.body || (e.body = this._body), e.target = this._targetPool.get(e.body), (e.useAlpha || e.useColor) && (e.target.material.__puid =
|
|
2562
|
+
e.target || (e.body || (e.body = this._body), e.target = this._targetPool.get(e.body), (e.useAlpha || e.useColor) && (e.target.material.__puid = Je.id(e.body.material), e.target.material = this._materialPool.get(e.target.material))), e.target && (e.target.position.copy(e.position), this.container.add(e.target));
|
|
2562
2563
|
}
|
|
2563
2564
|
onParticleUpdate(e) {
|
|
2564
2565
|
let { target: t, useAlpha: n, useColor: r } = e;
|
|
@@ -2575,7 +2576,7 @@ var kr = class extends Zn {
|
|
|
2575
2576
|
}
|
|
2576
2577
|
}, Nr = class extends Mr {
|
|
2577
2578
|
constructor(e, t) {
|
|
2578
|
-
super(e, t), this.type =
|
|
2579
|
+
super(e, t), this.type = de, this._body = new t.Sprite(new t.SpriteMaterial({ color: 16777215 }));
|
|
2579
2580
|
}
|
|
2580
2581
|
rotate(e) {
|
|
2581
2582
|
e.target.material.rotation = e.rotation.z;
|
|
@@ -2700,7 +2701,7 @@ var Ur = class {
|
|
|
2700
2701
|
this.shouldDebug = t, this.rendererType = r, this.indexData = i, this.canvas = o, this.entries = [], r === "DesktopGPURenderer" && (this.atlasIndex = new n.DataTexture(i, 256, 1, n.RGBAFormat, n.FloatType)), o.width = o.height = 256, t && this.debug(o, a), this.atlasTexture = new n.CanvasTexture(o), this.atlasTexture.flipY = !1, e.material.uniforms.uTexture.value = this.atlasTexture, r === "DesktopGPURenderer" && (e.material.uniforms.atlasIndex.value = this.atlasIndex), e.material.uniformsNeedUpdate = !0;
|
|
2701
2702
|
}
|
|
2702
2703
|
log(...e) {
|
|
2703
|
-
|
|
2704
|
+
_e && console.log(...e);
|
|
2704
2705
|
}
|
|
2705
2706
|
debug() {
|
|
2706
2707
|
let { canvas: e, ctx: t } = this, n = e.width;
|
|
@@ -2762,7 +2763,7 @@ var Ur = class {
|
|
|
2762
2763
|
}
|
|
2763
2764
|
`, Q, qr = class extends Ar {
|
|
2764
2765
|
constructor(e, t, n = Lr) {
|
|
2765
|
-
super(
|
|
2766
|
+
super(he), Q = this.three = t;
|
|
2766
2767
|
let { camera: r, maxParticles: i, baseColor: a, blending: o, depthTest: s, depthWrite: c, transparent: l, shouldDebugTextureAtlas: u } = {
|
|
2767
2768
|
...Lr,
|
|
2768
2769
|
...n
|
|
@@ -2865,7 +2866,7 @@ var Ur = class {
|
|
|
2865
2866
|
}
|
|
2866
2867
|
`, $, Xr = class extends Ar {
|
|
2867
2868
|
constructor(e, t, n = Lr) {
|
|
2868
|
-
super(
|
|
2869
|
+
super(me), $ = this.three = t;
|
|
2869
2870
|
let { camera: r, maxParticles: i, baseColor: a, blending: o, depthTest: s, depthWrite: c, transparent: l, shouldDebugTextureAtlas: u } = {
|
|
2870
2871
|
...Lr,
|
|
2871
2872
|
...n
|
|
@@ -2947,7 +2948,7 @@ var Ur = class {
|
|
|
2947
2948
|
}
|
|
2948
2949
|
}, Zr = class extends Ar {
|
|
2949
2950
|
constructor(e, t, n = Lr) {
|
|
2950
|
-
super(
|
|
2951
|
+
super(pe);
|
|
2951
2952
|
let { shouldForceDesktopRenderer: r, shouldForceMobileRenderer: i } = n, a = [
|
|
2952
2953
|
e,
|
|
2953
2954
|
t,
|
|
@@ -2963,6 +2964,6 @@ var Ur = class {
|
|
|
2963
2964
|
}
|
|
2964
2965
|
}, Qr = Er;
|
|
2965
2966
|
//#endregion
|
|
2966
|
-
export { rr as Alpha, Kt as ArraySpan, ir as Attraction, Z as Behaviour, yn as Body, Cn as BodySprite, Xt as Box, kn as BoxZone, ar as Collision, or as Color, Jt as ColorSpan,
|
|
2967
|
+
export { rr as Alpha, Kt as ArraySpan, ir as Attraction, Z as Behaviour, yn as Body, Cn as BodySprite, Xt as Box, kn as BoxZone, ar as Collision, or as Color, Jt as ColorSpan, qe as ColorUtil, sr as CrossZone, jr as CustomRenderer, Dr as Debug, Zn as Emitter, kr as FollowEmitter, cr as Force, Zr as GPURenderer, lr as Gravity, Zt as INTEGRATION_TYPE_EULER, Qt as INTEGRATION_TYPE_RK2, $t as INTEGRATION_TYPE_RK4, en as INTEGRATION_TYPE_VERLET, Tn as InitializerUtil, En as Life, An as LineZone, Dn as Mass, G as MathUtils, Mr as MeshRenderer, jn as MeshZone, Je as PUID, cn as Particle, Mn as PointZone, rn as Polar3D, Hn as PolarVelocity, Y as Pool, In as Position, Un as RadialVelocity, Rn as Radius, ur as RandomDrift, zn as Rate, dr as Repulsion, fr as Rotate, Ln as Rotation, pr as Scale, Nn as ScreenZone, K as Span, Pn as SphereZone, mr as Spring, Nr as SpriteRenderer, Er as System, H as THREEUtil, Bn as Texture, U as Util, J as Vector3D, Wn as VectorVelocity, qt as createArraySpan, Yt as createColorSpan, q as createSpan, Qr as default, L as ease, Le as easeInBack, Pe as easeInCirc, Se as easeInCubic, je as easeInExpo, ze as easeInOutBack, Ie as easeInOutCirc, we as easeInOutCubic, Ne as easeInOutExpo, xe as easeInOutQuad, De as easeInOutQuart, Ae as easeInOutSine, ye as easeInQuad, Te as easeInQuart, Oe as easeInSine, ve as easeLinear, Re as easeOutBack, Fe as easeOutCirc, Ce as easeOutCubic, Me as easeOutExpo, be as easeOutQuad, Ee as easeOutQuart, ke as easeOutSine, R as getEasingByName, nn as integrate, Or as log, Be as setEasingByName, at as uid, ot as withDefaults };
|
|
2967
2968
|
|
|
2968
2969
|
//# sourceMappingURL=three-nebula.mjs.map
|