three-base 1.0.50 → 1.0.51
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/index.ts +3 -0
- package/lib/Sky/Sky.ts +36 -0
- package/lib/Sky/bluesky.jpg +0 -0
- package/lib/Transition.ts +2 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -21,6 +21,9 @@ export { default as InstancedGroupMesh } from "./lib/InstancedGroupMesh";
|
|
|
21
21
|
//点光源
|
|
22
22
|
export { default as PointLight } from "./lib/PointLight";
|
|
23
23
|
|
|
24
|
+
//天空球
|
|
25
|
+
export { default as Sky } from "./lib/Sky/Sky";
|
|
26
|
+
|
|
24
27
|
//键盘控制器
|
|
25
28
|
export { default as keyContorls } from "./lib/keyContorls";
|
|
26
29
|
|
package/lib/Sky/Sky.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: xiaosihan
|
|
3
|
+
* @Date: 2022-05-20 18:03:58
|
|
4
|
+
* @Last Modified by: xiaosihan
|
|
5
|
+
* @Last Modified time: 2022-12-27 09:54:23
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { DoubleSide, Mesh, MeshBasicMaterial, SphereGeometry } from "three";
|
|
9
|
+
import threeLoader from "../threeLoader";
|
|
10
|
+
|
|
11
|
+
import blueskyJPG from "./blueSky.jpg";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 天空球
|
|
15
|
+
*/
|
|
16
|
+
export default class Sky extends Mesh {
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
super(Sky.geometry);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static geometry = new SphereGeometry(500000, 100, 100);
|
|
23
|
+
|
|
24
|
+
material = new MeshBasicMaterial({
|
|
25
|
+
side: DoubleSide,
|
|
26
|
+
map: threeLoader.getTexture(blueskyJPG)
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
*设置贴图
|
|
31
|
+
*/
|
|
32
|
+
setMap(src: string) {
|
|
33
|
+
this.material.map = threeLoader.getTexture(src);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
Binary file
|
package/lib/Transition.ts
CHANGED
|
@@ -184,6 +184,8 @@ export default class Transition {
|
|
|
184
184
|
this._isDone = false;
|
|
185
185
|
|
|
186
186
|
}
|
|
187
|
+
|
|
188
|
+
threeUtils.removeEventListener("requestAnimationFrame", this.runbindThis);
|
|
187
189
|
threeUtils.addEventListener("requestAnimationFrame", this.runbindThis);
|
|
188
190
|
|
|
189
191
|
await new Promise(resolve => setTimeout(resolve, this._duration));
|