three-base 2.0.79 → 2.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/ThreeBase.js +3 -0
- package/ThreeBase.ts +4 -0
- package/package.json +1 -1
- package/threeLoader.js +6 -2
- package/threeLoader.ts +6 -2
package/ThreeBase.js
CHANGED
|
@@ -185,6 +185,9 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
185
185
|
this.baseDepthTexture.image.width = width * window.devicePixelRatio;
|
|
186
186
|
this.baseDepthTexture.image.height = height * window.devicePixelRatio;
|
|
187
187
|
this.size.set(width, height);
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
this.needRender = true;
|
|
190
|
+
}, 100);
|
|
188
191
|
// 渲染场景
|
|
189
192
|
// this.renderer.clear();
|
|
190
193
|
// this.renderer.render(this.scene, this.camera);
|
package/ThreeBase.ts
CHANGED
|
@@ -216,6 +216,10 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
216
216
|
this.baseDepthTexture.image.height = height * window.devicePixelRatio;
|
|
217
217
|
|
|
218
218
|
this.size.set(width, height);
|
|
219
|
+
|
|
220
|
+
setTimeout(() => {
|
|
221
|
+
this.needRender = true;
|
|
222
|
+
}, 100);
|
|
219
223
|
// 渲染场景
|
|
220
224
|
// this.renderer.clear();
|
|
221
225
|
// this.renderer.render(this.scene, this.camera);
|
package/package.json
CHANGED
package/threeLoader.js
CHANGED
|
@@ -73,10 +73,14 @@ class ThreeLoader extends EventDispatcher {
|
|
|
73
73
|
videoDom.preload = "auto";
|
|
74
74
|
videoDom.playsInline = true;
|
|
75
75
|
videoDom.src = src;
|
|
76
|
-
|
|
76
|
+
const firstOptoin = () => {
|
|
77
77
|
videoDom.pause();
|
|
78
78
|
videoDom.play();
|
|
79
|
-
|
|
79
|
+
document.removeEventListener("pointerup", firstOptoin);
|
|
80
|
+
document.removeEventListener("ontouchstart", firstOptoin);
|
|
81
|
+
};
|
|
82
|
+
document.addEventListener("pointerup", firstOptoin);
|
|
83
|
+
document.addEventListener("ontouchstart", firstOptoin);
|
|
80
84
|
texture = new VideoTexture(videoDom);
|
|
81
85
|
}
|
|
82
86
|
else {
|
package/threeLoader.ts
CHANGED
|
@@ -90,10 +90,14 @@ class ThreeLoader extends EventDispatcher {
|
|
|
90
90
|
videoDom.preload = "auto";
|
|
91
91
|
videoDom.playsInline = true;
|
|
92
92
|
videoDom.src = src;
|
|
93
|
-
|
|
93
|
+
const firstOptoin = () => {
|
|
94
94
|
videoDom.pause();
|
|
95
95
|
videoDom.play();
|
|
96
|
-
|
|
96
|
+
document.removeEventListener("pointerup", firstOptoin);
|
|
97
|
+
document.removeEventListener("ontouchstart", firstOptoin);
|
|
98
|
+
}
|
|
99
|
+
document.addEventListener("pointerup", firstOptoin);
|
|
100
|
+
document.addEventListener("ontouchstart", firstOptoin);
|
|
97
101
|
texture = new VideoTexture(videoDom);
|
|
98
102
|
} else {
|
|
99
103
|
|