soonspacejs 2.6.13 → 2.6.16
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 +3 -3
- package/types/Controls/OrbitControls.d.ts +4 -4
- package/types/Interface/sbmCache.d.ts +1 -0
- package/types/Loader/SbmLoader/SbmLoader.d.ts +8 -39
- package/types/Loader/SbmLoader/SbmObjectLoader.d.ts +1 -1
- package/types/Loader/SbmLoader/SbmPrivateLoader.d.ts +46 -0
- package/types/Loader/SbmLoader/{SbkLoader.d.ts → SbmPublicLoader.d.ts} +2 -2
- package/types/Loader/SbmLoader/index.d.ts +2 -5
- package/types/Loader/SbmLoader/utils/generateSbm.d.ts +2 -2
- package/types/Manager/ModelManage.d.ts +2 -0
- package/types/Viewport/index.d.ts +1 -1
- package/types/index.d.ts +5 -0
- package/types/three-patches.d.ts +1 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.16",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"three-mesh-bvh": "0.5.23"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"three": ">=0.
|
|
29
|
+
"three": ">=0.151.3"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "cefaa55c88bbbee734c4be0eafb154225adb20fc"
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventDispatcher, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
|
|
1
|
+
import { EventDispatcher, MOUSE, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
|
|
2
2
|
import { OrbitControlsProperties } from '../Interface';
|
|
3
3
|
declare class OrbitControls extends EventDispatcher implements OrbitControlsProperties {
|
|
4
4
|
object: PerspectiveCamera | OrthographicCamera;
|
|
@@ -40,9 +40,9 @@ declare class OrbitControls extends EventDispatcher implements OrbitControlsProp
|
|
|
40
40
|
BOTTOM: string;
|
|
41
41
|
};
|
|
42
42
|
mouseButtons: {
|
|
43
|
-
LEFT:
|
|
44
|
-
MIDDLE:
|
|
45
|
-
RIGHT:
|
|
43
|
+
LEFT: MOUSE;
|
|
44
|
+
MIDDLE: MOUSE;
|
|
45
|
+
RIGHT: MOUSE;
|
|
46
46
|
};
|
|
47
47
|
touches: {
|
|
48
48
|
ONE: 0 | 1;
|
|
@@ -1,46 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ModelLoadingProgress, ModelLoadingProgressCallback } from '../../Interface';
|
|
3
|
-
import { SbmCache } from '../../Interface/sbmCache';
|
|
1
|
+
import { ModelInfo } from '../../Library';
|
|
4
2
|
declare class SbmLoader {
|
|
5
|
-
materials: Map<string, any>;
|
|
6
|
-
sbmInfo: ModelInfo | null;
|
|
7
|
-
isLE: boolean;
|
|
8
|
-
constructor();
|
|
9
3
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param buffer 模型二进制原数据
|
|
12
|
-
* @param sbmInfo 模型信息
|
|
13
|
-
* @param onProgress 模型加载进度回填函数
|
|
4
|
+
* @todo onProgress
|
|
14
5
|
*/
|
|
15
|
-
parseBuffer(buffer: ArrayBuffer, sbmInfo: ModelInfo, onProgress?: ModelLoadingProgressCallback): Promise<{
|
|
16
|
-
model: Model;
|
|
17
|
-
caches: SbmCache;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* @param dataView
|
|
21
|
-
* @param offset
|
|
22
|
-
* @param onProgress
|
|
23
|
-
*/
|
|
24
|
-
_parseV2(dataView: DataView, offset: number, onProgress?: ModelLoadingProgressCallback): Promise<{
|
|
25
|
-
model: Model;
|
|
26
|
-
caches: SbmCache;
|
|
27
|
-
}>;
|
|
28
6
|
/**
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param onProgress
|
|
7
|
+
* @param buffer
|
|
8
|
+
* @param sbmInfo
|
|
32
9
|
*/
|
|
33
|
-
|
|
34
|
-
model: Model;
|
|
35
|
-
caches: SbmCache;
|
|
10
|
+
parseBuffer(buffer: ArrayBuffer, sbmInfo: ModelInfo): Promise<{
|
|
11
|
+
model: import("../../Library/Model").Model;
|
|
12
|
+
caches: import("../..").SbmCache;
|
|
36
13
|
}>;
|
|
37
|
-
/**
|
|
38
|
-
* 获取材质贴图路径
|
|
39
|
-
* @param modelUrl 模型资源路径
|
|
40
|
-
* @param name 贴图名称
|
|
41
|
-
* @param isPlatform 是否是平台资源
|
|
42
|
-
*/
|
|
43
|
-
getTextureUrl(url: string, textureName: string, isPlatform?: boolean): string;
|
|
44
14
|
}
|
|
45
|
-
export {
|
|
46
|
-
export default SbmLoader;
|
|
15
|
+
export { SbmLoader, };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Model, ModelInfo } from '../../Library';
|
|
2
|
+
import { ModelLoadingProgress, ModelLoadingProgressCallback } from '../../Interface';
|
|
3
|
+
import { SbmCache } from '../../Interface/sbmCache';
|
|
4
|
+
declare class SbmPrivateLoader {
|
|
5
|
+
materials: Map<string, any>;
|
|
6
|
+
sbmInfo: ModelInfo | null;
|
|
7
|
+
isLE: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* 解析模型
|
|
11
|
+
* @param buffer 模型二进制原数据
|
|
12
|
+
* @param sbmInfo 模型信息
|
|
13
|
+
* @param onProgress 模型加载进度回填函数
|
|
14
|
+
*/
|
|
15
|
+
parseBuffer(buffer: ArrayBuffer, sbmInfo: ModelInfo, onProgress?: ModelLoadingProgressCallback): Promise<{
|
|
16
|
+
model: Model;
|
|
17
|
+
caches: SbmCache;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* @param dataView
|
|
21
|
+
* @param offset
|
|
22
|
+
* @param onProgress
|
|
23
|
+
*/
|
|
24
|
+
_parseV2(dataView: DataView, offset: number, onProgress?: ModelLoadingProgressCallback): Promise<{
|
|
25
|
+
model: Model;
|
|
26
|
+
caches: SbmCache;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* @param dataView
|
|
30
|
+
* @param offset
|
|
31
|
+
* @param onProgress
|
|
32
|
+
*/
|
|
33
|
+
_parseV3(dataView: DataView, offset: number, onProgress?: ModelLoadingProgressCallback): Promise<{
|
|
34
|
+
model: Model;
|
|
35
|
+
caches: SbmCache;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* 获取材质贴图路径
|
|
39
|
+
* @param modelUrl 模型资源路径
|
|
40
|
+
* @param name 贴图名称
|
|
41
|
+
* @param isPlatform 是否是平台资源
|
|
42
|
+
*/
|
|
43
|
+
getTextureUrl(url: string, textureName: string, isPlatform?: boolean): string;
|
|
44
|
+
}
|
|
45
|
+
export { ModelLoadingProgress, ModelLoadingProgressCallback, };
|
|
46
|
+
export { SbmPrivateLoader, };
|
|
@@ -2,7 +2,7 @@ import { Model, ModelInfo } from '../../Library';
|
|
|
2
2
|
import { ModelLoadingProgressCallback } from '../../Interface';
|
|
3
3
|
import { SbmCache } from '../../Interface/sbmCache';
|
|
4
4
|
import SDataView from './SDataView';
|
|
5
|
-
declare class
|
|
5
|
+
declare class SbmPublicLoader {
|
|
6
6
|
materials: Map<string, any>;
|
|
7
7
|
sbmInfo: ModelInfo | null;
|
|
8
8
|
constructor();
|
|
@@ -42,4 +42,4 @@ declare class SbkLoader {
|
|
|
42
42
|
*/
|
|
43
43
|
getTextureUrl(url: string, textureName: string, isPlatform?: boolean): string;
|
|
44
44
|
}
|
|
45
|
-
export
|
|
45
|
+
export { SbmPublicLoader, };
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { default as SbmObjectLoader, } from './SbmObjectLoader';
|
|
4
|
-
declare const _default: typeof sbm | typeof sbk;
|
|
5
|
-
export default _default;
|
|
1
|
+
export { SbmLoader, } from './SbmLoader';
|
|
2
|
+
export { SbmObjectLoader, } from './SbmObjectLoader';
|
|
@@ -9,11 +9,11 @@ export declare const isPNG: (textureUrl?: string) => boolean;
|
|
|
9
9
|
* 生成 sbm 纹理
|
|
10
10
|
* @param url
|
|
11
11
|
*/
|
|
12
|
-
export declare const generateSbmTexture: (textureUrl: string) => Texture;
|
|
12
|
+
export declare const generateSbmTexture: (material: MeshStandardMaterial, textureUrl: string) => Texture | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* 生成 sbm 材质
|
|
15
15
|
* @param materialId
|
|
16
16
|
* @param arr
|
|
17
17
|
* @param texture
|
|
18
18
|
*/
|
|
19
|
-
export declare const generateSbmMaterial: (materialId: string, arr: number[],
|
|
19
|
+
export declare const generateSbmMaterial: (materialId: string, arr: number[], transprent: boolean) => MeshStandardMaterial;
|
|
@@ -15,6 +15,7 @@ declare class ModelManage extends DefaultManage {
|
|
|
15
15
|
isDisposed: boolean;
|
|
16
16
|
modelsPromiseMap: Map<string, Promise<Model | null>>;
|
|
17
17
|
modelsMap: Map<string, Model>;
|
|
18
|
+
_dbReady: boolean;
|
|
18
19
|
/**
|
|
19
20
|
* workaround for types
|
|
20
21
|
*/
|
|
@@ -53,6 +54,7 @@ declare class ModelManage extends DefaultManage {
|
|
|
53
54
|
*/
|
|
54
55
|
clearIdb(): Promise<void>;
|
|
55
56
|
dispose(): void;
|
|
57
|
+
_checkDbReady(): Promise<void>;
|
|
56
58
|
/**
|
|
57
59
|
* private methods
|
|
58
60
|
*/
|
|
@@ -3,6 +3,7 @@ import { Mesh, Clock, Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, V
|
|
|
3
3
|
import { EffectComposer } from 'postprocessing';
|
|
4
4
|
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
5
5
|
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
6
|
+
import { AnimationOperate } from '@three3d/animation';
|
|
6
7
|
import Scener from './Scener';
|
|
7
8
|
import { CSS2DRenderer, CSS3DRenderer } from '../Renderer';
|
|
8
9
|
import RendererManager from './RendererManager';
|
|
@@ -16,7 +17,6 @@ import { License } from '../License';
|
|
|
16
17
|
import Info from './Info';
|
|
17
18
|
import { ViewHelper } from './ViewHelper';
|
|
18
19
|
import { WaterMark } from './WaterMark';
|
|
19
|
-
import { AnimationOperate } from '@three3d/animation';
|
|
20
20
|
export declare const innerRenderState: {
|
|
21
21
|
needsUpdate: boolean;
|
|
22
22
|
};
|
package/types/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from './Interface';
|
|
|
33
33
|
export * from './tools';
|
|
34
34
|
import type { AnimationOperate } from '@three3d/animation';
|
|
35
35
|
export * from '@three3d/animation';
|
|
36
|
+
import { Azimuth } from '@three3d/tools';
|
|
36
37
|
export declare class SoonSpace {
|
|
37
38
|
static readonly THREE: typeof THREE;
|
|
38
39
|
readonly THREE: typeof THREE;
|
|
@@ -205,6 +206,10 @@ export declare class SoonSpace {
|
|
|
205
206
|
readonly viewport: Viewport;
|
|
206
207
|
readonly manager: Manager;
|
|
207
208
|
readonly plugins: Record<string, any>;
|
|
209
|
+
/**
|
|
210
|
+
* 方位判断
|
|
211
|
+
*/
|
|
212
|
+
readonly azimuth: Azimuth;
|
|
208
213
|
constructor(param: SoonSpaceConstructor);
|
|
209
214
|
/******/
|
|
210
215
|
/******/
|
package/types/three-patches.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
declare module 'three/src/objects/InstancedMesh' {
|
|
3
|
-
interface InstancedMesh {
|
|
4
|
-
boundingBox: Box3 | null;
|
|
5
|
-
boundingSphere: Sphere | null;
|
|
6
|
-
computeBoundingBox: () => void;
|
|
7
|
-
computeBoundingSphere: () => void;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
export {};
|