three-base 1.0.78 → 1.0.80
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/lib/ExtrudeMesh.js +1 -0
- package/lib/ExtrudeMesh.ts +2 -0
- package/lib/PlaneWithHtml.js +1 -0
- package/lib/PlaneWithHtml.ts +1 -1
- package/lib/Text3D/Text3D.js +1 -0
- package/lib/Text3D/Text3D.ts +1 -0
- package/lib/ThreeBase.d.ts +1 -1
- package/lib/ThreeBase.ts +1 -1
- package/lib/Transition.d.ts +1 -3
- package/lib/Transition.js +7 -4
- package/lib/Transition.ts +9 -5
- package/lib/planeModal1/PlaneModal1.js +1 -0
- package/lib/planeModal1/PlaneModal1.ts +1 -0
- package/lib/spriteModal1/SpriteModal1.js +1 -0
- package/lib/spriteModal1/SpriteModal1.ts +1 -0
- package/package.json +1 -1
package/lib/ExtrudeMesh.js
CHANGED
package/lib/ExtrudeMesh.ts
CHANGED
package/lib/PlaneWithHtml.js
CHANGED
package/lib/PlaneWithHtml.ts
CHANGED
package/lib/Text3D/Text3D.js
CHANGED
package/lib/Text3D/Text3D.ts
CHANGED
package/lib/ThreeBase.d.ts
CHANGED
package/lib/ThreeBase.ts
CHANGED
|
@@ -309,7 +309,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
309
309
|
this.dispatchEvent({ type: "afterRender" });
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
renderBindThis = this.render.bind(this);
|
|
312
|
+
private renderBindThis = this.render.bind(this);
|
|
313
313
|
|
|
314
314
|
// 下载渲染图
|
|
315
315
|
download(fileName: string = "download") {
|
package/lib/Transition.d.ts
CHANGED
package/lib/Transition.js
CHANGED
|
@@ -23,7 +23,7 @@ export default class Transition {
|
|
|
23
23
|
constructor(param = {}, bezier = [0.8, 0, 0.2, 1], duration = 500) {
|
|
24
24
|
this.setDuration(duration);
|
|
25
25
|
this.setBezier(bezier);
|
|
26
|
-
this.
|
|
26
|
+
this.reset(param);
|
|
27
27
|
}
|
|
28
28
|
// 所有的 key 的枚举
|
|
29
29
|
_keys = [];
|
|
@@ -57,7 +57,7 @@ export default class Transition {
|
|
|
57
57
|
}
|
|
58
58
|
// 存储 每个参数的 起始位置 起始时间 终止位置 终止时间
|
|
59
59
|
_ = {};
|
|
60
|
-
onChangeCall;
|
|
60
|
+
onChangeCall = (josn) => { };
|
|
61
61
|
// 执行过度动画
|
|
62
62
|
run({ timeTemp }) {
|
|
63
63
|
this.timeTemp = timeTemp;
|
|
@@ -133,9 +133,9 @@ export default class Transition {
|
|
|
133
133
|
// // 执行状态未完成
|
|
134
134
|
// this._isDone = false;
|
|
135
135
|
}
|
|
136
|
-
threeUtils.removeEventListener("requestAnimationFrame", this.runbindThis);
|
|
137
|
-
threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
|
|
138
136
|
if (!this._isDone) {
|
|
137
|
+
threeUtils.removeEventListener("requestAnimationFrame", this.runbindThis);
|
|
138
|
+
threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
|
|
139
139
|
await new Promise(resolve => setTimeout(resolve, this._duration + 50));
|
|
140
140
|
}
|
|
141
141
|
return this;
|
|
@@ -143,6 +143,9 @@ export default class Transition {
|
|
|
143
143
|
// 重置起始和终止位置
|
|
144
144
|
reset(param) {
|
|
145
145
|
for (let key in param) {
|
|
146
|
+
if (!this._keys.includes(key)) {
|
|
147
|
+
this._keys.push(key);
|
|
148
|
+
}
|
|
146
149
|
this._[key + "_start"] = param[key];
|
|
147
150
|
this._[key + "_end"] = param[key];
|
|
148
151
|
this._[key + "_startTime"] = -this._duration;
|
package/lib/Transition.ts
CHANGED
|
@@ -36,7 +36,7 @@ export default class Transition {
|
|
|
36
36
|
|
|
37
37
|
this.setBezier(bezier);
|
|
38
38
|
|
|
39
|
-
this.
|
|
39
|
+
this.reset(param);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// 所有的 key 的枚举
|
|
@@ -82,7 +82,7 @@ export default class Transition {
|
|
|
82
82
|
// 存储 每个参数的 起始位置 起始时间 终止位置 终止时间
|
|
83
83
|
_: { [key: string]: number } = {};
|
|
84
84
|
|
|
85
|
-
onChangeCall
|
|
85
|
+
private onChangeCall = (josn: { [key: string]: number }) => { };
|
|
86
86
|
|
|
87
87
|
// 执行过度动画
|
|
88
88
|
run({ timeTemp }: any) {
|
|
@@ -185,10 +185,9 @@ export default class Transition {
|
|
|
185
185
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
threeUtils.removeEventListener("requestAnimationFrame", this.runbindThis);
|
|
189
|
-
threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
|
|
190
|
-
|
|
191
188
|
if (!this._isDone) {
|
|
189
|
+
threeUtils.removeEventListener("requestAnimationFrame", this.runbindThis);
|
|
190
|
+
threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
|
|
192
191
|
await new Promise(resolve => setTimeout(resolve, this._duration + 50));
|
|
193
192
|
}
|
|
194
193
|
|
|
@@ -198,6 +197,11 @@ export default class Transition {
|
|
|
198
197
|
reset(param: TParam): this {
|
|
199
198
|
|
|
200
199
|
for (let key in param) {
|
|
200
|
+
|
|
201
|
+
if (!this._keys.includes(key)) {
|
|
202
|
+
this._keys.push(key);
|
|
203
|
+
}
|
|
204
|
+
|
|
201
205
|
this._[key + "_start"] = param[key];
|
|
202
206
|
this._[key + "_end"] = param[key];
|
|
203
207
|
this._[key + "_startTime"] = -this._duration;
|