@objectifthunes/three-book 0.5.0 → 0.5.2
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/PageContent.d.ts.map +1 -1
- package/dist/SpreadContent.d.ts +3 -0
- package/dist/SpreadContent.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +343 -319
- package/dist/textureUtils.d.ts +16 -2
- package/dist/textureUtils.d.ts.map +1 -1
- package/package.json +30 -31
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as c from "three";
|
|
2
2
|
class wt {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.m_PositionX = 0, this.m_PositionZ = 0, this.m_DirectionX = 0, this.m_DirectionZ = 0, this.m_EulerY = 0, this.m_Radius = 0, this._positionOut = new
|
|
4
|
+
this.m_PositionX = 0, this.m_PositionZ = 0, this.m_DirectionX = 0, this.m_DirectionZ = 0, this.m_EulerY = 0, this.m_Radius = 0, this._positionOut = new c.Vector3(), this._scratchRP1 = new c.Vector3(), this._scratchRP2 = new c.Vector3(), this._scratchRollClosest = new c.Vector3(), this._scratchRollEuler = new c.Vector3(), this._scratchOffsetRoll = new c.Vector3();
|
|
5
5
|
}
|
|
6
6
|
// ── Properties ────────────────────────────────────────────────────────
|
|
7
7
|
/** Returns internal vector — do NOT mutate. Copy if you need to store it. */
|
|
@@ -33,7 +33,7 @@ class wt {
|
|
|
33
33
|
* Writes result into `out` and returns it.
|
|
34
34
|
*/
|
|
35
35
|
eulerRotateVector(t, e, s, i) {
|
|
36
|
-
const n = s * Math.PI / 180, h = e * Math.PI / 180, a = Math.cos(n), o = Math.sin(n), u = t * a,
|
|
36
|
+
const n = s * Math.PI / 180, h = e * Math.PI / 180, a = Math.cos(n), o = Math.sin(n), u = t * a, l = t * o, m = 0, f = Math.cos(h), d = Math.sin(h), _ = u * f + m * d, g = l, p = -u * d + m * f;
|
|
37
37
|
return i.set(_, g, p);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -86,14 +86,14 @@ function dt(r, t, e, s, i = 1 / 0, n = 1 / 60) {
|
|
|
86
86
|
s = Math.max(s, 1e-4);
|
|
87
87
|
const h = 2 / s, a = h * n, o = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
88
88
|
let u = r - t;
|
|
89
|
-
const
|
|
90
|
-
u =
|
|
89
|
+
const l = t, m = i * s;
|
|
90
|
+
u = c.MathUtils.clamp(u, -m, m), t = r - u;
|
|
91
91
|
const f = (e + h * u) * n;
|
|
92
92
|
e = (e - h * f) * o;
|
|
93
93
|
let d = t + (u + f) * o;
|
|
94
|
-
return
|
|
94
|
+
return l - r > 0 == d > l && (d = l, e = (d - l) / n), { value: d, velocity: e };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function se(r, t, e, s, i = 1 / 0, n = 1 / 60) {
|
|
97
97
|
const h = dt(
|
|
98
98
|
r.x,
|
|
99
99
|
t.x,
|
|
@@ -133,9 +133,9 @@ function vt(r, t, e) {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
const kt = new
|
|
136
|
+
const kt = new c.Vector2();
|
|
137
137
|
function Bt(r, t, e, s) {
|
|
138
|
-
return
|
|
138
|
+
return ie(r, t, e) ? s.copy(r) : (kt.set(r.x, t.y), ne(
|
|
139
139
|
kt,
|
|
140
140
|
r,
|
|
141
141
|
t,
|
|
@@ -143,13 +143,13 @@ function Bt(r, t, e, s) {
|
|
|
143
143
|
s
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function ie(r, t, e) {
|
|
147
147
|
const s = r.x - t.x;
|
|
148
148
|
let i = r.y - t.y;
|
|
149
149
|
return i *= e.x / e.y, Math.sqrt(s * s + i * i) < e.x;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
const n = e.x, h = e.y, a = r.x, o = r.y, u = t.x,
|
|
151
|
+
function ne(r, t, e, s, i) {
|
|
152
|
+
const n = e.x, h = e.y, a = r.x, o = r.y, u = t.x, l = t.y, m = s.x, f = s.y, d = 1 / (m * m), _ = 1 / (f * f);
|
|
153
153
|
if (Math.abs(a - u) < 1e-5) {
|
|
154
154
|
if (a >= n - m && a <= n + m) {
|
|
155
155
|
const g = vt(
|
|
@@ -161,11 +161,11 @@ function ie(r, t, e, s, i) {
|
|
|
161
161
|
return i.set(a, g.root0);
|
|
162
162
|
if (g.rootCount === 2) {
|
|
163
163
|
let p = g.root0, M = g.root1;
|
|
164
|
-
return o <
|
|
164
|
+
return o < l && ([p, M] = [M, p]), i.set(a, M);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
} else {
|
|
168
|
-
const g = (
|
|
168
|
+
const g = (l - o) / (u - a), p = o - g * a, M = p - h, T = vt(
|
|
169
169
|
d + _ * g * g,
|
|
170
170
|
2 * M * g * _ - 2 * n * d,
|
|
171
171
|
n * n * d + M * M * _ - 1
|
|
@@ -179,15 +179,15 @@ function ie(r, t, e, s, i) {
|
|
|
179
179
|
}
|
|
180
180
|
return i.copy(r);
|
|
181
181
|
}
|
|
182
|
-
const ft = new
|
|
182
|
+
const ft = new c.Vector3(), Rt = new c.Vector3(), bt = new c.Ray();
|
|
183
183
|
function Dt(r, t) {
|
|
184
184
|
return ft.copy(r.origin).applyMatrix4(t), Rt.copy(r.origin).add(r.direction).applyMatrix4(t), bt.set(ft, Rt.sub(ft).normalize()), bt;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function re(r) {
|
|
187
187
|
const t = r.x;
|
|
188
188
|
r.set(-t, r.y, r.z + t, r.w);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function he(r) {
|
|
191
191
|
const t = r.y;
|
|
192
192
|
r.set(r.x, -t, r.z, r.w + t);
|
|
193
193
|
}
|
|
@@ -209,14 +209,14 @@ function Q(r, t, e) {
|
|
|
209
209
|
return r !== t ? lt((e - r) / (t - r)) : 0;
|
|
210
210
|
}
|
|
211
211
|
var ut = /* @__PURE__ */ ((r) => (r[r.Surface = 0] = "Surface", r[r.Edge = 1] = "Edge", r))(ut || {});
|
|
212
|
-
const
|
|
212
|
+
const ae = 1192093e-13;
|
|
213
213
|
function Vt(r, t, e) {
|
|
214
214
|
return e = lt((e - r) / (t - r)), e * e * (3 - 2 * e);
|
|
215
215
|
}
|
|
216
|
-
class
|
|
216
|
+
class oe {
|
|
217
217
|
// ---- Constructor ----
|
|
218
218
|
constructor(t, e, s, i) {
|
|
219
|
-
this.m_UseBackContentForSides = !1, this.m_Prev = null, this.m_Next = null, this.m_NoHole = !1, this.m_Size = new
|
|
219
|
+
this.m_UseBackContentForSides = !1, this.m_Prev = null, this.m_Next = null, this.m_NoHole = !1, this.m_Size = new c.Vector2(), this.m_Thickness = 0, this.m_Stiffness = 0, this.m_Margin = 0, this.m_MeshDataType = 1, this.m_Cylinder = new wt(), this.m_IsRolling = !1, this.m_IsAutoTurning = !1, this.m_WorldPlane = new c.Plane(), this.m_StartHandle = new c.Vector3(), this.m_CurrentHandle = new c.Vector3(), this.m_EndHandle = new c.Vector3(), this.m_PrevHandle = new c.Vector3(), this.m_HandleOffset = new c.Vector3(), this.m_HandleVelocity = new c.Vector3(), this.m_HandleVelocities = [], this.m_SubMeshCount = -1, this.m_MinTurningRadius = 0, this.m_TurningRadius = 0, this.m_FallDuration = 0, this.m_FallTime = 0.2, this.m_XTime = 0, this.m_ZTime = 0, this.m_IsTurning = !1, this.m_IsFalling = !1, this.m_IsFallingLeft = !1, this.m_isMeshChanged = !1, this.sizeXOffset = 0, this._ucStartHandle = new c.Vector3(), this._ucCurrentHandle = new c.Vector3(), this._ucHandleDir = new c.Vector3(), this._ucA = new c.Vector3(), this._ucB = new c.Vector3(), this._ucMid = new c.Vector3(), this._ucRollResult = new c.Vector3(), this._ucCylDir = new c.Vector3(), this._utV1 = new c.Vector3(), this._utV2 = new c.Vector3(), this._utV3 = new c.Vector3(), this._utV4 = new c.Vector3(), this._chP = new c.Vector3(), this._chA = new c.Vector3(), this._chC = new c.Vector3(), this._chEllipseCenter1 = new c.Vector2(), this._chEllipseCenter2 = new c.Vector2(), this._chEllipseSize1 = new c.Vector2(), this._chEllipseSize2 = new c.Vector2(), this._chP2 = new c.Vector2(), this._dirResult = new c.Vector3(), this._gdA = new c.Vector3(), this._gdB = new c.Vector3(), this._rlMatrix = new c.Matrix4(), this._rlPlane = new c.Plane(new c.Vector3(0, 1, 0), 0), this._rlTarget = new c.Vector3(), this._rlNormal = new c.Vector3(), this._utTarget = new c.Vector3(), this._ufSmoothTime = new c.Vector3(), this._umFrontST = new c.Vector4(), this._umBackST = new c.Vector4(), this._h2uResult = new c.Vector2(), this.m_IsCover = t, this.m_Book = s, this.m_Index = e, this.m_Renderer = i, this.m_Transform = i.transform;
|
|
220
220
|
}
|
|
221
221
|
// ---- Properties (mirrors C#) ----
|
|
222
222
|
get isMeshChanged() {
|
|
@@ -361,7 +361,7 @@ class ae {
|
|
|
361
361
|
}
|
|
362
362
|
stopTurning() {
|
|
363
363
|
this.clampHandle(), this.m_IsTurning = !1, this.m_IsFalling = !0;
|
|
364
|
-
const t = new
|
|
364
|
+
const t = new c.Vector3(0, 0, 0);
|
|
365
365
|
for (const e of this.m_HandleVelocities)
|
|
366
366
|
t.add(e);
|
|
367
367
|
t.divideScalar(this.m_HandleVelocities.length), t.length() > 0.1 ? this.m_IsFallingLeft = t.x < 0 : this.m_IsFallingLeft = this.m_XTime > 0.5 && this.m_ZTime > 0.1, this.m_IsFallingLeft ? this.m_FallTime = 1 - this.m_XTime : this.m_FallTime = this.m_XTime, this.m_FallTime = F(0.1, 0.2, this.m_FallTime), this.m_EndHandle.copy(this.m_StartHandle), this.m_IsFallingLeft && (this.m_EndHandle.x = -this.m_Size.x);
|
|
@@ -393,9 +393,9 @@ class ae {
|
|
|
393
393
|
this.m_StartHandle,
|
|
394
394
|
this.m_EndHandle,
|
|
395
395
|
this.m_IsFallingLeft ? n : 1 - n
|
|
396
|
-
), this.m_FallTime += t, e = Math.abs(n - 1) <
|
|
396
|
+
), this.m_FallTime += t, e = Math.abs(n - 1) < ae;
|
|
397
397
|
} else
|
|
398
|
-
this._ufSmoothTime.set(this.m_FallTime, 0, this.m_FallTime * 0.75),
|
|
398
|
+
this._ufSmoothTime.set(this.m_FallTime, 0, this.m_FallTime * 0.75), se(
|
|
399
399
|
this.m_CurrentHandle,
|
|
400
400
|
this.m_EndHandle,
|
|
401
401
|
this.m_HandleVelocity,
|
|
@@ -422,12 +422,12 @@ class ae {
|
|
|
422
422
|
}
|
|
423
423
|
getTextureCoordinate(t) {
|
|
424
424
|
const e = this.raycastLocal(t, !0);
|
|
425
|
-
return e !== null ? this.hit2UV(e) : new
|
|
425
|
+
return e !== null ? this.hit2UV(e) : new c.Vector2(0, 0);
|
|
426
426
|
}
|
|
427
427
|
raycast(t) {
|
|
428
428
|
const e = {
|
|
429
|
-
point: new
|
|
430
|
-
textureCoordinate: new
|
|
429
|
+
point: new c.Vector3(),
|
|
430
|
+
textureCoordinate: new c.Vector2(),
|
|
431
431
|
pageContent: null,
|
|
432
432
|
paperIndex: 0,
|
|
433
433
|
pageIndex: 0
|
|
@@ -496,7 +496,7 @@ class ae {
|
|
|
496
496
|
t === 1 ? this.m_MaterialData.materials1 : this.m_MaterialData.materials3
|
|
497
497
|
), this.m_SubMeshCount = t);
|
|
498
498
|
const e = this._umFrontST.copy(this.m_FrontContent.textureST), s = this._umBackST.copy(this.m_BackContent.textureST);
|
|
499
|
-
this.m_Book.direction > 1 ?
|
|
499
|
+
this.m_Book.direction > 1 ? he(s) : re(s);
|
|
500
500
|
const i = this.m_FrontContent.texture, n = this.m_BackContent.texture;
|
|
501
501
|
if (t === 3) {
|
|
502
502
|
let h = 0, a = 1;
|
|
@@ -552,7 +552,7 @@ class ae {
|
|
|
552
552
|
this._utV3.set(s[1], 0, i[i.length - 1]);
|
|
553
553
|
const a = this.rollPoint(this._utV3);
|
|
554
554
|
this._utV4.set(s[2], 0, i[i.length - 1]);
|
|
555
|
-
const o = this.rollPoint(this._utV4), u = h.x - n.x,
|
|
555
|
+
const o = this.rollPoint(this._utV4), u = h.x - n.x, l = h.y - n.y, m = o.x - a.x, f = o.y - a.y, d = Math.sqrt(u * u + l * l) || 1, _ = Math.sqrt(m * m + f * f) || 1, g = et * Math.atan2(l / d, u / d), p = et * Math.atan2(f / _, m / _), M = (g + p) / 2;
|
|
556
556
|
this.m_ZTime = M / 180;
|
|
557
557
|
} else
|
|
558
558
|
this.m_XTime = 0, this.m_ZTime = 0;
|
|
@@ -565,13 +565,13 @@ class ae {
|
|
|
565
565
|
const t = this._chP.copy(this.m_CurrentHandle), e = this._chA.set(0, 0, 0), s = this._chC.set(0, 0, this.m_Size.y), i = e.distanceTo(this.m_StartHandle), n = s.distanceTo(this.m_StartHandle), h = Math.max(i - this.m_TurningRadius, 0.01), a = Math.max(n - this.m_TurningRadius, 0.01), o = this.m_StartHandle.z, u = this._chEllipseCenter1.set(
|
|
566
566
|
0,
|
|
567
567
|
o + (e.z - o) * (h / i)
|
|
568
|
-
),
|
|
568
|
+
), l = this._chEllipseCenter2.set(
|
|
569
569
|
0,
|
|
570
570
|
o + (s.z - o) * (a / n)
|
|
571
571
|
), m = this._chEllipseSize1.set(i, h), f = this._chEllipseSize2.set(n, a);
|
|
572
572
|
t.x = H(t.x, -this.m_Size.x, this.m_Size.x);
|
|
573
573
|
const d = this._chP2.set(t.x, t.z);
|
|
574
|
-
Bt(d, u, m, d), Bt(d,
|
|
574
|
+
Bt(d, u, m, d), Bt(d, l, f, d), this.m_CurrentHandle.set(d.x, 0, d.y);
|
|
575
575
|
}
|
|
576
576
|
updateCylinder() {
|
|
577
577
|
const t = this._ucStartHandle.copy(this.m_StartHandle), e = this._ucCurrentHandle.copy(this.m_CurrentHandle), s = this._ucHandleDir.copy(t).sub(e).normalize();
|
|
@@ -591,7 +591,7 @@ class ae {
|
|
|
591
591
|
return this.m_IsRolling ? this.m_Cylinder.rollPoint(t) : t;
|
|
592
592
|
}
|
|
593
593
|
startAutoTurning(t, e, s, i) {
|
|
594
|
-
var u,
|
|
594
|
+
var u, l;
|
|
595
595
|
if (this.updateTurningRadius(s), this.m_PrevHandle.copy(this.m_CurrentHandle), this.m_IsRolling = !0, this.m_HandleOffset.set(0, 0, 0), t === ut.Surface) {
|
|
596
596
|
const m = this.m_Transform.scale;
|
|
597
597
|
m.x *= -1;
|
|
@@ -599,7 +599,7 @@ class ae {
|
|
|
599
599
|
this.switchMeshData(
|
|
600
600
|
0
|
|
601
601
|
/* Highpoly */
|
|
602
|
-
), (u = this.m_Prev) == null || u.trySwitchMeshData(1), (
|
|
602
|
+
), (u = this.m_Prev) == null || u.trySwitchMeshData(1), (l = this.m_Next) == null || l.trySwitchMeshData(1), this.m_IsFallingLeft = t === ut.Edge, this.m_IsTurning = !1, this.m_IsFalling = !0, this.m_FallTime = 0, this.m_FallDuration = i;
|
|
603
603
|
const n = this.m_Size.x, h = this.m_Size.y;
|
|
604
604
|
e = H(e, -0.99, 0.99);
|
|
605
605
|
const a = It(0.5, 1, e), o = It(0.5, 0, e);
|
|
@@ -692,7 +692,7 @@ st.kMin = 0, st.kMax = 0.25;
|
|
|
692
692
|
let gt = st;
|
|
693
693
|
const X = class X {
|
|
694
694
|
constructor(t) {
|
|
695
|
-
this.m_Material = null, this.m_Color = new
|
|
695
|
+
this.m_Material = null, this.m_Color = new c.Color(1, 1, 1), this.m_Width = 0, this.m_Height = 0, this.m_Thickness = 0, this.m_Stiffness = 0, this.m_Quality = 0, this.m_UVMargin = new gt(), this.margin = 0, this.bookDirection = j.LeftToRight, this.color = (t == null ? void 0 : t.color) ?? new c.Color(1, 1, 1), this.width = (t == null ? void 0 : t.width) ?? X.kMinSize * 2, this.height = (t == null ? void 0 : t.height) ?? X.kMinSize * 2, this.thickness = (t == null ? void 0 : t.thickness) ?? X.kMinThickness * 2, this.stiffness = (t == null ? void 0 : t.stiffness) ?? 0.1, this.quality = (t == null ? void 0 : t.quality) ?? 3, (t == null ? void 0 : t.material) !== void 0 && (this.m_Material = t.material);
|
|
696
696
|
}
|
|
697
697
|
// ── Properties ────────────────────────────────────────────────────────
|
|
698
698
|
get material() {
|
|
@@ -747,15 +747,15 @@ const X = class X {
|
|
|
747
747
|
this.m_UVMargin = t;
|
|
748
748
|
}
|
|
749
749
|
get size() {
|
|
750
|
-
return new
|
|
750
|
+
return new c.Vector2(this.width, this.height);
|
|
751
751
|
}
|
|
752
752
|
};
|
|
753
753
|
X.kMinSize = 1, X.kMinThickness = 1e-4, X.kMinQuality = 1, X.kMaxQuality = 5;
|
|
754
754
|
let rt = X;
|
|
755
755
|
class zt {
|
|
756
756
|
constructor(t) {
|
|
757
|
-
this.m_Texture = null, this.m_TextureST = new
|
|
758
|
-
const e = t.material ?? new
|
|
757
|
+
this.m_Texture = null, this.m_TextureST = new c.Vector4(1, 1, 0, 0), this._cachedPropertyBlock = null, this._propertyBlockDirty = !0;
|
|
758
|
+
const e = t.material ?? new c.MeshStandardMaterial();
|
|
759
759
|
this.m_Materials1 = [e.clone()], this.m_Materials3 = [e.clone(), e.clone(), e.clone()], this.m_Color = t.color.clone();
|
|
760
760
|
}
|
|
761
761
|
get materials1() {
|
|
@@ -790,12 +790,12 @@ class zt {
|
|
|
790
790
|
this.m_Texture = t, this.m_TextureST.copy(e), this._propertyBlockDirty = !0;
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function At(r, t, e, s = new
|
|
793
|
+
function At(r, t, e, s = new c.Vector3()) {
|
|
794
794
|
let i = t.x - r.x, n = t.y - r.y, h = t.z - r.z, a = 1 / Math.sqrt(i * i + n * n + h * h);
|
|
795
795
|
i *= a, n *= a, h *= a;
|
|
796
|
-
let o = e.x - r.x, u = e.y - r.y,
|
|
797
|
-
a = 1 / Math.sqrt(o * o + u * u +
|
|
798
|
-
const m = n *
|
|
796
|
+
let o = e.x - r.x, u = e.y - r.y, l = e.z - r.z;
|
|
797
|
+
a = 1 / Math.sqrt(o * o + u * u + l * l), o *= a, u *= a, l *= a;
|
|
798
|
+
const m = n * l - h * u, f = h * o - i * l, d = i * u - n * o;
|
|
799
799
|
return a = 1 / Math.sqrt(m * m + f * f + d * d), s.set(m * a, f * a, d * a);
|
|
800
800
|
}
|
|
801
801
|
class ht {
|
|
@@ -873,7 +873,7 @@ class Tt {
|
|
|
873
873
|
);
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
class
|
|
876
|
+
class le {
|
|
877
877
|
constructor(t, e, s) {
|
|
878
878
|
const i = t.size;
|
|
879
879
|
this.leftNode = new ht(e.left * i.x, s, !0), this.rightNode = new ht((1 - e.right) * i.x, s, !0), this.downNode = new ht(e.down * i.y, s, !0), this.upNode = new ht((1 - e.up) * i.y, s, !0);
|
|
@@ -892,24 +892,24 @@ function xt(r, t, e, s, i) {
|
|
|
892
892
|
for (const n of r)
|
|
893
893
|
if (n.active)
|
|
894
894
|
for (let h = 0; h < s; h++) {
|
|
895
|
-
const a = n.prevIndex, o = n.nextIndex, u = t[h * e + a],
|
|
896
|
-
i ? Gt(u,
|
|
895
|
+
const a = n.prevIndex, o = n.nextIndex, u = t[h * e + a], l = t[h * e + o], m = t[h * e + n.index];
|
|
896
|
+
i ? Gt(u, l, n.time, m) : m.copy(u).lerp(l, n.time);
|
|
897
897
|
}
|
|
898
898
|
}
|
|
899
899
|
function Mt(r, t, e, s, i) {
|
|
900
900
|
for (const n of r)
|
|
901
901
|
if (n.active)
|
|
902
902
|
for (let h = 0; h < e; h++) {
|
|
903
|
-
const a = n.prevIndex, o = n.nextIndex, u = t[a * e + h],
|
|
904
|
-
i ? Gt(u,
|
|
903
|
+
const a = n.prevIndex, o = n.nextIndex, u = t[a * e + h], l = t[o * e + h], m = t[n.index * e + h];
|
|
904
|
+
i ? Gt(u, l, n.time, m) : m.copy(u).lerp(l, n.time);
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
|
-
function Gt(r, t, e, s = new
|
|
907
|
+
function Gt(r, t, e, s = new c.Vector3()) {
|
|
908
908
|
const i = Math.sqrt(r.x * r.x + r.y * r.y + r.z * r.z), n = Math.sqrt(t.x * t.x + t.y * t.y + t.z * t.z);
|
|
909
909
|
if (i === 0 || n === 0)
|
|
910
910
|
return s.copy(r).lerp(t, e);
|
|
911
|
-
const h = r.x / i, a = r.y / i, o = r.z / i, u = t.x / n,
|
|
912
|
-
let f = h * u + a *
|
|
911
|
+
const h = r.x / i, a = r.y / i, o = r.z / i, u = t.x / n, l = t.y / n, m = t.z / n;
|
|
912
|
+
let f = h * u + a * l + o * m;
|
|
913
913
|
f = Math.max(-1, Math.min(1, f));
|
|
914
914
|
const d = Math.acos(f);
|
|
915
915
|
if (d < 1e-6)
|
|
@@ -917,42 +917,42 @@ function Gt(r, t, e, s = new l.Vector3()) {
|
|
|
917
917
|
const _ = Math.sin(d), g = Math.sin((1 - e) * d) / _, p = Math.sin(e * d) / _, M = i + (n - i) * e;
|
|
918
918
|
return s.set(
|
|
919
919
|
(h * g + u * p) * M,
|
|
920
|
-
(a * g +
|
|
920
|
+
(a * g + l * p) * M,
|
|
921
921
|
(o * g + m * p) * M
|
|
922
922
|
);
|
|
923
923
|
}
|
|
924
924
|
function jt(r, t, e, s, i) {
|
|
925
925
|
for (const n of r) {
|
|
926
926
|
const h = (n.endX - n.startX + 1) * 2, a = (n.endZ - n.startZ + 1) * 2, o = e.length;
|
|
927
|
-
for (let
|
|
928
|
-
const f = o +
|
|
927
|
+
for (let l = 0, m = n.endX - n.startX; l < m; l++) {
|
|
928
|
+
const f = o + l * 2 + 0, d = o + l * 2 + 1, _ = o + l * 2 + 2, g = o + l * 2 + 3;
|
|
929
929
|
n.flip ? Ft(t, f, d, _, g, h) : Ht(t, f, d, _, g, h);
|
|
930
930
|
}
|
|
931
931
|
if (n.left)
|
|
932
|
-
for (let
|
|
933
|
-
const f = o +
|
|
932
|
+
for (let l = 0, m = n.endZ - n.startZ; l < m; l++) {
|
|
933
|
+
const f = o + l * 2 + 0 + h * 2, d = o + l * 2 + 1 + h * 2, _ = o + l * 2 + 2 + h * 2, g = o + l * 2 + 3 + h * 2;
|
|
934
934
|
n.flip ? Ft(t, f, d, _, g, a) : Ht(t, f, d, _, g, a);
|
|
935
935
|
}
|
|
936
936
|
else
|
|
937
|
-
for (let
|
|
938
|
-
const f = o +
|
|
937
|
+
for (let l = 0, m = n.endZ - n.startZ; l < m; l++) {
|
|
938
|
+
const f = o + l * 2 + 0 + h * 2 + a, d = o + l * 2 + 1 + h * 2 + a, _ = o + l * 2 + 2 + h * 2 + a, g = o + l * 2 + 3 + h * 2 + a;
|
|
939
939
|
n.flip ? _t(t, f, d, _, g) : mt(t, f, d, _, g);
|
|
940
940
|
}
|
|
941
941
|
const u = s * i;
|
|
942
|
-
for (let
|
|
943
|
-
const m = n.startZ * s +
|
|
942
|
+
for (let l = n.startX; l <= n.endX; l++) {
|
|
943
|
+
const m = n.startZ * s + l;
|
|
944
944
|
e.push(e[m].clone()), e.push(e[m + u].clone());
|
|
945
945
|
}
|
|
946
|
-
for (let
|
|
947
|
-
const m =
|
|
946
|
+
for (let l = n.startX; l <= n.endX; l++) {
|
|
947
|
+
const m = l + n.endZ * s;
|
|
948
948
|
e.push(e[m + u].clone()), e.push(e[m].clone());
|
|
949
949
|
}
|
|
950
|
-
for (let
|
|
951
|
-
const m = n.startX +
|
|
950
|
+
for (let l = n.startZ; l <= n.endZ; l++) {
|
|
951
|
+
const m = n.startX + l * s;
|
|
952
952
|
e.push(e[m + u].clone()), e.push(e[m].clone());
|
|
953
953
|
}
|
|
954
|
-
for (let
|
|
955
|
-
const m =
|
|
954
|
+
for (let l = n.startZ; l <= n.endZ; l++) {
|
|
955
|
+
const m = l * s + n.endX;
|
|
956
956
|
e.push(e[m].clone()), e.push(e[m + u].clone());
|
|
957
957
|
}
|
|
958
958
|
}
|
|
@@ -960,23 +960,23 @@ function jt(r, t, e, s, i) {
|
|
|
960
960
|
function qt(r, t, e, s, i) {
|
|
961
961
|
const n = s * i;
|
|
962
962
|
let h = n * 2;
|
|
963
|
-
const a = new
|
|
963
|
+
const a = new c.Vector3();
|
|
964
964
|
for (const o of r) {
|
|
965
965
|
for (let u = o.startX; u <= o.endX; u++) {
|
|
966
|
-
const
|
|
967
|
-
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[
|
|
966
|
+
const l = u + o.startZ * s, m = t[l], f = t[l + s];
|
|
967
|
+
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[l + n]);
|
|
968
968
|
}
|
|
969
969
|
for (let u = o.startX; u <= o.endX; u++) {
|
|
970
|
-
const
|
|
971
|
-
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[
|
|
970
|
+
const l = u + o.endZ * s, m = t[l + n], f = t[l + n - s];
|
|
971
|
+
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[l]);
|
|
972
972
|
}
|
|
973
973
|
for (let u = o.startZ; u <= o.endZ; u++) {
|
|
974
|
-
const
|
|
975
|
-
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[
|
|
974
|
+
const l = u * s + o.startX, m = t[l + n], f = t[l + n + 1];
|
|
975
|
+
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[l]);
|
|
976
976
|
}
|
|
977
977
|
for (let u = o.startZ; u <= o.endZ; u++) {
|
|
978
|
-
const
|
|
979
|
-
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[
|
|
978
|
+
const l = u * s + o.endX, m = t[l], f = t[l - 1];
|
|
979
|
+
a.subVectors(m, f).normalize(), o.flip && a.multiplyScalar(-1), e[h].copy(a), t[h++].copy(m), e[h].copy(a), t[h++].copy(t[l + n]);
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
982
|
}
|
|
@@ -989,19 +989,19 @@ function Ft(r, t, e, s, i, n) {
|
|
|
989
989
|
function Qt(r, t, e, s, i, n, h) {
|
|
990
990
|
mt(r, e, s, i, n), e += h, s += h, i += h, n += h, _t(t, e, s, i, n);
|
|
991
991
|
}
|
|
992
|
-
function
|
|
993
|
-
const h = i.left * s.x, a = (1 - i.right) * s.x, o = i.down * s.y, u = (1 - i.up) * s.y,
|
|
992
|
+
function Yt(r, t, e, s, i, n) {
|
|
993
|
+
const h = i.left * s.x, a = (1 - i.right) * s.x, o = i.down * s.y, u = (1 - i.up) * s.y, l = t.length, m = e.length;
|
|
994
994
|
if (n > 1)
|
|
995
995
|
for (let d = 0; d < m; d++)
|
|
996
|
-
for (let _ = 0; _ <
|
|
996
|
+
for (let _ = 0; _ < l; _++) {
|
|
997
997
|
const g = Q(a, h, t[_]), p = Q(u, o, e[d]);
|
|
998
|
-
r.push(new
|
|
998
|
+
r.push(new c.Vector2(p, g));
|
|
999
999
|
}
|
|
1000
1000
|
else
|
|
1001
1001
|
for (let d = 0; d < m; d++)
|
|
1002
|
-
for (let _ = 0; _ <
|
|
1002
|
+
for (let _ = 0; _ < l; _++) {
|
|
1003
1003
|
const g = Q(h, a, t[_]), p = Q(u, o, e[d]);
|
|
1004
|
-
r.push(new
|
|
1004
|
+
r.push(new c.Vector2(g, p));
|
|
1005
1005
|
}
|
|
1006
1006
|
const f = r.length;
|
|
1007
1007
|
for (let d = 0; d < f; d++)
|
|
@@ -1013,11 +1013,11 @@ function mt(r, t, e, s, i) {
|
|
|
1013
1013
|
function _t(r, t, e, s, i) {
|
|
1014
1014
|
r.push(t), r.push(e), r.push(s), r.push(e), r.push(i), r.push(s);
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1016
|
+
const Fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1017
1017
|
__proto__: null,
|
|
1018
1018
|
addBorders: jt,
|
|
1019
1019
|
addFrontAndBackFaces: Qt,
|
|
1020
|
-
addFrontAndBackTexcoords:
|
|
1020
|
+
addFrontAndBackTexcoords: Yt,
|
|
1021
1021
|
seamNodesToSeams: pt,
|
|
1022
1022
|
updateBorders: qt,
|
|
1023
1023
|
updateXSeams: xt,
|
|
@@ -1036,33 +1036,33 @@ class Ot {
|
|
|
1036
1036
|
constructor(t, e) {
|
|
1037
1037
|
this.m_Pattern = e, this.m_BaseVertices = new Array(e.baseVertexCount);
|
|
1038
1038
|
for (let h = 0; h < e.baseVertexCount; h++)
|
|
1039
|
-
this.m_BaseVertices[h] = new
|
|
1039
|
+
this.m_BaseVertices[h] = new c.Vector3();
|
|
1040
1040
|
this.m_Vertices = new Array(e.vertexCount);
|
|
1041
1041
|
for (let h = 0; h < e.vertexCount; h++)
|
|
1042
|
-
this.m_Vertices[h] = new
|
|
1042
|
+
this.m_Vertices[h] = new c.Vector3();
|
|
1043
1043
|
this.m_Normals = new Array(e.vertexCount);
|
|
1044
1044
|
for (let h = 0; h < e.vertexCount; h++)
|
|
1045
|
-
this.m_Normals[h] = new
|
|
1045
|
+
this.m_Normals[h] = new c.Vector3();
|
|
1046
1046
|
if (this.m_Geometry = t, this.m_Pattern.subMeshCount === 1) {
|
|
1047
1047
|
const h = new Uint32Array(e.triangles);
|
|
1048
|
-
this.m_Geometry.setIndex(new
|
|
1048
|
+
this.m_Geometry.setIndex(new c.BufferAttribute(h, 1)), this.m_Geometry.addGroup(0, e.triangles.length, 0);
|
|
1049
1049
|
} else {
|
|
1050
1050
|
const h = e.frontTriangles.length + e.backTriangles.length + e.borderTriangles.length, a = new Uint32Array(h);
|
|
1051
1051
|
let o = 0;
|
|
1052
|
-
a.set(e.frontTriangles, o), this.m_Geometry.addGroup(o, e.frontTriangles.length, 0), o += e.frontTriangles.length, a.set(e.backTriangles, o), this.m_Geometry.addGroup(o, e.backTriangles.length, 1), o += e.backTriangles.length, a.set(e.borderTriangles, o), this.m_Geometry.addGroup(o, e.borderTriangles.length, 2), this.m_Geometry.setIndex(new
|
|
1052
|
+
a.set(e.frontTriangles, o), this.m_Geometry.addGroup(o, e.frontTriangles.length, 0), o += e.frontTriangles.length, a.set(e.backTriangles, o), this.m_Geometry.addGroup(o, e.backTriangles.length, 1), o += e.backTriangles.length, a.set(e.borderTriangles, o), this.m_Geometry.addGroup(o, e.borderTriangles.length, 2), this.m_Geometry.setIndex(new c.BufferAttribute(a, 1));
|
|
1053
1053
|
}
|
|
1054
1054
|
const s = new Float32Array(e.vertexCount * 3), i = new Float32Array(e.vertexCount * 3), n = new Float32Array(e.vertexCount * 2);
|
|
1055
1055
|
for (let h = 0; h < e.texcoords.length; h++)
|
|
1056
1056
|
n[h * 2] = e.texcoords[h].x, n[h * 2 + 1] = e.texcoords[h].y;
|
|
1057
1057
|
this.m_Geometry.setAttribute(
|
|
1058
1058
|
"position",
|
|
1059
|
-
new
|
|
1059
|
+
new c.BufferAttribute(s, 3)
|
|
1060
1060
|
), this.m_Geometry.setAttribute(
|
|
1061
1061
|
"normal",
|
|
1062
|
-
new
|
|
1062
|
+
new c.BufferAttribute(i, 3)
|
|
1063
1063
|
), this.m_Geometry.setAttribute(
|
|
1064
1064
|
"uv",
|
|
1065
|
-
new
|
|
1065
|
+
new c.BufferAttribute(n, 2)
|
|
1066
1066
|
), this.updateBaseVertices();
|
|
1067
1067
|
}
|
|
1068
1068
|
// ── UpdateBaseVertices ──────────────────────────────────────────────────
|
|
@@ -1096,15 +1096,15 @@ class Ot {
|
|
|
1096
1096
|
* Ported from lines ~2185-2255.
|
|
1097
1097
|
*/
|
|
1098
1098
|
updateMesh() {
|
|
1099
|
-
const t = this.m_BaseVertices, e = this.m_Vertices, s = this.m_Normals, i = this.m_Pattern.weights, n = this.m_Pattern.baseXArray.length, h = this.m_Pattern.baseZArray.length, a = this.m_Pattern.baseVertexCount, o = new
|
|
1099
|
+
const t = this.m_BaseVertices, e = this.m_Vertices, s = this.m_Normals, i = this.m_Pattern.weights, n = this.m_Pattern.baseXArray.length, h = this.m_Pattern.baseZArray.length, a = this.m_Pattern.baseVertexCount, o = new c.Vector3(), u = new c.Vector3(), l = new c.Vector3();
|
|
1100
1100
|
for (let _ = 0; _ < a; _++)
|
|
1101
1101
|
s[_].set(0, 0, 0);
|
|
1102
1102
|
xt(this.m_Pattern.xSeams, t, n, h, !1), Mt(this.m_Pattern.zSeams, t, n, h, !1);
|
|
1103
1103
|
for (let _ = 0; _ < h - 1; _++) {
|
|
1104
1104
|
const g = _ + 1;
|
|
1105
1105
|
for (let p = 0; p < n - 1; p++) {
|
|
1106
|
-
const M = p + 1, T = _ * n + p, P = _ * n + M, C = g * n + p, k = g * n + M, I = t[T], U = t[P],
|
|
1107
|
-
At(I,
|
|
1106
|
+
const M = p + 1, T = _ * n + p, P = _ * n + M, C = g * n + p, k = g * n + M, I = t[T], U = t[P], E = t[C], z = t[k];
|
|
1107
|
+
At(I, E, U, o), At(z, U, E, u), l.addVectors(o, u), s[T].add(l), s[P].add(l), s[C].add(l), s[k].add(l);
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
for (let _ = 0; _ < a; _++)
|
|
@@ -1132,13 +1132,13 @@ class Ot {
|
|
|
1132
1132
|
f.needsUpdate = !0, d.needsUpdate = !0, this.m_Geometry.computeBoundingBox(), this.m_Geometry.computeBoundingSphere();
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
class
|
|
1135
|
+
class ce {
|
|
1136
1136
|
constructor() {
|
|
1137
1137
|
this.m_UsedMeshs = [], this.m_FreeMeshs = [], this.m_Meshs = /* @__PURE__ */ new Set();
|
|
1138
1138
|
}
|
|
1139
1139
|
get() {
|
|
1140
1140
|
let t;
|
|
1141
|
-
return this.m_FreeMeshs.length > 0 ? t = this.m_FreeMeshs.pop() : (t = new
|
|
1141
|
+
return this.m_FreeMeshs.length > 0 ? t = this.m_FreeMeshs.pop() : (t = new c.BufferGeometry(), this.m_Meshs.add(t)), this.m_UsedMeshs.push(t), t;
|
|
1142
1142
|
}
|
|
1143
1143
|
recycle() {
|
|
1144
1144
|
for (const t of this.m_UsedMeshs)
|
|
@@ -1151,7 +1151,7 @@ class le {
|
|
|
1151
1151
|
this.m_Meshs.clear();
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
|
-
class
|
|
1154
|
+
class ue {
|
|
1155
1155
|
constructor(t) {
|
|
1156
1156
|
this.m_UsedRenderers = [], this.m_FreeRenderers = [], this.m_Renderers = /* @__PURE__ */ new Set(), this.m_Ids = [], this.m_Root = t;
|
|
1157
1157
|
}
|
|
@@ -1160,7 +1160,7 @@ class ce {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
get(t) {
|
|
1162
1162
|
let e;
|
|
1163
|
-
return this.m_FreeRenderers.length > 0 ? (e = this.m_FreeRenderers.pop(), e.reset(t)) : (e = new
|
|
1163
|
+
return this.m_FreeRenderers.length > 0 ? (e = this.m_FreeRenderers.pop(), e.reset(t)) : (e = new _e(this.m_Root, t), this.m_Renderers.add(e)), this.m_UsedRenderers.push(e), this.m_Ids.push(e.id), e;
|
|
1164
1164
|
}
|
|
1165
1165
|
recycle() {
|
|
1166
1166
|
for (const t of this.m_UsedRenderers)
|
|
@@ -1173,23 +1173,23 @@ class ce {
|
|
|
1173
1173
|
this.m_Renderers.clear();
|
|
1174
1174
|
}
|
|
1175
1175
|
getBounds() {
|
|
1176
|
-
const t = new
|
|
1176
|
+
const t = new c.Box3();
|
|
1177
1177
|
let e = !0;
|
|
1178
1178
|
for (const s of this.m_UsedRenderers)
|
|
1179
1179
|
e ? (t.copy(s.bounds), e = !1) : t.union(s.bounds);
|
|
1180
1180
|
return t;
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
|
-
let
|
|
1184
|
-
class
|
|
1183
|
+
let me = 1;
|
|
1184
|
+
class _e {
|
|
1185
1185
|
constructor(t, e) {
|
|
1186
|
-
this.m_Visibility = !0, this.m_PropertyBlocks = /* @__PURE__ */ new Map(), this.m_MaterialTextures = /* @__PURE__ */ new Map(), this.m_Id =
|
|
1187
|
-
new
|
|
1188
|
-
new
|
|
1186
|
+
this.m_Visibility = !0, this.m_PropertyBlocks = /* @__PURE__ */ new Map(), this.m_MaterialTextures = /* @__PURE__ */ new Map(), this.m_Id = me++, this.m_Object3D = new c.Object3D(), this.m_Object3D.name = e, this.m_Mesh = new c.Mesh(
|
|
1187
|
+
new c.BufferGeometry(),
|
|
1188
|
+
new c.MeshStandardMaterial()
|
|
1189
1189
|
), this.m_Object3D.add(this.m_Mesh), t.add(this.m_Object3D);
|
|
1190
1190
|
}
|
|
1191
1191
|
get bounds() {
|
|
1192
|
-
const t = new
|
|
1192
|
+
const t = new c.Box3();
|
|
1193
1193
|
return this.m_Mesh.geometry && (this.m_Mesh.geometry.computeBoundingBox(), this.m_Mesh.geometry.boundingBox && (t.copy(this.m_Mesh.geometry.boundingBox), t.applyMatrix4(this.m_Mesh.matrixWorld))), t;
|
|
1194
1194
|
}
|
|
1195
1195
|
get id() {
|
|
@@ -1217,12 +1217,12 @@ class me {
|
|
|
1217
1217
|
return this.m_Mesh;
|
|
1218
1218
|
}
|
|
1219
1219
|
setMaterials(t) {
|
|
1220
|
-
this.disposeManagedTextures(), this.disposeCurrentMaterials(), Array.isArray(t) ? t.length === 0 ? this.m_Mesh.material = new
|
|
1220
|
+
this.disposeManagedTextures(), this.disposeCurrentMaterials(), Array.isArray(t) ? t.length === 0 ? this.m_Mesh.material = new c.MeshStandardMaterial() : t.length === 1 ? this.m_Mesh.material = t[0].clone() : this.m_Mesh.material = t.map((e) => e.clone()) : this.m_Mesh.material = t.clone(), this.m_PropertyBlocks.clear();
|
|
1221
1221
|
}
|
|
1222
1222
|
setPropertyBlock(t, e) {
|
|
1223
1223
|
this.m_PropertyBlocks.set(e, t);
|
|
1224
1224
|
const s = this.getMaterial(e);
|
|
1225
|
-
s && (this.isMapCapable(s) && (t.map instanceof
|
|
1225
|
+
s && (this.isMapCapable(s) && (t.map instanceof c.Texture ? this.applyTextureProperty(
|
|
1226
1226
|
s,
|
|
1227
1227
|
e,
|
|
1228
1228
|
t.map,
|
|
@@ -1230,10 +1230,10 @@ class me {
|
|
|
1230
1230
|
) : this.clearMaterialTexture(e, s)), this.isColorCapable(s) && s.color.copy(t.color));
|
|
1231
1231
|
}
|
|
1232
1232
|
reset(t) {
|
|
1233
|
-
this.m_Object3D.name = t, this.setVisibility(!0), this.m_Mesh.geometry.dispose(), this.m_Mesh.geometry = new
|
|
1233
|
+
this.m_Object3D.name = t, this.setVisibility(!0), this.m_Mesh.geometry.dispose(), this.m_Mesh.geometry = new c.BufferGeometry(), this.setMaterials([]);
|
|
1234
1234
|
}
|
|
1235
1235
|
clear() {
|
|
1236
|
-
this.m_Object3D.name = "", this.m_Mesh.geometry.dispose(), this.m_Mesh.geometry = new
|
|
1236
|
+
this.m_Object3D.name = "", this.m_Mesh.geometry.dispose(), this.m_Mesh.geometry = new c.BufferGeometry(), this.m_PropertyBlocks.clear(), this.setVisibility(!1), this.m_Object3D.position.set(0, 0, 0), this.m_Object3D.rotation.set(0, 0, 0), this.m_Object3D.scale.set(1, 1, 1);
|
|
1237
1237
|
}
|
|
1238
1238
|
destroy() {
|
|
1239
1239
|
this.disposeManagedTextures(), this.disposeCurrentMaterials(), this.m_Mesh.geometry && this.m_Mesh.geometry.dispose(), this.m_Object3D.parent && this.m_Object3D.parent.remove(this.m_Object3D);
|
|
@@ -1248,7 +1248,7 @@ class me {
|
|
|
1248
1248
|
return "map" in t;
|
|
1249
1249
|
}
|
|
1250
1250
|
isColorCapable(t) {
|
|
1251
|
-
return "color" in t && t.color instanceof
|
|
1251
|
+
return "color" in t && t.color instanceof c.Color;
|
|
1252
1252
|
}
|
|
1253
1253
|
getSTKey(t) {
|
|
1254
1254
|
return t ? `${t.x.toFixed(6)},${t.y.toFixed(6)},${t.z.toFixed(6)},${t.w.toFixed(6)}` : "1,1,0,0";
|
|
@@ -1261,7 +1261,7 @@ class me {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
this.clearManagedTexture(e);
|
|
1263
1263
|
const a = s.clone();
|
|
1264
|
-
a.needsUpdate = !0, i && (a.repeat.set(i.x, i.y), a.offset.set(i.z, i.w), a.wrapS =
|
|
1264
|
+
a.needsUpdate = !0, i && (a.repeat.set(i.x, i.y), a.offset.set(i.z, i.w), a.wrapS = c.RepeatWrapping, a.wrapT = c.RepeatWrapping), t.map = a, t.needsUpdate = !0, this.m_MaterialTextures.set(e, {
|
|
1265
1265
|
source: s,
|
|
1266
1266
|
texture: a,
|
|
1267
1267
|
stKey: n
|
|
@@ -1285,7 +1285,7 @@ class me {
|
|
|
1285
1285
|
e.dispose();
|
|
1286
1286
|
}
|
|
1287
1287
|
}
|
|
1288
|
-
class
|
|
1288
|
+
class de {
|
|
1289
1289
|
constructor(t, e, s = !1) {
|
|
1290
1290
|
this.m_Stack = [], this.m_SharedData = null, this.m_MeshFactory = t, this.m_Pattern = e, (this.m_UseSharedData = s) && (this.m_SharedData = new Ot(this.m_MeshFactory.get(), this.m_Pattern), this.m_SharedData.updateMesh());
|
|
1291
1291
|
}
|
|
@@ -1297,8 +1297,8 @@ class _e {
|
|
|
1297
1297
|
this.m_Stack.push(t);
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
|
-
var yt = /* @__PURE__ */ ((r) => (r[r.Next = 0] = "Next", r[r.Back = 1] = "Back", r))(yt || {}),
|
|
1301
|
-
class
|
|
1300
|
+
var yt = /* @__PURE__ */ ((r) => (r[r.Next = 0] = "Next", r[r.Back = 1] = "Back", r))(yt || {}), fe = /* @__PURE__ */ ((r) => (r[r.Constant = 0] = "Constant", r[r.RandomBetweenTwoConstants = 1] = "RandomBetweenTwoConstants", r[r.Curve = 2] = "Curve", r[r.RandomBetweenTwoCurves = 3] = "RandomBetweenTwoCurves", r))(fe || {}), ge = /* @__PURE__ */ ((r) => (r[r.PaperIndexTime = 0] = "PaperIndexTime", r[r.TurnIndexTime = 1] = "TurnIndexTime", r))(ge || {});
|
|
1301
|
+
class pe {
|
|
1302
1302
|
constructor(t) {
|
|
1303
1303
|
this.keys = t ? t.map((e) => ({ time: e.time, value: e.value })) : [];
|
|
1304
1304
|
}
|
|
@@ -1415,10 +1415,10 @@ class at {
|
|
|
1415
1415
|
h = Math.min(h, u), a = Math.max(a, u);
|
|
1416
1416
|
}
|
|
1417
1417
|
for (let o = 0; o < n; o++) {
|
|
1418
|
-
let u = i[o].time,
|
|
1419
|
-
u = Q(h, a, u),
|
|
1418
|
+
let u = i[o].time, l = i[o].value;
|
|
1419
|
+
u = Q(h, a, u), l = H(l, e, s), i[o].time = u, i[o].value = l;
|
|
1420
1420
|
}
|
|
1421
|
-
return new
|
|
1421
|
+
return new pe(i);
|
|
1422
1422
|
}
|
|
1423
1423
|
// ── Value-type clone ────────────────────────────────────────────────────
|
|
1424
1424
|
clone() {
|
|
@@ -1496,37 +1496,37 @@ const D = class D {
|
|
|
1496
1496
|
};
|
|
1497
1497
|
D.kMinTwist = -1, D.kMaxTwist = 1, D.kMinBend = 0, D.kMaxBend = 1, D.kMinDuration = 0, D.kMaxDuration = 5;
|
|
1498
1498
|
let Ut = D;
|
|
1499
|
-
class
|
|
1499
|
+
class xe extends Error {
|
|
1500
1500
|
constructor() {
|
|
1501
1501
|
super(
|
|
1502
1502
|
"The book's height exceeds the maximum limit. Please consider using thinner paper, increasing the width of the paper, or reducing the number of pages."
|
|
1503
1503
|
);
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
const W = class W extends
|
|
1506
|
+
const W = class W extends c.Group {
|
|
1507
1507
|
// ── Constructor ────────────────────────────────────────────────────────
|
|
1508
1508
|
constructor(t) {
|
|
1509
1509
|
super(), this.m_Content = null, this.m_Binding = null, this.m_InitialOpenProgress = 0, this.m_BuildOnAwake = !0, this.m_CastShadows = !0, this.m_AlignToGround = !1, this.m_HideBinder = !1, this.m_ReduceShadows = !1, this.m_ReduceSubMeshes = !1, this.m_ReduceOverdraw = !1, this.m_CoverPaperSetup = new rt({
|
|
1510
|
-
color: new
|
|
1510
|
+
color: new c.Color(1, 0, 0),
|
|
1511
1511
|
width: 2.1,
|
|
1512
1512
|
height: 3.1,
|
|
1513
1513
|
thickness: 0.04,
|
|
1514
1514
|
stiffness: 0.5
|
|
1515
1515
|
}), this.m_PagePaperSetup = new rt({
|
|
1516
|
-
color: new
|
|
1516
|
+
color: new c.Color(1, 1, 1),
|
|
1517
1517
|
width: 2,
|
|
1518
1518
|
height: 3,
|
|
1519
1519
|
thickness: 0.02,
|
|
1520
1520
|
stiffness: 0.2
|
|
1521
|
-
}), this.m_Root = null, this.m_IsBuilt = !1, this.m_HasCover = !1, this.m_RendererFactory = null, this.m_MeshFactory = null, this.m_Bound = null, this.m_Papers = [], this.m_SelectedPaper = null, this.m_Direction = j.LeftToRight, this.m_AutoTurnQueue = [], this.m_AutoTurnTimer = 0, this.m_AutoTurningEndTime = -1, this.m_CurrentTime = 0, this.m_CoverPaperCount = 0, this.m_PagePaperCount = 0, this.m_TotalThickness = 0, this.m_MinPaperWidth = 0, this.m_MinPaperHeight = 0, this.m_MinPaperThickness = 0, this.m_MaxPaperThickness = 0, this.m_RendererIds = [], this.m_WasIdle = !1, this.m_ContentDirty = !1, this.m_StructuralDirty = !1, this.m_AppliedDirection = void 0, this._frontPapersCache = null, t && (t.content && (this.m_Content = t.content), t.binding && (this.m_Binding = t.binding), t.initialOpenProgress !== void 0 && (this.m_InitialOpenProgress =
|
|
1522
|
-
color: t.coverPaperSetup.color ?? new
|
|
1521
|
+
}), this.m_Root = null, this.m_IsBuilt = !1, this.m_HasCover = !1, this.m_RendererFactory = null, this.m_MeshFactory = null, this.m_Bound = null, this.m_Papers = [], this.m_SelectedPaper = null, this.m_Direction = j.LeftToRight, this.m_AutoTurnQueue = [], this.m_AutoTurnTimer = 0, this.m_AutoTurningEndTime = -1, this.m_CurrentTime = 0, this.m_CoverPaperCount = 0, this.m_PagePaperCount = 0, this.m_TotalThickness = 0, this.m_MinPaperWidth = 0, this.m_MinPaperHeight = 0, this.m_MinPaperThickness = 0, this.m_MaxPaperThickness = 0, this.m_RendererIds = [], this.m_WasIdle = !1, this.m_ContentDirty = !1, this.m_StructuralDirty = !1, this.m_AppliedDirection = void 0, this._frontPapersCache = null, t && (t.content && (this.m_Content = t.content), t.binding && (this.m_Binding = t.binding), t.initialOpenProgress !== void 0 && (this.m_InitialOpenProgress = c.MathUtils.clamp(t.initialOpenProgress, 0, 1)), t.buildOnAwake !== void 0 && (this.m_BuildOnAwake = t.buildOnAwake), t.castShadows !== void 0 && (this.m_CastShadows = t.castShadows), t.alignToGround !== void 0 && (this.m_AlignToGround = t.alignToGround), t.hideBinder !== void 0 && (this.m_HideBinder = t.hideBinder), t.reduceShadows !== void 0 && (this.m_ReduceShadows = t.reduceShadows), t.reduceSubMeshes !== void 0 && (this.m_ReduceSubMeshes = t.reduceSubMeshes), t.reduceOverdraw !== void 0 && (this.m_ReduceOverdraw = t.reduceOverdraw), t.coverPaperSetup && (this.m_CoverPaperSetup = new rt({
|
|
1522
|
+
color: t.coverPaperSetup.color ?? new c.Color(1, 0, 0),
|
|
1523
1523
|
width: t.coverPaperSetup.width ?? 2.1,
|
|
1524
1524
|
height: t.coverPaperSetup.height ?? 3.1,
|
|
1525
1525
|
thickness: t.coverPaperSetup.thickness ?? 0.04,
|
|
1526
1526
|
stiffness: t.coverPaperSetup.stiffness ?? 0.5,
|
|
1527
1527
|
material: t.coverPaperSetup.material ?? null
|
|
1528
1528
|
})), t.pagePaperSetup && (this.m_PagePaperSetup = new rt({
|
|
1529
|
-
color: t.pagePaperSetup.color ?? new
|
|
1529
|
+
color: t.pagePaperSetup.color ?? new c.Color(1, 1, 1),
|
|
1530
1530
|
width: t.pagePaperSetup.width ?? 2,
|
|
1531
1531
|
height: t.pagePaperSetup.height ?? 3,
|
|
1532
1532
|
thickness: t.pagePaperSetup.thickness ?? 0.02,
|
|
@@ -1653,7 +1653,7 @@ const W = class W extends l.Group {
|
|
|
1653
1653
|
return this.m_InitialOpenProgress;
|
|
1654
1654
|
}
|
|
1655
1655
|
set initialOpenProgress(t) {
|
|
1656
|
-
this.m_InitialOpenProgress =
|
|
1656
|
+
this.m_InitialOpenProgress = c.MathUtils.clamp(t, 0, 1);
|
|
1657
1657
|
}
|
|
1658
1658
|
get isBuilt() {
|
|
1659
1659
|
return this.m_IsBuilt;
|
|
@@ -1735,7 +1735,7 @@ const W = class W extends l.Group {
|
|
|
1735
1735
|
*/
|
|
1736
1736
|
setOpenProgress(t) {
|
|
1737
1737
|
this.cancelPendingAutoTurns(), this.m_Content.direction % 2 !== 0 && (t = 1 - t);
|
|
1738
|
-
const e = this.m_Papers.length, s = Math.round(
|
|
1738
|
+
const e = this.m_Papers.length, s = Math.round(c.MathUtils.lerp(0, e, t));
|
|
1739
1739
|
for (let i = 0; i < e; i++) {
|
|
1740
1740
|
const n = i >= s;
|
|
1741
1741
|
this.m_Papers[i].restState(n);
|
|
@@ -1763,8 +1763,8 @@ const W = class W extends l.Group {
|
|
|
1763
1763
|
const n = typeof i == "number" ? new at(i) : i;
|
|
1764
1764
|
if (s = Math.min(s, this.getMaxAutoTurnCount(t)), s === 0) return !1;
|
|
1765
1765
|
for (let h = 0; h < s && this.canAutoTurn(t); h++) {
|
|
1766
|
-
const a = h / (s - 1 || 1), o = this.getAutoTurnPaperIndexTime(t), u = h > 0 ? n.getValue(o, a) : 0,
|
|
1767
|
-
this.m_AutoTurnQueue.push({ direction: t, mode:
|
|
1766
|
+
const a = h / (s - 1 || 1), o = this.getAutoTurnPaperIndexTime(t), u = h > 0 ? n.getValue(o, a) : 0, l = e.getModeValue(), m = e.getTwistValue(o, a), f = e.getBendValue(o, a), d = e.getDurationValue(o, a);
|
|
1767
|
+
this.m_AutoTurnQueue.push({ direction: t, mode: l, twist: m, bend: f, duration: d, delay: u });
|
|
1768
1768
|
}
|
|
1769
1769
|
return this.m_AutoTurnTimer = 0, this._frontPapersCache = null, !0;
|
|
1770
1770
|
}
|
|
@@ -1861,9 +1861,9 @@ const W = class W extends l.Group {
|
|
|
1861
1861
|
build() {
|
|
1862
1862
|
var B;
|
|
1863
1863
|
if (this.clear(), this.m_Content === null || this.m_Content.isEmpty || this.m_Binding === null) return;
|
|
1864
|
-
if (this.m_MeshFactory === null && (this.m_MeshFactory = new
|
|
1865
|
-
const w = new
|
|
1866
|
-
w.name = "Root", this.add(w), this.m_Root = w, this.m_RendererFactory = new
|
|
1864
|
+
if (this.m_MeshFactory === null && (this.m_MeshFactory = new ce()), this.m_RendererFactory === null) {
|
|
1865
|
+
const w = new c.Object3D();
|
|
1866
|
+
w.name = "Root", this.add(w), this.m_Root = w, this.m_RendererFactory = new ue(this.m_Root);
|
|
1867
1867
|
}
|
|
1868
1868
|
this.m_Direction = this.m_Content.direction;
|
|
1869
1869
|
const t = this.m_Direction > 1 ? Math.PI / 2 : 0;
|
|
@@ -1873,11 +1873,11 @@ const W = class W extends l.Group {
|
|
|
1873
1873
|
let i = this.m_Content.coverContents, n = this.m_Content.pageContents, h = this.m_InitialOpenProgress;
|
|
1874
1874
|
this.m_Content.direction % 2 !== 0 && (i = [...i].reverse(), n = [...n].reverse(), h = 1 - h), this.m_HasCover = i.length > 0, this.m_CoverPaperCount = Math.floor(i.length / 2), this.m_PagePaperCount = Math.floor(n.length / 2);
|
|
1875
1875
|
const a = this.m_CoverPaperCount + this.m_PagePaperCount, o = Math.floor(i.length / 4);
|
|
1876
|
-
let u = 0,
|
|
1876
|
+
let u = 0, l = 0, m = 0;
|
|
1877
1877
|
this.m_Papers = new Array(a);
|
|
1878
1878
|
for (let w = 0; w < a; w++) {
|
|
1879
|
-
const v = this.m_HasCover && (w < o || w >= a - o), N = this.m_RendererFactory.get("Paper"), R = this.m_Papers[w] = new
|
|
1880
|
-
R.renderer.castShadows = this.m_CastShadows, w < Math.round(
|
|
1879
|
+
const v = this.m_HasCover && (w < o || w >= a - o), N = this.m_RendererFactory.get("Paper"), R = this.m_Papers[w] = new oe(v, w, this, N);
|
|
1880
|
+
R.renderer.castShadows = this.m_CastShadows, w < Math.round(c.MathUtils.lerp(0, a, h)) && (R.transform.scale.set(-1, 1, 1), R.setTime(1)), v ? (R.setContentData(i[l++], i[l++], w > o), R.setMaterialData(e), R.setPaperSetup(this.m_CoverPaperSetup)) : (R.setContentData(n[u++], n[u++]), R.setMaterialData(s), R.setPaperSetup(this.m_PagePaperSetup)), m += R.thickness;
|
|
1881
1881
|
}
|
|
1882
1882
|
this.m_TotalThickness = m;
|
|
1883
1883
|
const f = this.m_Papers[0].thickness, d = this.m_Papers[Math.floor(a / 2)].thickness;
|
|
@@ -1891,10 +1891,10 @@ const W = class W extends l.Group {
|
|
|
1891
1891
|
this.m_RendererFactory,
|
|
1892
1892
|
this.m_MeshFactory
|
|
1893
1893
|
), this.m_Bound.binderRenderer.setVisibility(!this.m_HideBinder);
|
|
1894
|
-
const T = this.m_ReduceOverdraw && n.length > 0, P = this.m_ReduceSubMeshes, C = this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P), k = T ? this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P, !0) : null, I = this.createPaperMeshDataPool(this.m_PagePaperSetup, !1), U = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !0),
|
|
1894
|
+
const T = this.m_ReduceOverdraw && n.length > 0, P = this.m_ReduceSubMeshes, C = this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P), k = T ? this.createPaperMeshDataPool(this.m_PagePaperSetup, !0, P, !0) : null, I = this.createPaperMeshDataPool(this.m_PagePaperSetup, !1), U = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !0), E = this.createPaperMeshDataPool(this.m_CoverPaperSetup, !1), z = Math.floor(a / 2) - 1, L = z + 1, A = ((B = this.m_Bound) == null ? void 0 : B.bindingType) === "staple";
|
|
1895
1895
|
for (let w = 0; w < a; w++) {
|
|
1896
1896
|
const v = this.m_Papers[w];
|
|
1897
|
-
w !== 0 && (v.prev = this.m_Papers[w - 1]), w !== a - 1 && (v.next = this.m_Papers[w + 1]), v.noHole = A && (w === z || w ===
|
|
1897
|
+
w !== 0 && (v.prev = this.m_Papers[w - 1]), w !== a - 1 && (v.next = this.m_Papers[w + 1]), v.noHole = A && (w === z || w === L), v.isCover ? v.setMeshData(U.get(), null, E) : v.setMeshData(
|
|
1898
1898
|
C.get(),
|
|
1899
1899
|
(k == null ? void 0 : k.get()) ?? null,
|
|
1900
1900
|
I
|
|
@@ -1925,7 +1925,7 @@ const W = class W extends l.Group {
|
|
|
1925
1925
|
i,
|
|
1926
1926
|
s
|
|
1927
1927
|
);
|
|
1928
|
-
return new
|
|
1928
|
+
return new de(
|
|
1929
1929
|
this.m_MeshFactory,
|
|
1930
1930
|
h,
|
|
1931
1931
|
e && this.m_Bound.useSharedMeshDataForLowpoly
|
|
@@ -1979,12 +1979,12 @@ const W = class W extends l.Group {
|
|
|
1979
1979
|
const n = this.m_Papers.length, h = Math.floor(t.length / 4);
|
|
1980
1980
|
let a = 0, o = 0;
|
|
1981
1981
|
for (let u = 0; u < n; u++) {
|
|
1982
|
-
const
|
|
1983
|
-
this.m_HasCover && (u < h || u >= n - h) ?
|
|
1982
|
+
const l = this.m_Papers[u];
|
|
1983
|
+
this.m_HasCover && (u < h || u >= n - h) ? l.setContentData(
|
|
1984
1984
|
t[o++],
|
|
1985
1985
|
t[o++],
|
|
1986
1986
|
u > h
|
|
1987
|
-
) :
|
|
1987
|
+
) : l.setContentData(e[a++], e[a++]), l.updateMaterials();
|
|
1988
1988
|
}
|
|
1989
1989
|
return this.m_WasIdle = !1, !0;
|
|
1990
1990
|
}
|
|
@@ -2016,12 +2016,13 @@ const W = class W extends l.Group {
|
|
|
2016
2016
|
};
|
|
2017
2017
|
W.s_Instances = /* @__PURE__ */ new Set(), W.s_InstancesArray = null;
|
|
2018
2018
|
let Ct = W;
|
|
2019
|
-
class
|
|
2019
|
+
class Me {
|
|
2020
2020
|
constructor() {
|
|
2021
|
-
this.baseXArray = [], this.baseZArray = [], this.baseXOffset = 0, this.baseVertexCount = 0, this.xSeams = [], this.zSeams = [], this.xNoneSeamIndexes = [], this.borders = [], this.texcoords = [], this.weights = [], this.triangles = [], this.frontTriangles = [], this.backTriangles = [], this.borderTriangles = [], this.vertexCount = 0, this.subMeshCount = 0, this.size = new
|
|
2021
|
+
this.baseXArray = [], this.baseZArray = [], this.baseXOffset = 0, this.baseVertexCount = 0, this.xSeams = [], this.zSeams = [], this.xNoneSeamIndexes = [], this.borders = [], this.texcoords = [], this.weights = [], this.triangles = [], this.frontTriangles = [], this.backTriangles = [], this.borderTriangles = [], this.vertexCount = 0, this.subMeshCount = 0, this.size = new c.Vector2(), this.thickness = 0;
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
2024
|
-
|
|
2024
|
+
const $t = Object.freeze(new c.Vector4(1, 1, 0, 0));
|
|
2025
|
+
class Oe {
|
|
2025
2026
|
constructor() {
|
|
2026
2027
|
this.m_BookContent = null, this.m_IsActive = !1, this.onActiveChangedCallback = null;
|
|
2027
2028
|
}
|
|
@@ -2032,7 +2033,7 @@ class Fe {
|
|
|
2032
2033
|
return this.m_IsActive;
|
|
2033
2034
|
}
|
|
2034
2035
|
get textureST() {
|
|
2035
|
-
return
|
|
2036
|
+
return $t;
|
|
2036
2037
|
}
|
|
2037
2038
|
get isShareable() {
|
|
2038
2039
|
return !0;
|
|
@@ -2056,15 +2057,15 @@ class Fe {
|
|
|
2056
2057
|
this.m_IsActive !== t && (this.m_IsActive = t, this.onActiveChanged(), (e = this.onActiveChangedCallback) == null || e.call(this));
|
|
2057
2058
|
}
|
|
2058
2059
|
}
|
|
2059
|
-
class
|
|
2060
|
+
class Et {
|
|
2060
2061
|
constructor(t, e) {
|
|
2061
|
-
this.m_Texture = t, this.m_TextureST = e ?? new
|
|
2062
|
+
this.m_Texture = t, this.m_TextureST = e ?? new c.Vector4(1, 1, 0, 0);
|
|
2062
2063
|
}
|
|
2063
2064
|
get texture() {
|
|
2064
2065
|
return this.m_Texture;
|
|
2065
2066
|
}
|
|
2066
2067
|
get textureST() {
|
|
2067
|
-
return this.m_Texture ? this.m_TextureST :
|
|
2068
|
+
return this.m_Texture ? this.m_TextureST : $t;
|
|
2068
2069
|
}
|
|
2069
2070
|
isPointOverUI(t) {
|
|
2070
2071
|
return !1;
|
|
@@ -2074,7 +2075,7 @@ class Lt {
|
|
|
2074
2075
|
setActive(t) {
|
|
2075
2076
|
}
|
|
2076
2077
|
}
|
|
2077
|
-
class
|
|
2078
|
+
class Ze {
|
|
2078
2079
|
constructor() {
|
|
2079
2080
|
this.m_Direction = j.LeftToRight, this.m_Covers = [null, null, null, null], this.m_Pages = [null, null, null, null, null, null, null, null], this.m_Book = null, this._cachedCovers = null, this._cachedPages = null;
|
|
2080
2081
|
}
|
|
@@ -2128,12 +2129,12 @@ class Oe {
|
|
|
2128
2129
|
}
|
|
2129
2130
|
getContent(t) {
|
|
2130
2131
|
if (t !== null) {
|
|
2131
|
-
if (t instanceof
|
|
2132
|
-
return new
|
|
2132
|
+
if (t instanceof c.Texture)
|
|
2133
|
+
return new Et(t);
|
|
2133
2134
|
if (typeof t.init == "function")
|
|
2134
2135
|
return t;
|
|
2135
2136
|
}
|
|
2136
|
-
return new
|
|
2137
|
+
return new Et(null);
|
|
2137
2138
|
}
|
|
2138
2139
|
init(t) {
|
|
2139
2140
|
this.m_Book = t, this._cachedCovers = null, this._cachedPages = null;
|
|
@@ -2181,9 +2182,9 @@ class Oe {
|
|
|
2181
2182
|
return !this.isCoverPaperSideIndex(t);
|
|
2182
2183
|
}
|
|
2183
2184
|
}
|
|
2184
|
-
class
|
|
2185
|
+
class Ue {
|
|
2185
2186
|
constructor(t, e) {
|
|
2186
|
-
this.enabled = !0, this.m_Raycaster = new
|
|
2187
|
+
this.enabled = !0, this.m_Raycaster = new c.Raycaster(), this.m_Mouse = new c.Vector2(), this.m_SelectedBook = null, this.m_IsPointerDown = !1, this.m_OnPointerDown = (s) => {
|
|
2187
2188
|
var n;
|
|
2188
2189
|
if (!this.enabled || s.button !== 0) return;
|
|
2189
2190
|
this.m_IsPointerDown = !0;
|
|
@@ -2208,9 +2209,9 @@ class Ze {
|
|
|
2208
2209
|
return this.m_Mouse.x = (t.clientX - e.left) / e.width * 2 - 1, this.m_Mouse.y = -((t.clientY - e.top) / e.height) * 2 + 1, this.m_Raycaster.setFromCamera(this.m_Mouse, this.m_Camera), this.m_Raycaster.ray;
|
|
2209
2210
|
}
|
|
2210
2211
|
}
|
|
2211
|
-
class Me {
|
|
2212
|
-
}
|
|
2213
2212
|
class ye {
|
|
2213
|
+
}
|
|
2214
|
+
class Ce {
|
|
2214
2215
|
constructor(t, e) {
|
|
2215
2216
|
this.bindingType = "", this.m_Book = t, this.m_Root = e;
|
|
2216
2217
|
}
|
|
@@ -2218,9 +2219,9 @@ class ye {
|
|
|
2218
2219
|
dispose() {
|
|
2219
2220
|
}
|
|
2220
2221
|
}
|
|
2221
|
-
function
|
|
2222
|
+
function Lt(r, t, e, s) {
|
|
2222
2223
|
const i = 1 - s;
|
|
2223
|
-
return new
|
|
2224
|
+
return new c.Vector3(
|
|
2224
2225
|
i * i * r.x + 2 * i * s * t.x + s * s * e.x,
|
|
2225
2226
|
i * i * r.y + 2 * i * s * t.y + s * s * e.y,
|
|
2226
2227
|
i * i * r.z + 2 * i * s * t.z + s * s * e.z
|
|
@@ -2229,25 +2230,25 @@ function Et(r, t, e, s) {
|
|
|
2229
2230
|
function Nt(r, t) {
|
|
2230
2231
|
return r++, r === t ? 0 : r;
|
|
2231
2232
|
}
|
|
2232
|
-
function
|
|
2233
|
+
function we(r, t) {
|
|
2233
2234
|
return r === 0 ? t - 1 : r - 1;
|
|
2234
2235
|
}
|
|
2235
|
-
const
|
|
2236
|
-
function
|
|
2236
|
+
const Pe = 0.01, Te = 0.1, Se = 0.04, ve = 0.4, ke = 2, Be = 10, Re = 0, be = 5;
|
|
2237
|
+
function De(r, t) {
|
|
2237
2238
|
const e = r.clone().normalize();
|
|
2238
|
-
if (e.lengthSq() === 0) return new
|
|
2239
|
-
let s = new
|
|
2239
|
+
if (e.lengthSq() === 0) return new c.Quaternion();
|
|
2240
|
+
let s = new c.Vector3().crossVectors(t, e);
|
|
2240
2241
|
if (s.lengthSq() === 0) {
|
|
2241
|
-
const h = Math.abs(e.y) < 0.999 ? new
|
|
2242
|
-
s = new
|
|
2242
|
+
const h = Math.abs(e.y) < 0.999 ? new c.Vector3(0, 1, 0) : new c.Vector3(1, 0, 0);
|
|
2243
|
+
s = new c.Vector3().crossVectors(h, e);
|
|
2243
2244
|
}
|
|
2244
2245
|
s.normalize();
|
|
2245
|
-
const i = new
|
|
2246
|
-
return new
|
|
2246
|
+
const i = new c.Vector3().crossVectors(e, s).normalize(), n = new c.Matrix4().makeBasis(s, i, e);
|
|
2247
|
+
return new c.Quaternion().setFromRotationMatrix(n);
|
|
2247
2248
|
}
|
|
2248
|
-
class
|
|
2249
|
+
class Ie {
|
|
2249
2250
|
constructor() {
|
|
2250
|
-
this._material = null, this._color = new
|
|
2251
|
+
this._material = null, this._color = new c.Color(1, 1, 1), this._thickness = 0.05, this._crown = 0.2, this._margin = 0.1, this._count = 4, this._quality = 3;
|
|
2251
2252
|
}
|
|
2252
2253
|
get material() {
|
|
2253
2254
|
return this._material;
|
|
@@ -2265,7 +2266,7 @@ class De {
|
|
|
2265
2266
|
return this._thickness;
|
|
2266
2267
|
}
|
|
2267
2268
|
set thickness(t) {
|
|
2268
|
-
this._thickness = H(t,
|
|
2269
|
+
this._thickness = H(t, Pe, Te);
|
|
2269
2270
|
}
|
|
2270
2271
|
get margin() {
|
|
2271
2272
|
return this._margin;
|
|
@@ -2277,48 +2278,48 @@ class De {
|
|
|
2277
2278
|
return this._crown;
|
|
2278
2279
|
}
|
|
2279
2280
|
set crown(t) {
|
|
2280
|
-
this._crown = H(t,
|
|
2281
|
+
this._crown = H(t, Se, ve);
|
|
2281
2282
|
}
|
|
2282
2283
|
get count() {
|
|
2283
2284
|
return this._count;
|
|
2284
2285
|
}
|
|
2285
2286
|
set count(t) {
|
|
2286
|
-
this._count = H(t,
|
|
2287
|
+
this._count = H(t, ke, Be);
|
|
2287
2288
|
}
|
|
2288
2289
|
get quality() {
|
|
2289
2290
|
return this._quality;
|
|
2290
2291
|
}
|
|
2291
2292
|
set quality(t) {
|
|
2292
|
-
this._quality = H(t,
|
|
2293
|
+
this._quality = H(t, Re, be);
|
|
2293
2294
|
}
|
|
2294
2295
|
}
|
|
2295
|
-
class
|
|
2296
|
+
class Ve extends Ce {
|
|
2296
2297
|
// ── Constructor ────────────────────────────────────────────────────────
|
|
2297
2298
|
constructor(t, e, s, i, n) {
|
|
2298
2299
|
if (super(s, i), this.bindingType = "staple", this.m_StapleMargin = 0, this.m_StapleThickness = 0, this.m_BindingRadius = 0, this.m_BindingMidSpace = 0, this.m_StackHeight = 0, this.m_BindingVertexCount = 0, this.useSharedMeshDataForLowpoly = !1, this._binderRendererAdapter = null, this.m_Quality = t, s.totalThickness * 1.25 > s.minPaperWidth)
|
|
2299
|
-
throw new
|
|
2300
|
-
const h = this.m_Book.coverPaperSetup, a = this.m_Book.pagePaperSetup, o = new
|
|
2300
|
+
throw new xe();
|
|
2301
|
+
const h = this.m_Book.coverPaperSetup, a = this.m_Book.pagePaperSetup, o = new c.BufferGeometry();
|
|
2301
2302
|
this.updateStapleMesh(e, o);
|
|
2302
|
-
const u = n ?? new
|
|
2303
|
+
const u = n ?? new c.MeshStandardMaterial({
|
|
2303
2304
|
color: e.color,
|
|
2304
2305
|
metalness: 0.9,
|
|
2305
2306
|
roughness: 0.3
|
|
2306
2307
|
});
|
|
2307
|
-
this.stapleMesh = new
|
|
2308
|
+
this.stapleMesh = new c.Mesh(o, u), this.stapleMesh.name = "Staple", this.stapleMesh.castShadow = this.m_Book.castShadows, i.add(this.stapleMesh), this.stapleMesh.position.set(
|
|
2308
2309
|
0,
|
|
2309
2310
|
0,
|
|
2310
2311
|
this.m_StapleMargin + a.margin + h.margin
|
|
2311
2312
|
);
|
|
2312
|
-
let
|
|
2313
|
-
|
|
2313
|
+
let l = h.thickness;
|
|
2314
|
+
l = Math.max(this.m_BindingRadius, l);
|
|
2314
2315
|
for (const m of this.m_Book.papers) {
|
|
2315
2316
|
const f = m.size.clone();
|
|
2316
|
-
f.x -= this.m_BindingRadius, m.sizeXOffset = this.m_BindingRadius, m.size = f, m.setMinTurningRadius(
|
|
2317
|
+
f.x -= this.m_BindingRadius, m.sizeXOffset = this.m_BindingRadius, m.size = f, m.setMinTurningRadius(l), m.updateTurningRadius(), this.updatePaperPosition(m);
|
|
2317
2318
|
}
|
|
2318
2319
|
this.updateRootPosition();
|
|
2319
2320
|
}
|
|
2320
2321
|
get binderRenderer() {
|
|
2321
|
-
return this._binderRendererAdapter || (this._binderRendererAdapter = new
|
|
2322
|
+
return this._binderRendererAdapter || (this._binderRendererAdapter = new ze(this.stapleMesh)), this._binderRendererAdapter;
|
|
2322
2323
|
}
|
|
2323
2324
|
// ── updateStapleMesh ──────────────────────────────────────────────────
|
|
2324
2325
|
updateStapleMesh(t, e) {
|
|
@@ -2334,7 +2335,7 @@ class Ie extends ye {
|
|
|
2334
2335
|
let a = t.count, o = (h - s * a) / (a - 1);
|
|
2335
2336
|
for (o = Math.max(o, 0); o < this.m_StapleThickness * 2 && a > 2; )
|
|
2336
2337
|
a--, o = (h - s * a) / (a - 1), o = Math.max(o, 0);
|
|
2337
|
-
const u = t.quality / 5,
|
|
2338
|
+
const u = t.quality / 5, l = Math.floor(F(4, 20, u)), m = Math.floor(F(4, 10, u)), f = Math.floor(F(3, 10, u)), d = this.m_StapleThickness / 2, _ = d * 2.5, g = 0.9, p = d * 1;
|
|
2338
2339
|
let M = s / 2 * g;
|
|
2339
2340
|
M = Math.max(M, p * 2);
|
|
2340
2341
|
let T = 0;
|
|
@@ -2342,94 +2343,94 @@ class Ie extends ye {
|
|
|
2342
2343
|
const P = -(this.m_Book.papers[0].thickness / 2 + d), C = [];
|
|
2343
2344
|
{
|
|
2344
2345
|
for (let V = 0; V < m; V++) {
|
|
2345
|
-
const G = V / (m - 1), K = F(-90, -180, G) * J, y = new
|
|
2346
|
+
const G = V / (m - 1), K = F(-90, -180, G) * J, y = new c.Vector3(
|
|
2346
2347
|
p * Math.sin(K),
|
|
2347
2348
|
0,
|
|
2348
2349
|
p * Math.cos(K)
|
|
2349
2350
|
);
|
|
2350
2351
|
y.x += p, y.z += p, y.x += P, C.push(y);
|
|
2351
2352
|
}
|
|
2352
|
-
const x = new
|
|
2353
|
+
const x = new c.Vector3(T, 0, 0), Z = new c.Vector3(T + _ * 0.75, 0, 0), S = new c.Vector3(T - d * 0.5, 0, M);
|
|
2353
2354
|
for (let V = 0; V < f; V++) {
|
|
2354
|
-
const G = V / (f - 1),
|
|
2355
|
-
|
|
2355
|
+
const G = V / (f - 1), $ = Lt(x, Z, S, G);
|
|
2356
|
+
$.x += P, C.push($);
|
|
2356
2357
|
}
|
|
2357
2358
|
C.reverse();
|
|
2358
2359
|
}
|
|
2359
|
-
const k = new Array(
|
|
2360
|
-
for (let x = 0; x <
|
|
2361
|
-
const S = (90 - x * (360 /
|
|
2362
|
-
k[x] = new
|
|
2360
|
+
const k = new Array(l);
|
|
2361
|
+
for (let x = 0; x < l; x++) {
|
|
2362
|
+
const S = (90 - x * (360 / l)) * J;
|
|
2363
|
+
k[x] = new c.Vector3(Math.cos(S), Math.sin(S), 0), k[x].x *= 0.75;
|
|
2363
2364
|
}
|
|
2364
|
-
const I = C.length, U = I *
|
|
2365
|
-
(U * 2 - 1) *
|
|
2365
|
+
const I = C.length, U = I * l, E = new Array(U * 2), z = new Array(U * 2), L = new Array(
|
|
2366
|
+
(U * 2 - 1) * l * 2 * 3
|
|
2366
2367
|
);
|
|
2367
2368
|
for (let x = 0; x < U * 2; x++)
|
|
2368
|
-
|
|
2369
|
+
E[x] = new c.Vector3(), z[x] = new c.Vector3();
|
|
2369
2370
|
let A = 0;
|
|
2370
2371
|
for (let x = 0; x < I; x++) {
|
|
2371
|
-
const Z = C[
|
|
2372
|
+
const Z = C[we(x, I)], S = C[x], V = C[Nt(x, I)];
|
|
2372
2373
|
let G;
|
|
2373
2374
|
if (x === 0)
|
|
2374
|
-
G = new
|
|
2375
|
+
G = new c.Vector3(1, 0, -2).normalize();
|
|
2375
2376
|
else if (x === I - 1)
|
|
2376
|
-
G = new
|
|
2377
|
+
G = new c.Vector3(0, 0, 1);
|
|
2377
2378
|
else {
|
|
2378
2379
|
const it = S.clone().sub(Z).normalize(), nt = V.clone().sub(S).normalize();
|
|
2379
2380
|
G = it.add(nt).multiplyScalar(0.5);
|
|
2380
2381
|
}
|
|
2381
|
-
const
|
|
2382
|
+
const $ = new c.Vector3(0, 1, 0), K = De(G, $), y = A;
|
|
2382
2383
|
let b = Q(0, f / 4, x);
|
|
2383
2384
|
b = F(0.1, 1, b), b = Math.sqrt(b);
|
|
2384
|
-
for (let it = 0; it <
|
|
2385
|
+
for (let it = 0; it < l; it++) {
|
|
2385
2386
|
const nt = k[it].clone().applyQuaternion(K).multiplyScalar(b), ct = S.clone().add(nt.clone().multiplyScalar(d));
|
|
2386
|
-
|
|
2387
|
+
E[A] = ct, z[A] = nt.clone();
|
|
2387
2388
|
const ot = S.clone().add(nt.clone().multiplyScalar(d));
|
|
2388
2389
|
ot.z = s - ot.z;
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2390
|
+
const ee = y + l - it - 1, St = U * 2 - ee - 1;
|
|
2391
|
+
E[St] = ot, z[St] = nt.clone(), A++;
|
|
2391
2392
|
}
|
|
2392
2393
|
}
|
|
2393
2394
|
let B = 0;
|
|
2394
2395
|
const w = C.length * 2;
|
|
2395
2396
|
for (let x = 0; x < w - 1; x++) {
|
|
2396
|
-
const Z = x *
|
|
2397
|
-
for (let V = 0; V <
|
|
2398
|
-
const G = Nt(V,
|
|
2399
|
-
|
|
2397
|
+
const Z = x * l, S = (x + 1) * l;
|
|
2398
|
+
for (let V = 0; V < l; V++) {
|
|
2399
|
+
const G = Nt(V, l), $ = Z + V, K = Z + G, y = S + G, b = S + V;
|
|
2400
|
+
L[B++] = $, L[B++] = b, L[B++] = K, L[B++] = K, L[B++] = b, L[B++] = y;
|
|
2400
2401
|
}
|
|
2401
2402
|
}
|
|
2402
|
-
const v = [...
|
|
2403
|
+
const v = [...E], N = [...z], R = [...L], Y = E.map((x) => x.clone()), tt = [...L];
|
|
2403
2404
|
for (let x = 0; x < a - 1; x++) {
|
|
2404
|
-
const Z =
|
|
2405
|
+
const Z = Y.length;
|
|
2405
2406
|
for (let S = 0; S < tt.length; S++)
|
|
2406
2407
|
tt[S] += Z;
|
|
2407
|
-
for (let S = 0; S <
|
|
2408
|
-
|
|
2409
|
-
v.push(
|
|
2408
|
+
for (let S = 0; S < Y.length; S++)
|
|
2409
|
+
Y[S].z += o + s;
|
|
2410
|
+
v.push(...Y.map((S) => S.clone())), N.push(...z.map((S) => S.clone())), R.push(...tt);
|
|
2410
2411
|
}
|
|
2411
2412
|
const q = new Float32Array(v.length * 3), O = new Float32Array(N.length * 3);
|
|
2412
2413
|
for (let x = 0; x < v.length; x++)
|
|
2413
2414
|
q[x * 3] = v[x].x, q[x * 3 + 1] = v[x].y, q[x * 3 + 2] = v[x].z, O[x * 3] = N[x].x, O[x * 3 + 1] = N[x].y, O[x * 3 + 2] = N[x].z;
|
|
2414
2415
|
e.setAttribute(
|
|
2415
2416
|
"position",
|
|
2416
|
-
new
|
|
2417
|
+
new c.BufferAttribute(q, 3)
|
|
2417
2418
|
), e.setAttribute(
|
|
2418
2419
|
"normal",
|
|
2419
|
-
new
|
|
2420
|
+
new c.BufferAttribute(O, 3)
|
|
2420
2421
|
), e.setIndex(R);
|
|
2421
2422
|
}
|
|
2422
2423
|
// ── createPaperPattern ────────────────────────────────────────────────
|
|
2423
2424
|
createPaperPattern(t, e, s, i, n, h) {
|
|
2424
|
-
const a = new
|
|
2425
|
+
const a = new Me();
|
|
2425
2426
|
a.size = e, a.thickness = s;
|
|
2426
2427
|
const o = this.m_BindingRadius;
|
|
2427
2428
|
a.baseXOffset = -o;
|
|
2428
2429
|
const u = this.m_Quality + 1;
|
|
2429
2430
|
this.m_BindingVertexCount = u;
|
|
2430
|
-
const
|
|
2431
|
-
F(0, (e.x - o) / m,
|
|
2432
|
-
), d = Math.floor(F(0, e.y / m,
|
|
2431
|
+
const l = t / 5, m = Math.min(e.x, e.y) / 60, f = Math.floor(
|
|
2432
|
+
F(0, (e.x - o) / m, l)
|
|
2433
|
+
), d = Math.floor(F(0, e.y / m, l));
|
|
2433
2434
|
let _ = 2 + f + 1 + u, g = 2 + d;
|
|
2434
2435
|
const p = new ht(0);
|
|
2435
2436
|
let M = p;
|
|
@@ -2443,18 +2444,18 @@ class Ie extends ye {
|
|
|
2443
2444
|
const k = new ht(0);
|
|
2444
2445
|
let I = k;
|
|
2445
2446
|
const U = e.y / (g - 1);
|
|
2446
|
-
let
|
|
2447
|
+
let E = 0;
|
|
2447
2448
|
for (let y = 0; y < g - 1; y++)
|
|
2448
|
-
|
|
2449
|
-
const z = [],
|
|
2449
|
+
E += U, I = I.createNext(E);
|
|
2450
|
+
const z = [], L = [], A = i.clone();
|
|
2450
2451
|
if (n) {
|
|
2451
2452
|
let y = 0;
|
|
2452
2453
|
this.m_Book.hasCover && (y = Math.floor(this.m_Book.coverPaperCount / 2));
|
|
2453
2454
|
const b = Math.max(0.01, s);
|
|
2454
2455
|
A.left = 0, A.right = (this.getPX(y + 1, s) - this.getPX(y, s) + b) / e.x, A.down = b / e.y, A.up = b / e.y;
|
|
2455
2456
|
}
|
|
2456
|
-
const B = new
|
|
2457
|
-
B.insert(p, k, z,
|
|
2457
|
+
const B = new le(a, A, !1);
|
|
2458
|
+
B.insert(p, k, z, L), p.updateIndex(0), k.updateIndex(0), pt(z, a.xSeams), pt(L, a.zSeams);
|
|
2458
2459
|
const w = this.m_BindingVertexCount + 2, v = new Array(w);
|
|
2459
2460
|
a.xNoneSeamIndexes = v, M = p;
|
|
2460
2461
|
for (let y = 0; y < w; y++) {
|
|
@@ -2465,8 +2466,8 @@ class Ie extends ye {
|
|
|
2465
2466
|
}
|
|
2466
2467
|
const N = p.getValues(), R = k.getValues();
|
|
2467
2468
|
_ = N.length, g = R.length;
|
|
2468
|
-
const
|
|
2469
|
-
|
|
2469
|
+
const Y = _ * g, tt = [], q = new Array(Y).fill(0), O = [], x = [], Z = [], S = [];
|
|
2470
|
+
Yt(
|
|
2470
2471
|
tt,
|
|
2471
2472
|
N,
|
|
2472
2473
|
R,
|
|
@@ -2475,11 +2476,11 @@ class Ie extends ye {
|
|
|
2475
2476
|
this.m_Book.direction
|
|
2476
2477
|
);
|
|
2477
2478
|
const V = B.leftNode.index, G = B.downNode.index;
|
|
2478
|
-
let
|
|
2479
|
-
|
|
2479
|
+
let $ = B.rightNode.index, K = B.upNode.index;
|
|
2480
|
+
$ === 0 && ($ = _ - 1), K === 0 && (K = g - 1);
|
|
2480
2481
|
for (let y = 0; y < g - 1; y++)
|
|
2481
2482
|
for (let b = 0; b < _ - 1; b++) {
|
|
2482
|
-
if (n && y >= G && y < K && b >= V && b <
|
|
2483
|
+
if (n && y >= G && y < K && b >= V && b < $)
|
|
2483
2484
|
continue;
|
|
2484
2485
|
const it = y * _ + b, nt = y * _ + (b + 1), ct = (y + 1) * _ + b, ot = (y + 1) * _ + (b + 1);
|
|
2485
2486
|
q[it] += 2, q[nt] += 2, q[ct] += 2, q[ot] += 2, Qt(
|
|
@@ -2489,10 +2490,10 @@ class Ie extends ye {
|
|
|
2489
2490
|
nt,
|
|
2490
2491
|
ct,
|
|
2491
2492
|
ot,
|
|
2492
|
-
|
|
2493
|
+
Y
|
|
2493
2494
|
);
|
|
2494
2495
|
}
|
|
2495
|
-
if (S.push(new Tt(0, 0, _ - 1, g - 1, !1, !1)), jt(S, Z, tt, _, g), a.baseXArray = N, a.baseZArray = R, a.baseVertexCount =
|
|
2496
|
+
if (S.push(new Tt(0, 0, _ - 1, g - 1, !1, !1)), jt(S, Z, tt, _, g), a.baseXArray = N, a.baseZArray = R, a.baseVertexCount = Y, a.vertexCount = tt.length, a.texcoords = tt, a.weights = q, h) {
|
|
2496
2497
|
a.subMeshCount = 1;
|
|
2497
2498
|
const y = [];
|
|
2498
2499
|
y.push(...O), y.push(...Z), y.push(...x), a.triangles = y;
|
|
@@ -2519,8 +2520,8 @@ class Ie extends ye {
|
|
|
2519
2520
|
}
|
|
2520
2521
|
let a = this.getStackHeight(t.index) - t.thickness / 2;
|
|
2521
2522
|
const o = this.getStackZ(a), u = 180 + o;
|
|
2522
|
-
let
|
|
2523
|
-
const f = m * J, d = new
|
|
2523
|
+
let l = t.isFlipped ? 1 : 0, m = F(o, u, l);
|
|
2524
|
+
const f = m * J, d = new c.Vector3(
|
|
2524
2525
|
Math.cos(f) * this.m_BindingRadius,
|
|
2525
2526
|
Math.sin(f) * this.m_BindingRadius,
|
|
2526
2527
|
0
|
|
@@ -2534,7 +2535,7 @@ class Ie extends ye {
|
|
|
2534
2535
|
const C = this.m_StackHeight / 2;
|
|
2535
2536
|
g = H(i, 0, C) - C, p = Math.sqrt(_ * _ - g * g), P = (Math.asin(p / _) * et - 90) * 2;
|
|
2536
2537
|
}
|
|
2537
|
-
m = F(M, -P,
|
|
2538
|
+
m = F(M, -P, l);
|
|
2538
2539
|
} else {
|
|
2539
2540
|
let P = 0;
|
|
2540
2541
|
if (this.m_Book.alignToGround) {
|
|
@@ -2542,10 +2543,10 @@ class Ie extends ye {
|
|
|
2542
2543
|
const C = this.m_StackHeight / 2;
|
|
2543
2544
|
g = C - H(i, C, C * 2), p = Math.sqrt(_ * _ - g * g), P = (Math.asin(p / _) * et - 90) * 2;
|
|
2544
2545
|
}
|
|
2545
|
-
m = F(P, -M,
|
|
2546
|
+
m = F(P, -M, l);
|
|
2546
2547
|
}
|
|
2547
2548
|
t.transform.position.copy(d), t.transform.quaternion.setFromEuler(
|
|
2548
|
-
new
|
|
2549
|
+
new c.Euler(0, 0, m * J)
|
|
2549
2550
|
);
|
|
2550
2551
|
}
|
|
2551
2552
|
// ── getPX (private helper) ───────────────────────────────────────────
|
|
@@ -2560,9 +2561,9 @@ class Ie extends ye {
|
|
|
2560
2561
|
updatePaperPositionWithTh(t, e) {
|
|
2561
2562
|
const s = this.m_Book.papers, i = s.length, n = this.getStackHeight(t.index) - t.thickness / 2, h = this.getStackZ(n + e), a = 180 + this.getStackZ(n + e - this.m_StackHeight);
|
|
2562
2563
|
let o = t.zTime, u = F(h, a, o);
|
|
2563
|
-
const
|
|
2564
|
-
Math.cos(
|
|
2565
|
-
Math.sin(
|
|
2564
|
+
const l = u * J, m = new c.Vector3(
|
|
2565
|
+
Math.cos(l) * this.m_BindingRadius,
|
|
2566
|
+
Math.sin(l) * this.m_BindingRadius,
|
|
2566
2567
|
0
|
|
2567
2568
|
);
|
|
2568
2569
|
m.z = t.margin;
|
|
@@ -2585,7 +2586,7 @@ class Ie extends ye {
|
|
|
2585
2586
|
u = F(M, -g, o);
|
|
2586
2587
|
}
|
|
2587
2588
|
t.transform.position.copy(m), t.transform.quaternion.setFromEuler(
|
|
2588
|
-
new
|
|
2589
|
+
new c.Euler(0, 0, u * J)
|
|
2589
2590
|
);
|
|
2590
2591
|
}
|
|
2591
2592
|
// ── getStackHeight ────────────────────────────────────────────────────
|
|
@@ -2628,23 +2629,23 @@ class Ie extends ye {
|
|
|
2628
2629
|
// ── updateBindingVertices ─────────────────────────────────────────────
|
|
2629
2630
|
updateBindingVertices() {
|
|
2630
2631
|
const t = this.m_Book.papers;
|
|
2631
|
-
let e = new
|
|
2632
|
+
let e = new c.Vector3(0, 0, 0), s = new c.Vector3(0, 0, 0), i = this.m_BindingRadius * 0.6;
|
|
2632
2633
|
const n = this.m_StapleThickness * 0.5, h = t[0].thickness, a = this.m_Root.matrixWorld.clone(), o = t.length;
|
|
2633
2634
|
for (let u = 0; u < o; u++) {
|
|
2634
|
-
const
|
|
2635
|
+
const l = t[u], m = l.transform, f = l.meshData.pattern, d = l.meshData.baseVertices, _ = f.baseXArray, g = f.baseZArray, p = _.length, M = g.length, T = this.m_BindingVertexCount + 1, P = l.thickness, C = f.xNoneSeamIndexes, k = m.position.clone();
|
|
2635
2636
|
let I = u, U = n;
|
|
2636
2637
|
u >= Math.floor(o / 2) && (I = o - u - 1, U *= -1);
|
|
2637
|
-
const
|
|
2638
|
-
i = this.m_BindingRadius * F(0.45, 0.65, 1 -
|
|
2638
|
+
const E = (h + P) * 0.5 + P * (I - 1), z = m.matrixWorld.clone().invert().multiply(a), L = I / (o / 2);
|
|
2639
|
+
i = this.m_BindingRadius * F(0.45, 0.65, 1 - L);
|
|
2639
2640
|
for (let A = 0; A < M; A++) {
|
|
2640
|
-
const B = g[A], w = new
|
|
2641
|
+
const B = g[A], w = new c.Vector3(0, 0, k.z + B), v = k.clone();
|
|
2641
2642
|
v.z += B;
|
|
2642
|
-
const N =
|
|
2643
|
+
const N = l.getDirection(B).multiplyScalar(i).add(v.clone());
|
|
2643
2644
|
if (u === 0 && A === 0) {
|
|
2644
2645
|
const O = t[o - 1], Z = O.transform.position.clone().clone();
|
|
2645
2646
|
Z.z += B;
|
|
2646
2647
|
const S = O.getDirection(B).multiplyScalar(i).add(Z);
|
|
2647
|
-
s = N.clone().sub(S).normalize(), e = new
|
|
2648
|
+
s = N.clone().sub(S).normalize(), e = new c.Vector3(
|
|
2648
2649
|
-s.y,
|
|
2649
2650
|
s.x,
|
|
2650
2651
|
0
|
|
@@ -2652,15 +2653,15 @@ class Ie extends ye {
|
|
|
2652
2653
|
const V = Math.atan2(e.y, e.x) * et;
|
|
2653
2654
|
this.stapleMesh.rotation.set(0, 0, V * J);
|
|
2654
2655
|
}
|
|
2655
|
-
I > 0 && w.add(e.clone().multiplyScalar(
|
|
2656
|
+
I > 0 && w.add(e.clone().multiplyScalar(E));
|
|
2656
2657
|
const R = A * p;
|
|
2657
2658
|
d[R] = w.clone().applyMatrix4(z), w.add(s.clone().multiplyScalar(U));
|
|
2658
|
-
const
|
|
2659
|
-
d[R + C[1]] =
|
|
2659
|
+
const Y = w.clone().applyMatrix4(z), tt = N.clone().applyMatrix4(z), q = v.clone().applyMatrix4(z);
|
|
2660
|
+
d[R + C[1]] = Y;
|
|
2660
2661
|
for (let O = 2; O < T; O++) {
|
|
2661
2662
|
const x = Q(1, T, O);
|
|
2662
|
-
d[R + C[O]] =
|
|
2663
|
-
|
|
2663
|
+
d[R + C[O]] = Lt(
|
|
2664
|
+
Y,
|
|
2664
2665
|
tt,
|
|
2665
2666
|
q,
|
|
2666
2667
|
x
|
|
@@ -2693,10 +2694,10 @@ class Ie extends ye {
|
|
|
2693
2694
|
}
|
|
2694
2695
|
/** Releases GPU resources held by the staple mesh. */
|
|
2695
2696
|
dispose() {
|
|
2696
|
-
this.stapleMesh.geometry.dispose(), this.stapleMesh.material instanceof
|
|
2697
|
+
this.stapleMesh.geometry.dispose(), this.stapleMesh.material instanceof c.Material && this.stapleMesh.material.dispose(), this.stapleMesh.parent && this.stapleMesh.parent.remove(this.stapleMesh);
|
|
2697
2698
|
}
|
|
2698
2699
|
}
|
|
2699
|
-
class
|
|
2700
|
+
class ze {
|
|
2700
2701
|
constructor(t) {
|
|
2701
2702
|
this.mesh = t;
|
|
2702
2703
|
}
|
|
@@ -2710,7 +2711,7 @@ class Ve {
|
|
|
2710
2711
|
this.mesh.castShadow = t;
|
|
2711
2712
|
}
|
|
2712
2713
|
get bounds() {
|
|
2713
|
-
const t = new
|
|
2714
|
+
const t = new c.Box3();
|
|
2714
2715
|
return this.mesh.geometry && (this.mesh.geometry.computeBoundingBox(), this.mesh.geometry.boundingBox && (t.copy(this.mesh.geometry.boundingBox), t.applyMatrix4(this.mesh.matrixWorld))), t;
|
|
2715
2716
|
}
|
|
2716
2717
|
get transform() {
|
|
@@ -2720,12 +2721,12 @@ class Ve {
|
|
|
2720
2721
|
return this.mesh;
|
|
2721
2722
|
}
|
|
2722
2723
|
}
|
|
2723
|
-
class
|
|
2724
|
+
class Ee extends ye {
|
|
2724
2725
|
constructor() {
|
|
2725
|
-
super(...arguments), this.quality = 3, this.stapleSetup = new
|
|
2726
|
+
super(...arguments), this.quality = 3, this.stapleSetup = new Ie();
|
|
2726
2727
|
}
|
|
2727
2728
|
createBound(t, e, s, i) {
|
|
2728
|
-
return new
|
|
2729
|
+
return new Ve(
|
|
2729
2730
|
this.quality,
|
|
2730
2731
|
this.stapleSetup,
|
|
2731
2732
|
t,
|
|
@@ -2733,7 +2734,7 @@ class Ue extends Me {
|
|
|
2733
2734
|
);
|
|
2734
2735
|
}
|
|
2735
2736
|
}
|
|
2736
|
-
class
|
|
2737
|
+
class Kt {
|
|
2737
2738
|
constructor(t) {
|
|
2738
2739
|
this.x = (t == null ? void 0 : t.x) ?? 0, this.y = (t == null ? void 0 : t.y) ?? 0, this.width = (t == null ? void 0 : t.width) ?? 0, this.text = (t == null ? void 0 : t.text) ?? "", this.fontFamily = (t == null ? void 0 : t.fontFamily) ?? "Georgia", this.fontSize = (t == null ? void 0 : t.fontSize) ?? 24, this.fontWeight = (t == null ? void 0 : t.fontWeight) ?? "normal", this.fontStyle = (t == null ? void 0 : t.fontStyle) ?? "normal", this.color = (t == null ? void 0 : t.color) ?? "#222", this.lineHeight = (t == null ? void 0 : t.lineHeight) ?? 1.4, this.textAlign = (t == null ? void 0 : t.textAlign) ?? "left", this.opacity = (t == null ? void 0 : t.opacity) ?? 1, this.shadowColor = (t == null ? void 0 : t.shadowColor) ?? "", this.shadowBlur = (t == null ? void 0 : t.shadowBlur) ?? 0;
|
|
2739
2740
|
}
|
|
@@ -2798,28 +2799,28 @@ class Yt {
|
|
|
2798
2799
|
t.restore();
|
|
2799
2800
|
}
|
|
2800
2801
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return r.map instanceof
|
|
2802
|
+
function Ae(r) {
|
|
2803
|
+
return r.map instanceof c.Texture;
|
|
2803
2804
|
}
|
|
2804
|
-
function
|
|
2805
|
+
function Jt(r, t) {
|
|
2805
2806
|
r.traverse((e) => {
|
|
2806
2807
|
if (!e.isMesh) return;
|
|
2807
2808
|
const s = e, i = Array.isArray(s.material) ? s.material : [s.material];
|
|
2808
2809
|
for (const n of i)
|
|
2809
|
-
|
|
2810
|
+
Ae(n) && n.map.image === t && (n.map.needsUpdate = !0);
|
|
2810
2811
|
});
|
|
2811
2812
|
}
|
|
2812
|
-
function
|
|
2813
|
+
function te(r, t) {
|
|
2813
2814
|
t.x !== void 0 && (r.x = t.x), t.y !== void 0 && (r.y = t.y), t.width !== void 0 && (r.width = t.width), t.text !== void 0 && (r.text = t.text), t.fontFamily !== void 0 && (r.fontFamily = t.fontFamily), t.fontSize !== void 0 && (r.fontSize = t.fontSize), t.fontWeight !== void 0 && (r.fontWeight = t.fontWeight), t.fontStyle !== void 0 && (r.fontStyle = t.fontStyle), t.color !== void 0 && (r.color = t.color), t.lineHeight !== void 0 && (r.lineHeight = t.lineHeight), t.textAlign !== void 0 && (r.textAlign = t.textAlign), t.opacity !== void 0 && (r.opacity = t.opacity), t.shadowColor !== void 0 && (r.shadowColor = t.shadowColor), t.shadowBlur !== void 0 && (r.shadowBlur = t.shadowBlur);
|
|
2814
2815
|
}
|
|
2815
2816
|
class Le {
|
|
2816
2817
|
constructor(t) {
|
|
2817
|
-
this.texts = [], this._textureST = new
|
|
2818
|
+
this.texts = [], this._textureST = new c.Vector4(1, 1, 0, 0), this._dirty = !0;
|
|
2818
2819
|
const e = (t == null ? void 0 : t.width) ?? 512, s = (t == null ? void 0 : t.height) ?? 512;
|
|
2819
2820
|
this.canvas = document.createElement("canvas"), this.canvas.width = e, this.canvas.height = s;
|
|
2820
2821
|
const i = this.canvas.getContext("2d");
|
|
2821
2822
|
if (!i) throw new Error("TextOverlayContent: could not get 2D context");
|
|
2822
|
-
this.ctx = i, this._source = (t == null ? void 0 : t.source) ?? null, this._texture = new
|
|
2823
|
+
this.ctx = i, this._source = (t == null ? void 0 : t.source) ?? null, this._texture = new c.CanvasTexture(this.canvas), this._texture.colorSpace = c.SRGBColorSpace;
|
|
2823
2824
|
}
|
|
2824
2825
|
get texture() {
|
|
2825
2826
|
return this._texture;
|
|
@@ -2840,7 +2841,7 @@ class Le {
|
|
|
2840
2841
|
}
|
|
2841
2842
|
// ── Text API ─────────────────────────────────────────────────────────────
|
|
2842
2843
|
addText(t) {
|
|
2843
|
-
const e = new
|
|
2844
|
+
const e = new Kt(t);
|
|
2844
2845
|
return this.texts.push(e), this._dirty = !0, e;
|
|
2845
2846
|
}
|
|
2846
2847
|
removeText(t) {
|
|
@@ -2850,7 +2851,7 @@ class Le {
|
|
|
2850
2851
|
/** Update a text block by index. Only provided fields are changed. */
|
|
2851
2852
|
updateText(t, e) {
|
|
2852
2853
|
const s = this.texts[t];
|
|
2853
|
-
s && (
|
|
2854
|
+
s && (te(s, e), this._dirty = !0);
|
|
2854
2855
|
}
|
|
2855
2856
|
// ── Per-frame update ─────────────────────────────────────────────────────
|
|
2856
2857
|
/**
|
|
@@ -2874,7 +2875,7 @@ class Le {
|
|
|
2874
2875
|
* source image is this overlay's canvas.
|
|
2875
2876
|
*/
|
|
2876
2877
|
syncMaterials(t) {
|
|
2877
|
-
|
|
2878
|
+
Jt(t, this.canvas);
|
|
2878
2879
|
}
|
|
2879
2880
|
// ── IPageContent ─────────────────────────────────────────────────────────
|
|
2880
2881
|
isPointOverUI(t) {
|
|
@@ -2890,7 +2891,7 @@ class Le {
|
|
|
2890
2891
|
}
|
|
2891
2892
|
class Xt {
|
|
2892
2893
|
constructor(t, e) {
|
|
2893
|
-
this._spread = t, this._textureST = e === "left" ? new
|
|
2894
|
+
this._spread = t, this._textureST = e === "left" ? new c.Vector4(0.5, 1, 0, 0) : new c.Vector4(0.5, 1, 0.5, 0);
|
|
2894
2895
|
}
|
|
2895
2896
|
get texture() {
|
|
2896
2897
|
return this._spread.texture;
|
|
@@ -2906,18 +2907,18 @@ class Xt {
|
|
|
2906
2907
|
setActive(t) {
|
|
2907
2908
|
}
|
|
2908
2909
|
}
|
|
2909
|
-
function
|
|
2910
|
+
function Ne(r) {
|
|
2910
2911
|
const t = [];
|
|
2911
2912
|
for (let e = 1; e + 1 < r; e += 2)
|
|
2912
2913
|
t.push(e);
|
|
2913
2914
|
return t;
|
|
2914
2915
|
}
|
|
2915
|
-
class
|
|
2916
|
+
class Xe {
|
|
2916
2917
|
constructor(t) {
|
|
2917
|
-
this.texts = [], this.pageWidth = (t == null ? void 0 : t.pageWidth) ?? 512, this.pageHeight = (t == null ? void 0 : t.pageHeight) ?? 512, this.canvas = document.createElement("canvas"), this.canvas.width = this.pageWidth * 2, this.canvas.height = this.pageHeight;
|
|
2918
|
+
this.texts = [], this._dirty = !0, this.pageWidth = (t == null ? void 0 : t.pageWidth) ?? 512, this.pageHeight = (t == null ? void 0 : t.pageHeight) ?? 512, this.canvas = document.createElement("canvas"), this.canvas.width = this.pageWidth * 2, this.canvas.height = this.pageHeight;
|
|
2918
2919
|
const e = this.canvas.getContext("2d");
|
|
2919
2920
|
if (!e) throw new Error("SpreadContent: could not get 2D context");
|
|
2920
|
-
this.ctx = e, this._source = (t == null ? void 0 : t.source) ?? null, this._texture = new
|
|
2921
|
+
this.ctx = e, this._source = (t == null ? void 0 : t.source) ?? null, this._texture = new c.CanvasTexture(this.canvas), this._texture.colorSpace = c.SRGBColorSpace, this.left = new Xt(this, "left"), this.right = new Xt(this, "right");
|
|
2921
2922
|
}
|
|
2922
2923
|
get texture() {
|
|
2923
2924
|
return this._texture;
|
|
@@ -2927,21 +2928,25 @@ class Ne {
|
|
|
2927
2928
|
return this._source;
|
|
2928
2929
|
}
|
|
2929
2930
|
set source(t) {
|
|
2930
|
-
this._source = t;
|
|
2931
|
+
this._source = t, this._dirty = !0;
|
|
2932
|
+
}
|
|
2933
|
+
/** Mark the spread as needing a re-composite on the next update(). */
|
|
2934
|
+
markDirty() {
|
|
2935
|
+
this._dirty = !0;
|
|
2931
2936
|
}
|
|
2932
2937
|
// ── Text API ─────────────────────────────────────────────────────────────
|
|
2933
2938
|
addText(t) {
|
|
2934
|
-
const e = new
|
|
2935
|
-
return this.texts.push(e), e;
|
|
2939
|
+
const e = new Kt(t);
|
|
2940
|
+
return this.texts.push(e), this._dirty = !0, e;
|
|
2936
2941
|
}
|
|
2937
2942
|
removeText(t) {
|
|
2938
2943
|
const e = this.texts.indexOf(t);
|
|
2939
|
-
e !== -1 && this.texts.splice(e, 1);
|
|
2944
|
+
e !== -1 && (this.texts.splice(e, 1), this._dirty = !0);
|
|
2940
2945
|
}
|
|
2941
2946
|
/** Update a text block by index. Only provided fields are changed. */
|
|
2942
2947
|
updateText(t, e) {
|
|
2943
2948
|
const s = this.texts[t];
|
|
2944
|
-
s &&
|
|
2949
|
+
s && (te(s, e), this._dirty = !0);
|
|
2945
2950
|
}
|
|
2946
2951
|
// ── Per-frame update ─────────────────────────────────────────────────────
|
|
2947
2952
|
/**
|
|
@@ -2952,6 +2957,8 @@ class Ne {
|
|
|
2952
2957
|
* (needed because three-book clones material textures).
|
|
2953
2958
|
*/
|
|
2954
2959
|
update(t) {
|
|
2960
|
+
if (!this._dirty && !this._source) return;
|
|
2961
|
+
this._dirty = !1;
|
|
2955
2962
|
const { ctx: e, canvas: s } = this, i = s.width, n = s.height;
|
|
2956
2963
|
e.clearRect(0, 0, i, n), this._source && e.drawImage(this._source, 0, 0, i, n);
|
|
2957
2964
|
for (const h of this.texts) h.draw(e);
|
|
@@ -2962,7 +2969,7 @@ class Ne {
|
|
|
2962
2969
|
* source image is this spread's canvas.
|
|
2963
2970
|
*/
|
|
2964
2971
|
syncMaterials(t) {
|
|
2965
|
-
|
|
2972
|
+
Jt(t, this.canvas);
|
|
2966
2973
|
}
|
|
2967
2974
|
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
2968
2975
|
dispose() {
|
|
@@ -2970,32 +2977,48 @@ class Ne {
|
|
|
2970
2977
|
}
|
|
2971
2978
|
}
|
|
2972
2979
|
const Wt = 256;
|
|
2973
|
-
function
|
|
2980
|
+
function He(r, t, e, s, i, n, h) {
|
|
2974
2981
|
const a = t.naturalWidth || t.width, o = t.naturalHeight || t.height;
|
|
2975
2982
|
if (a <= 0 || o <= 0) return;
|
|
2976
2983
|
if (h === "fill") {
|
|
2977
2984
|
r.drawImage(t, e, s, i, n);
|
|
2978
2985
|
return;
|
|
2979
2986
|
}
|
|
2980
|
-
const u = h === "contain" ? Math.min(i / a, n / o) : Math.max(i / a, n / o),
|
|
2981
|
-
r.drawImage(t, e + (i -
|
|
2982
|
-
}
|
|
2983
|
-
function
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2987
|
+
const u = h === "contain" ? Math.min(i / a, n / o) : Math.max(i / a, n / o), l = a * u, m = o * u;
|
|
2988
|
+
r.drawImage(t, e + (i - l) * 0.5, s + (n - m) * 0.5, l, m);
|
|
2989
|
+
}
|
|
2990
|
+
function We(r, t, e, s, i) {
|
|
2991
|
+
const n = i ? 0 : Math.round(Math.min(t, e) * 0.11), h = n, a = n, o = t - n * 2, u = e - n * 2, l = r.naturalWidth || r.width, m = r.naturalHeight || r.height;
|
|
2992
|
+
if (s === "fill" || l <= 0 || m <= 0)
|
|
2993
|
+
return { x: h, y: a, width: o, height: u };
|
|
2994
|
+
const f = s === "contain" ? Math.min(o / l, u / m) : Math.max(o / l, u / m), d = l * f, _ = m * f;
|
|
2995
|
+
return {
|
|
2996
|
+
x: h + (o - d) * 0.5,
|
|
2997
|
+
y: a + (u - _) * 0.5,
|
|
2998
|
+
width: d,
|
|
2999
|
+
height: _
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
function Ge(r, t, e, s, i, n, h, a) {
|
|
3003
|
+
const o = n ? Math.round(n * Wt) : 512, u = h ? Math.round(h * Wt) : 512, l = document.createElement("canvas");
|
|
3004
|
+
l.width = o, l.height = u;
|
|
3005
|
+
const m = l.getContext("2d");
|
|
3006
|
+
if (m.fillStyle = r, m.fillRect(0, 0, o, u), e)
|
|
3007
|
+
if (a)
|
|
3008
|
+
m.drawImage(e, a.x, a.y, a.width, a.height);
|
|
3009
|
+
else {
|
|
3010
|
+
const d = i ? 0 : Math.round(Math.min(o, u) * 0.11);
|
|
3011
|
+
He(m, e, d, d, o - d * 2, u - d * 2, s);
|
|
3012
|
+
}
|
|
3013
|
+
else {
|
|
3014
|
+
m.fillStyle = "#333";
|
|
3015
|
+
const d = Math.round(Math.min(o, u) * 0.094);
|
|
3016
|
+
m.font = `bold ${d}px Arial`, m.textAlign = "center", m.textBaseline = "middle", m.fillText(t, o / 2, u / 2);
|
|
2994
3017
|
}
|
|
2995
|
-
const
|
|
2996
|
-
return
|
|
3018
|
+
const f = new c.CanvasTexture(l);
|
|
3019
|
+
return f.colorSpace = c.SRGBColorSpace, f;
|
|
2997
3020
|
}
|
|
2998
|
-
async function
|
|
3021
|
+
async function je(r) {
|
|
2999
3022
|
if (!r) return null;
|
|
3000
3023
|
const t = URL.createObjectURL(r), e = new Image();
|
|
3001
3024
|
e.decoding = "async", e.src = t;
|
|
@@ -3008,47 +3031,48 @@ async function We(r) {
|
|
|
3008
3031
|
}
|
|
3009
3032
|
}
|
|
3010
3033
|
export {
|
|
3011
|
-
|
|
3034
|
+
pe as AnimationCurve,
|
|
3012
3035
|
yt as AutoTurnDirection,
|
|
3013
3036
|
ut as AutoTurnMode,
|
|
3014
3037
|
at as AutoTurnSetting,
|
|
3015
|
-
|
|
3016
|
-
|
|
3038
|
+
ge as AutoTurnSettingCurveTimeMode,
|
|
3039
|
+
fe as AutoTurnSettingMode,
|
|
3017
3040
|
Ut as AutoTurnSettings,
|
|
3018
3041
|
Ct as Book,
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3042
|
+
ye as BookBinding,
|
|
3043
|
+
Ce as BookBound,
|
|
3044
|
+
Ze as BookContent,
|
|
3022
3045
|
j as BookDirection,
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3046
|
+
xe as BookHeightException,
|
|
3047
|
+
Ue as BookPointerInteraction,
|
|
3048
|
+
_e as BookRenderer,
|
|
3026
3049
|
wt as Cylinder,
|
|
3027
|
-
|
|
3050
|
+
ce as MeshFactory,
|
|
3028
3051
|
Wt as PX_PER_UNIT,
|
|
3029
|
-
|
|
3030
|
-
|
|
3052
|
+
Oe as PageContent,
|
|
3053
|
+
oe as Paper,
|
|
3031
3054
|
Tt as PaperBorder,
|
|
3032
3055
|
zt as PaperMaterialData,
|
|
3033
3056
|
Ot as PaperMeshData,
|
|
3034
|
-
|
|
3035
|
-
|
|
3057
|
+
de as PaperMeshDataPool,
|
|
3058
|
+
Fe as PaperMeshUtility,
|
|
3036
3059
|
ht as PaperNode,
|
|
3037
|
-
|
|
3038
|
-
|
|
3060
|
+
le as PaperNodeMargin,
|
|
3061
|
+
Me as PaperPattern,
|
|
3039
3062
|
Pt as PaperSeam,
|
|
3040
3063
|
rt as PaperSetup,
|
|
3041
3064
|
gt as PaperUVMargin,
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3065
|
+
ue as RendererFactory,
|
|
3066
|
+
Xe as SpreadContent,
|
|
3067
|
+
Et as SpritePageContent2,
|
|
3068
|
+
Ee as StapleBookBinding,
|
|
3069
|
+
Ve as StapleBookBound,
|
|
3070
|
+
Ie as StapleSetup,
|
|
3071
|
+
Kt as TextBlock,
|
|
3049
3072
|
Le as TextOverlayContent,
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3073
|
+
We as computeDefaultImageRect,
|
|
3074
|
+
Ge as createPageTexture,
|
|
3075
|
+
He as drawImageWithFit,
|
|
3076
|
+
Ne as getSpreadPairs,
|
|
3077
|
+
je as loadImage
|
|
3054
3078
|
};
|