soonspacejs 2.5.39 → 2.5.40
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/index.esm.js +4 -4
- package/package.json +2 -2
- package/types/Viewport/index.d.ts +1 -0
- package/types/index.d.ts +14 -1
- package/types/tools/units.d.ts +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.40",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"@tweenjs/tween.js": "^18.6.4",
|
|
27
27
|
"@types/three": "0.141.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "0dc03de127d8f5831e3dc9a2fad4d9a8f1b9c996"
|
|
30
30
|
}
|
|
@@ -75,6 +75,7 @@ declare class Viewport {
|
|
|
75
75
|
setBackgroundImage(imgUrl: string): void;
|
|
76
76
|
setSky(options?: SkyOptions): Sky | undefined;
|
|
77
77
|
closeSky(): boolean;
|
|
78
|
+
getScreenshot(): Promise<Blob | null>;
|
|
78
79
|
/**
|
|
79
80
|
***************************** environment ***************************
|
|
80
81
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -34,6 +34,18 @@ declare global {
|
|
|
34
34
|
THREE: typeof THREE;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
export interface SetTextureOptions {
|
|
38
|
+
/**
|
|
39
|
+
* 是否使用缓存中的材质
|
|
40
|
+
*/
|
|
41
|
+
cache?: boolean | null;
|
|
42
|
+
/**
|
|
43
|
+
* 是否只更新当前 Mesh 的贴图
|
|
44
|
+
* @remarks
|
|
45
|
+
* 当 Mesh 与 其它 Mesh 共享 材质时,更新纹理会拿所有共享该 材质的 Mesh 都更新,将 independ 设置为 true 可以禁止这种行为,使得只会更新传入的 Mesh 的贴图。
|
|
46
|
+
*/
|
|
47
|
+
independ?: boolean | null;
|
|
48
|
+
}
|
|
37
49
|
export declare class SoonSpace {
|
|
38
50
|
static readonly THREE: typeof THREE;
|
|
39
51
|
readonly THREE: typeof THREE;
|
|
@@ -461,6 +473,7 @@ export declare class SoonSpace {
|
|
|
461
473
|
*/
|
|
462
474
|
closeSceneFog(): void;
|
|
463
475
|
setSky(options: SkyOptions): import("three/examples/jsm/objects/Sky").Sky | undefined;
|
|
476
|
+
getScreenshot(): Promise<Blob | null>;
|
|
464
477
|
/**
|
|
465
478
|
* 轮廓显示模型
|
|
466
479
|
* @param object
|
|
@@ -971,7 +984,7 @@ export declare class SoonSpace {
|
|
|
971
984
|
* @param cache - 是丰使用缓存中的材质
|
|
972
985
|
* @returns 返回设置的纹理对象
|
|
973
986
|
*/
|
|
974
|
-
setTexture(mesh: Mesh, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement,
|
|
987
|
+
setTexture(mesh: Mesh, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: SetTextureOptions): Texture | THREE.CanvasTexture | THREE.VideoTexture;
|
|
975
988
|
/******/
|
|
976
989
|
/******/
|
|
977
990
|
/******* Canvas3D methods */
|
package/types/tools/units.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3, Box2, Matrix3, Matrix4, ShapeGeometry, Box3, Sphere, Object3D, Texture, VideoTexture, CanvasTexture } from 'three';
|
|
1
|
+
import { Vector3, Box2, Matrix3, Matrix4, ShapeGeometry, Box3, Sphere, Object3D, Texture, VideoTexture, CanvasTexture, Material } from 'three';
|
|
2
2
|
export declare function getPolygonGeometryInfo(points: Vector3[]): {
|
|
3
3
|
geometry: ShapeGeometry;
|
|
4
4
|
polygonBox: Box2;
|
|
@@ -29,3 +29,12 @@ export declare function boundingIsIntersected(target: Box3 | Sphere, obj: Object
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function getBoundingBox(obj: Object3D): Box3;
|
|
31
31
|
export declare function createTexture(image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture | CanvasTexture | VideoTexture;
|
|
32
|
+
/**
|
|
33
|
+
* 设置贴图
|
|
34
|
+
* @param material
|
|
35
|
+
* @param image
|
|
36
|
+
* @param cache
|
|
37
|
+
* @param textureCache
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare function setTexture(material: Material, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture | CanvasTexture | VideoTexture;
|