soonspacejs 2.4.2 → 2.4.5
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 +5 -12
- package/dist/index.js +5 -12
- package/package.json +4 -8
- package/types/Controls/FullFreeControls.d.ts +1 -0
- package/types/Interface/controls.d.ts +2 -0
- package/types/Interface/events.d.ts +15 -10
- package/types/Interface/viewport.d.ts +4 -0
- package/types/Loader/DatLoader/index.d.ts +8 -5
- package/types/Manager/Canvas3DManage.d.ts +1 -1
- package/types/Manager/DefaultManage.d.ts +0 -17
- package/types/Manager/LightManage.d.ts +6 -6
- package/types/Manager/ModelManage.d.ts +5 -2
- package/types/Manager/PluginObjectManage.d.ts +1 -1
- package/types/Manager/PoiManage.d.ts +1 -1
- package/types/Manager/PoiNodeManage.d.ts +1 -1
- package/types/Manager/SbmManage.d.ts +1 -1
- package/types/Manager/TopologyManage.d.ts +1 -1
- package/types/Manager/index.d.ts +40 -2
- package/types/Shared/index.d.ts +3 -1
- package/types/Shared/task.d.ts +1 -0
- package/types/Viewport/CameraManager.d.ts +2 -2
- package/types/Viewport/index.d.ts +2 -2
- package/types/index.d.ts +89 -1
- package/types/Loader/DatLoader/DatLoader_DEPRECATED.d.ts +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -22,12 +22,8 @@
|
|
|
22
22
|
"author": "xuek",
|
|
23
23
|
"license": "UNLICENSED",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@
|
|
27
|
-
"@tweenjs/tween.js": "18.6.4",
|
|
28
|
-
"@types/three": "0.139.0",
|
|
29
|
-
"localforage": "1.9.0",
|
|
30
|
-
"three": "0.139.0"
|
|
25
|
+
"@tweenjs/tween.js": "^18.6.4",
|
|
26
|
+
"@types/three": "0.141.0"
|
|
31
27
|
},
|
|
32
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "b3d9d2cdea1ab611395f847861d58db5843cd38c"
|
|
33
29
|
}
|
|
@@ -6,6 +6,7 @@ declare class FullFreeControls implements ControlsOptions {
|
|
|
6
6
|
camera: PerspectiveCamera;
|
|
7
7
|
domElement: HTMLElement;
|
|
8
8
|
interactivePosition: Vector3 | null;
|
|
9
|
+
fallbackInteractivePosition: Vector3 | null;
|
|
9
10
|
state: number;
|
|
10
11
|
[x: string]: any;
|
|
11
12
|
constructor(viewport: Viewport, camera: PerspectiveCamera);
|
|
@@ -9,28 +9,33 @@ interface SceneModelIntersect {
|
|
|
9
9
|
model: Sbm | Model;
|
|
10
10
|
sourceData: Intersection;
|
|
11
11
|
}
|
|
12
|
-
interface
|
|
12
|
+
interface ModelEventParams {
|
|
13
13
|
target: Sbm | Model;
|
|
14
14
|
currentTarget: Mesh;
|
|
15
15
|
intersects: SceneModelIntersect[];
|
|
16
|
+
event: MouseEvent | TouchEvent;
|
|
17
|
+
}
|
|
18
|
+
interface PoiEventParams {
|
|
19
|
+
target: Poi;
|
|
20
|
+
event: MouseEvent | TouchEvent;
|
|
16
21
|
}
|
|
17
22
|
interface SceneClickParam {
|
|
18
23
|
type: SceneEventType;
|
|
19
24
|
event: MouseEvent | TouchEvent;
|
|
20
25
|
}
|
|
21
26
|
interface SceneGlobalEvents {
|
|
22
|
-
modelHover?: (param:
|
|
27
|
+
modelHover?: (param: ModelEventParams) => void;
|
|
23
28
|
modelUnHover?: (model: Sbm | Model) => void;
|
|
24
|
-
modelClick?: (param:
|
|
25
|
-
modelRightClick?: (param:
|
|
26
|
-
modelDblClick?: (param:
|
|
27
|
-
poiHover?: (poi:
|
|
29
|
+
modelClick?: (param: ModelEventParams) => void;
|
|
30
|
+
modelRightClick?: (param: ModelEventParams) => void;
|
|
31
|
+
modelDblClick?: (param: ModelEventParams) => void;
|
|
32
|
+
poiHover?: (poi: PoiEventParams) => void;
|
|
28
33
|
poiUnHover?: (poi: Poi) => void;
|
|
29
|
-
poiClick?: (poi:
|
|
30
|
-
poiRightClick?: (poi:
|
|
31
|
-
poiDblClick?: (poi:
|
|
34
|
+
poiClick?: (poi: PoiEventParams) => void;
|
|
35
|
+
poiRightClick?: (poi: PoiEventParams) => void;
|
|
36
|
+
poiDblClick?: (poi: PoiEventParams) => void;
|
|
32
37
|
selectPosition?: (position: Position) => void;
|
|
33
38
|
sceneClick?: (param: SceneClickParam) => void;
|
|
34
39
|
resize?: () => void;
|
|
35
40
|
}
|
|
36
|
-
export { ScenePoiIntersect, SceneModelIntersect,
|
|
41
|
+
export { ScenePoiIntersect, SceneModelIntersect, ModelEventParams, SceneClickParam, SceneGlobalEvents, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { Material } from 'three';
|
|
3
|
+
import localforage from 'localforage';
|
|
3
4
|
export interface SubMesh {
|
|
4
5
|
start: number;
|
|
5
6
|
count: number;
|
|
@@ -34,21 +35,23 @@ export interface MaterialsMapValue {
|
|
|
34
35
|
materialIndex: number;
|
|
35
36
|
}
|
|
36
37
|
declare class DatLoader extends THREE.Loader {
|
|
37
|
-
|
|
38
|
+
readonly store: typeof localforage;
|
|
39
|
+
loadedTextures: Map<string, Promise<any>>;
|
|
38
40
|
loadedMaterialsMap: Map<string, MaterialsMapValue>;
|
|
39
41
|
loadedMaterials: THREE.Material[];
|
|
40
42
|
dracoDecoderPath: string | null;
|
|
41
43
|
workerPool: any;
|
|
42
44
|
workerSourceURL: string;
|
|
43
|
-
constructor();
|
|
45
|
+
constructor(store: typeof localforage);
|
|
44
46
|
/**
|
|
45
47
|
*
|
|
46
48
|
* @param buffer
|
|
47
|
-
* @param
|
|
49
|
+
* @param url
|
|
48
50
|
*/
|
|
49
|
-
parseAsync(buffer: ArrayBuffer,
|
|
51
|
+
parseAsync(buffer: ArrayBuffer, url: string): Promise<THREE.Mesh<THREE.BufferGeometry, THREE.Material[]> | undefined>;
|
|
52
|
+
private _decodeBuffer;
|
|
50
53
|
private _initWorkerCreator;
|
|
51
|
-
private
|
|
54
|
+
private _createMesh;
|
|
52
55
|
/**
|
|
53
56
|
* 创建 material
|
|
54
57
|
* @param path
|
|
@@ -5,6 +5,6 @@ declare class Canvas3DManage extends DefaultManage {
|
|
|
5
5
|
constructor(viewport: Viewport, scene: SceneManage);
|
|
6
6
|
create(info: Canvas3DInfo): Canvas3D;
|
|
7
7
|
createToGroup(groupInfo: GroupInfo, poiInfo: Canvas3DInfo[]): Group;
|
|
8
|
-
addForGroup(
|
|
8
|
+
addForGroup(group: Group | null, poiInfo: Canvas3DInfo[]): Group | null;
|
|
9
9
|
}
|
|
10
10
|
export default Canvas3DManage;
|
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
import { Object3D } from 'three';
|
|
2
2
|
import Viewport from '../Viewport';
|
|
3
3
|
import { Group, GroupInfo, SceneManage, BaseObject3D } from '../Library';
|
|
4
|
-
import { UserDataPropertyFindFunc } from '../Interface';
|
|
5
|
-
declare type findPropKey = 'name' | 'sid';
|
|
6
|
-
declare type ManageCache = {
|
|
7
|
-
objects: Map<BaseObject3D['sid'], Object3D>;
|
|
8
|
-
};
|
|
9
4
|
declare class DefaultManage {
|
|
10
5
|
readonly type: string;
|
|
11
6
|
readonly scene: SceneManage;
|
|
12
7
|
readonly viewport: Viewport;
|
|
13
|
-
readonly cache: ManageCache;
|
|
14
8
|
constructor(type: string, viewport: Viewport, scene: SceneManage);
|
|
15
|
-
/**
|
|
16
|
-
* cache
|
|
17
|
-
*/
|
|
18
|
-
getObjectsCache<T extends Object3D>(sid: BaseObject3D['sid']): T;
|
|
19
|
-
setObjectsCache<T extends Object3D>(objects: T): void;
|
|
20
|
-
removeObjectsCache(sid: BaseObject3D['sid']): void;
|
|
21
9
|
/***
|
|
22
10
|
* group
|
|
23
11
|
*/
|
|
24
12
|
createGroup(groupInfo: GroupInfo, parent?: Object3D | null): Group;
|
|
25
|
-
getById<T extends Object3D>(id: BaseObject3D['sid'], type?: string): T | null;
|
|
26
|
-
getByName<T extends BaseObject3D>(name: string, type?: string): T[];
|
|
27
|
-
getByUserDataProperty<T extends Object3D = BaseObject3D>(propNameOrFindFunc: string | UserDataPropertyFindFunc, propValue?: any): T[];
|
|
28
|
-
removeById(id: BaseObject3D['sid']): boolean;
|
|
29
13
|
clear(): void;
|
|
30
14
|
getAll<T = BaseObject3D>(): T[];
|
|
31
15
|
hideAll(): void;
|
|
32
16
|
showAll(): void;
|
|
33
|
-
_getChildByTypeAndProp<T = BaseObject3D>(type: string, propKey: findPropKey, propVal: any): T[];
|
|
34
17
|
}
|
|
35
18
|
export default DefaultManage;
|
|
@@ -6,17 +6,17 @@ import { SceneManage } from '../Library';
|
|
|
6
6
|
declare class LightManage extends DefaultManage {
|
|
7
7
|
constructor(viewport: Viewport, scene: SceneManage);
|
|
8
8
|
createAmbientLight(options: AmbientLightOptions): AmbientLight;
|
|
9
|
-
setAmbientLight(options: AmbientLightOptions): boolean;
|
|
9
|
+
setAmbientLight(light: AmbientLight | null, options: AmbientLightOptions): boolean;
|
|
10
10
|
createDirectionalLight(options: DirectionalLightOptions): DirectionalLight;
|
|
11
|
-
setDirectionalLight(options: DirectionalLightOptions): boolean;
|
|
11
|
+
setDirectionalLight(light: DirectionalLight | null, options: DirectionalLightOptions): boolean;
|
|
12
12
|
createHemisphereLight(options: HemisphereLightOptions): HemisphereLight;
|
|
13
|
-
setHemisphereLight(options: HemisphereLightOptions): boolean;
|
|
13
|
+
setHemisphereLight(light: HemisphereLight | null, options: HemisphereLightOptions): boolean;
|
|
14
14
|
createSpotLight(options: SpotLightOptions): SpotLight;
|
|
15
|
-
setSpotLight(options: SpotLightOptions): boolean;
|
|
15
|
+
setSpotLight(light: SpotLight | null, options: SpotLightOptions): boolean;
|
|
16
16
|
createPointLight(options: PointLightOptions): PointLight;
|
|
17
|
-
setPointLight(options: PointLightOptions): boolean;
|
|
17
|
+
setPointLight(light: PointLight | null, options: PointLightOptions): boolean;
|
|
18
18
|
createRectAreaLight(options: RectAreaLightOptions): RectAreaLight;
|
|
19
|
-
setRectAreaLight(options: RectAreaLightOptions): boolean;
|
|
19
|
+
setRectAreaLight(light: RectAreaLight | null, options: RectAreaLightOptions): boolean;
|
|
20
20
|
updateAllShadow(): void;
|
|
21
21
|
}
|
|
22
22
|
export default LightManage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LoadingManager } from 'three';
|
|
2
2
|
import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
|
|
3
3
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
4
|
-
import
|
|
4
|
+
import localforage from 'localforage';
|
|
5
5
|
import { DatLoader } from '../Loader/DatLoader';
|
|
6
6
|
import DefaultManage from './DefaultManage';
|
|
7
7
|
import { BaseObject3D, Group, GroupInfo, Model, ModelInfo, SceneManage } from '../Library';
|
|
@@ -10,6 +10,9 @@ import Viewport from '../Viewport';
|
|
|
10
10
|
declare class ModelManage extends DefaultManage {
|
|
11
11
|
readonly viewport: Viewport;
|
|
12
12
|
modelMaps: Map<string, Model>;
|
|
13
|
+
/**
|
|
14
|
+
* workaround for types
|
|
15
|
+
*/
|
|
13
16
|
store: typeof localforage;
|
|
14
17
|
loadingManager: LoadingManager;
|
|
15
18
|
datLoader: DatLoader;
|
|
@@ -40,7 +43,7 @@ declare class ModelManage extends DefaultManage {
|
|
|
40
43
|
parse(format: string, buffer: ArrayBuffer, modelInfo: ModelInfo): Promise<Model>;
|
|
41
44
|
clone(model: Model, info: CloneModelInfo, parent?: BaseObject3D | null): Promise<Model>;
|
|
42
45
|
loadToGroup(groupInfo: GroupInfo, modelInfo: ModelInfo[]): Promise<Group>;
|
|
43
|
-
addForGroup(
|
|
46
|
+
addForGroup(group: Group | null, modelInfo: ModelInfo[]): Promise<Group | null>;
|
|
44
47
|
/**
|
|
45
48
|
* 清空本地模型缓存数据
|
|
46
49
|
*/
|
|
@@ -5,6 +5,6 @@ import Viewport from '../Viewport';
|
|
|
5
5
|
declare class PluginManage extends DefaultManage {
|
|
6
6
|
constructor(viewport: Viewport, scene: SceneManage);
|
|
7
7
|
createObject(info: PluginObjectInfo, object?: Object3D): PluginObject;
|
|
8
|
-
addToObject(
|
|
8
|
+
addToObject(pluginObject: PluginObject | null, object: Object3D): PluginObject | null;
|
|
9
9
|
}
|
|
10
10
|
export default PluginManage;
|
|
@@ -9,7 +9,7 @@ declare class PoiManage extends DefaultManage {
|
|
|
9
9
|
create(info: PoiInfo): Poi;
|
|
10
10
|
clone(poi: Poi, poiInfo: ClonePoiInfo, parent?: BaseObject3D | null): Poi | void;
|
|
11
11
|
createToGroup(groupInfo: GroupInfo, poiInfo: PoiInfo[]): Group;
|
|
12
|
-
addForGroup(
|
|
12
|
+
addForGroup(group: Group | null, poiInfo: PoiInfo[]): Group | null;
|
|
13
13
|
_createMaterial(url: PoiInfo['url']): SpriteMaterial;
|
|
14
14
|
private _copyMaterial;
|
|
15
15
|
}
|
|
@@ -5,7 +5,7 @@ declare class PoiNodeManage extends DefaultManage {
|
|
|
5
5
|
constructor(viewport: Viewport, scene: SceneManage);
|
|
6
6
|
create(info: PoiNodeInfo): PoiNode;
|
|
7
7
|
createToGroup(groupInfo: GroupInfo, poiNodeInfo: PoiNodeInfo[]): Group;
|
|
8
|
-
addForGroup(
|
|
8
|
+
addForGroup(group: Group | null, poiNodeInfo: PoiNodeInfo[]): Group | null;
|
|
9
9
|
_openEnableRenderCss(info: PoiNodeInfo): void;
|
|
10
10
|
}
|
|
11
11
|
export default PoiNodeManage;
|
|
@@ -13,7 +13,7 @@ declare class SbmManage extends DefaultManage {
|
|
|
13
13
|
parse(data: ArrayBuffer | SbmCache, sbmInfo: SbmInfo, onProgress?: ModelLoadingProgressCallback): Promise<Sbm>;
|
|
14
14
|
clone(model: Sbm, sbmInfo: CloneSbmInfo, parent?: BaseObject3D | null): Promise<Sbm>;
|
|
15
15
|
loadToGroup(groupInfo: GroupInfo, sbmInfoList: SbmInfo[], onProgress?: GroupProgressCallback): Promise<Group>;
|
|
16
|
-
addForGroup(
|
|
16
|
+
addForGroup(group: Group | null, sbmInfoList: SbmInfo[], onProgress?: GroupProgressCallback): Promise<Group | null>;
|
|
17
17
|
createGroupFromXml(groupInfo: GroupInfo, url: string): Promise<Group>;
|
|
18
18
|
/**
|
|
19
19
|
* 清空本地模型缓存数据
|
|
@@ -10,7 +10,7 @@ declare class TopologyManage extends DefaultManage {
|
|
|
10
10
|
create(topologyInfo: TopologyInfo): Topology;
|
|
11
11
|
resetNodes(topology: Topology, nodes: TopologyNodeInfo[]): Topology;
|
|
12
12
|
createToGroup(groupInfo: GroupInfo, topologyInfos: TopologyInfo[]): Group;
|
|
13
|
-
addForGroup(
|
|
13
|
+
addForGroup(group: Group | null, topologyInfos: TopologyInfo[]): Group | null;
|
|
14
14
|
getShortestPath(topology: Topology, info: ShortestPathInfo): Topology | null;
|
|
15
15
|
getShortestPathByMultipleStartPoints(topology: Topology, info: ShortestPathByMultipleStartPoints): Topology | null;
|
|
16
16
|
getShortestPathByMultipleEndPoints(topology: Topology, info: ShortestPathByMultipleEndPoints): Topology | null;
|
package/types/Manager/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
1
2
|
import Viewport from '../Viewport';
|
|
2
|
-
import { SceneManage } from '../Library';
|
|
3
|
+
import { BaseObject3D, SceneManage } from '../Library';
|
|
3
4
|
import LightManage from './LightManage';
|
|
4
5
|
import SbmManage from './SbmManage';
|
|
5
6
|
import ModelManage from './ModelManage';
|
|
@@ -10,6 +11,7 @@ import TopologyManage from './TopologyManage';
|
|
|
10
11
|
import HelperManage from './HelperManage';
|
|
11
12
|
import PluginObjectManage from './PluginObjectManage';
|
|
12
13
|
import GroupManage from './GroupManage';
|
|
14
|
+
import { UserDataPropertyFindFunc } from '../Interface';
|
|
13
15
|
interface ManagerStore {
|
|
14
16
|
groupManager: GroupManage;
|
|
15
17
|
lightManager: LightManage;
|
|
@@ -22,13 +24,49 @@ interface ManagerStore {
|
|
|
22
24
|
helperManager: HelperManage;
|
|
23
25
|
pluginObjectManager: PluginObjectManage;
|
|
24
26
|
}
|
|
27
|
+
declare type ManageCache = {
|
|
28
|
+
objects: Map<BaseObject3D['sid'], Object3D>;
|
|
29
|
+
};
|
|
25
30
|
declare class Manager {
|
|
26
31
|
readonly viewport: Viewport;
|
|
27
|
-
readonly scene: SceneManage;
|
|
28
32
|
readonly store: ManagerStore;
|
|
33
|
+
readonly cache: ManageCache;
|
|
34
|
+
readonly scene: SceneManage;
|
|
29
35
|
constructor(viewport: Viewport);
|
|
36
|
+
/**
|
|
37
|
+
* level update
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
30
40
|
levelUpdate(): void;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* frame update
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
31
46
|
update(): void;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* objects
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
getObjectById<T extends Object3D>(id: BaseObject3D['sid']): T | null;
|
|
53
|
+
getObjectByName<T extends Object3D>(name: string): T[];
|
|
54
|
+
getObjectByUserDataProperty<T extends Object3D>(propNameOrFindFunc: string | UserDataPropertyFindFunc, propValue?: any): T[];
|
|
55
|
+
removeObjectById(id: BaseObject3D['sid']): boolean;
|
|
56
|
+
_getObjectByProps<T extends Object3D>(key: 'sid' | 'name', value: any): T[];
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* cache
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
getObjectCache<T extends Object3D>(sid: BaseObject3D['sid']): T | undefined;
|
|
63
|
+
setObjectCache<T extends Object3D>(object?: T): void;
|
|
64
|
+
deleteObjectCache<T extends Object3D>(object?: T): void;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* clear object
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
32
70
|
clearObject(): void;
|
|
33
71
|
clear(): void;
|
|
34
72
|
dispose(): void;
|
package/types/Shared/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const isString: (val: unknown) => val is string;
|
|
|
3
3
|
declare const isBoolean: (val: unknown) => val is boolean;
|
|
4
4
|
declare const isNumber: (val: unknown) => val is number;
|
|
5
5
|
declare const isNull: (val: unknown) => val is null;
|
|
6
|
+
declare const isUndefined: (val: unknown) => val is null;
|
|
6
7
|
declare const isSymbol: (val: unknown) => val is symbol;
|
|
7
8
|
declare const isDate: (val: unknown) => val is Date;
|
|
8
9
|
declare const isArray: (arg: any) => arg is any[];
|
|
@@ -20,7 +21,8 @@ export * from './path';
|
|
|
20
21
|
export * from './cloneDeep';
|
|
21
22
|
export * from './material';
|
|
22
23
|
export * from './network';
|
|
24
|
+
export * from './task';
|
|
23
25
|
export { hasOwn, };
|
|
24
|
-
export { isString, isBoolean, isNumber, isNull, isSymbol, };
|
|
26
|
+
export { isString, isBoolean, isNumber, isNull, isUndefined, isSymbol, };
|
|
25
27
|
export { isDate, isArray, isObject, isFunction, isPromise, };
|
|
26
28
|
export { getValueType, sleep, getAsciiString, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const idleTask: (callback: () => void) => void;
|
|
@@ -2,7 +2,7 @@ import { Box3, PerspectiveCamera, Vector3, Euler, Object3D } from 'three';
|
|
|
2
2
|
import { Rotation, Position, AnimationOptions, FlyToViewpoint, CameraViewpointData, FlyToObjOptions, SurroundOptions, LabelOptions } from '../Interface';
|
|
3
3
|
import { BaseObject3D, BaseMesh } from '../Library';
|
|
4
4
|
import Viewport from '.';
|
|
5
|
-
declare class
|
|
5
|
+
declare class CameraManager {
|
|
6
6
|
viewport: Viewport;
|
|
7
7
|
mainCamera: PerspectiveCamera;
|
|
8
8
|
currentCamera: PerspectiveCamera;
|
|
@@ -26,4 +26,4 @@ declare class cameraManager {
|
|
|
26
26
|
getMovePosByBBox(bbox: Box3): Vector3;
|
|
27
27
|
getObjectLabelPos(bbox: Box3 | BaseObject3D, rotation?: FlyToViewpoint | Rotation | Euler, options?: LabelOptions): Position;
|
|
28
28
|
}
|
|
29
|
-
export default
|
|
29
|
+
export default CameraManager;
|
|
@@ -39,6 +39,7 @@ declare class Viewport {
|
|
|
39
39
|
effectManager: EffectManager;
|
|
40
40
|
effectComposer: EffectComposer;
|
|
41
41
|
mixer: AnimationMixer;
|
|
42
|
+
viewHelper: ViewHelper;
|
|
42
43
|
/**
|
|
43
44
|
* render 前回调
|
|
44
45
|
*/
|
|
@@ -50,7 +51,6 @@ declare class Viewport {
|
|
|
50
51
|
private selectModel;
|
|
51
52
|
private selectPoi;
|
|
52
53
|
private _loop;
|
|
53
|
-
viewHelper: ViewHelper;
|
|
54
54
|
constructor(options: ViewportOptions);
|
|
55
55
|
_initInfo(): void;
|
|
56
56
|
_initStats(): void;
|
|
@@ -60,7 +60,7 @@ declare class Viewport {
|
|
|
60
60
|
*/
|
|
61
61
|
setSobel(): void;
|
|
62
62
|
setBloom(): void;
|
|
63
|
-
setSSAO(options
|
|
63
|
+
setSSAO(options?: SSAOOptions): void;
|
|
64
64
|
/**
|
|
65
65
|
***************************** renderer ***************************
|
|
66
66
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -32,6 +32,85 @@ declare global {
|
|
|
32
32
|
}
|
|
33
33
|
export default class SoonSpace {
|
|
34
34
|
static readonly THREE: typeof THREE;
|
|
35
|
+
static readonly TWEEN: {
|
|
36
|
+
Easing: {
|
|
37
|
+
Linear: {
|
|
38
|
+
None: (amount: number) => number;
|
|
39
|
+
};
|
|
40
|
+
Quadratic: {
|
|
41
|
+
In: (amount: number) => number;
|
|
42
|
+
Out: (amount: number) => number;
|
|
43
|
+
InOut: (amount: number) => number;
|
|
44
|
+
};
|
|
45
|
+
Cubic: {
|
|
46
|
+
In: (amount: number) => number;
|
|
47
|
+
Out: (amount: number) => number;
|
|
48
|
+
InOut: (amount: number) => number;
|
|
49
|
+
};
|
|
50
|
+
Quartic: {
|
|
51
|
+
In: (amount: number) => number;
|
|
52
|
+
Out: (amount: number) => number;
|
|
53
|
+
InOut: (amount: number) => number;
|
|
54
|
+
};
|
|
55
|
+
Quintic: {
|
|
56
|
+
In: (amount: number) => number;
|
|
57
|
+
Out: (amount: number) => number;
|
|
58
|
+
InOut: (amount: number) => number;
|
|
59
|
+
};
|
|
60
|
+
Sinusoidal: {
|
|
61
|
+
In: (amount: number) => number;
|
|
62
|
+
Out: (amount: number) => number;
|
|
63
|
+
InOut: (amount: number) => number;
|
|
64
|
+
};
|
|
65
|
+
Exponential: {
|
|
66
|
+
In: (amount: number) => number;
|
|
67
|
+
Out: (amount: number) => number;
|
|
68
|
+
InOut: (amount: number) => number;
|
|
69
|
+
};
|
|
70
|
+
Circular: {
|
|
71
|
+
In: (amount: number) => number;
|
|
72
|
+
Out: (amount: number) => number;
|
|
73
|
+
InOut: (amount: number) => number;
|
|
74
|
+
};
|
|
75
|
+
Elastic: {
|
|
76
|
+
In: (amount: number) => number;
|
|
77
|
+
Out: (amount: number) => number;
|
|
78
|
+
InOut: (amount: number) => number;
|
|
79
|
+
};
|
|
80
|
+
Back: {
|
|
81
|
+
In: (amount: number) => number;
|
|
82
|
+
Out: (amount: number) => number;
|
|
83
|
+
InOut: (amount: number) => number;
|
|
84
|
+
};
|
|
85
|
+
Bounce: {
|
|
86
|
+
In: (amount: number) => number;
|
|
87
|
+
Out: (amount: number) => number;
|
|
88
|
+
InOut: (amount: number) => number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
Group: typeof import("@tweenjs/tween.js").Group;
|
|
92
|
+
Interpolation: {
|
|
93
|
+
Linear: (v: number[], k: number) => number;
|
|
94
|
+
Bezier: (v: number[], k: number) => number;
|
|
95
|
+
CatmullRom: (v: number[], k: number) => number;
|
|
96
|
+
Utils: {
|
|
97
|
+
Linear: (p0: number, p1: number, t: number) => number;
|
|
98
|
+
Bernstein: (n: number, i: number) => number;
|
|
99
|
+
Factorial: (n: number) => number;
|
|
100
|
+
CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
now: () => number;
|
|
104
|
+
Sequence: typeof import("@tweenjs/tween.js").Sequence;
|
|
105
|
+
nextId: typeof import("@tweenjs/tween.js").Sequence.nextId;
|
|
106
|
+
Tween: typeof import("@tweenjs/tween.js").Tween;
|
|
107
|
+
VERSION: string;
|
|
108
|
+
getAll: () => import("@tweenjs/tween.js").Tween<Record<string, any>>[];
|
|
109
|
+
removeAll: () => void;
|
|
110
|
+
add: (tween: import("@tweenjs/tween.js").Tween<Record<string, any>>) => void;
|
|
111
|
+
remove: (tween: import("@tweenjs/tween.js").Tween<Record<string, any>>) => void;
|
|
112
|
+
update: (time?: number | undefined, preserve?: boolean | undefined) => boolean;
|
|
113
|
+
};
|
|
35
114
|
readonly THREE: typeof THREE;
|
|
36
115
|
readonly THREE_PLUGINS: {
|
|
37
116
|
TransformControls: typeof TransformControls;
|
|
@@ -118,7 +197,7 @@ export default class SoonSpace {
|
|
|
118
197
|
* @param bloom
|
|
119
198
|
*/
|
|
120
199
|
setBloom(): void;
|
|
121
|
-
setSSAO(options
|
|
200
|
+
setSSAO(options?: SSAOOptions): void;
|
|
122
201
|
/**
|
|
123
202
|
* 设置场景的颜色空间
|
|
124
203
|
* @param colorSpace
|
|
@@ -457,6 +536,15 @@ export default class SoonSpace {
|
|
|
457
536
|
updateAllShadow(): void;
|
|
458
537
|
/******/
|
|
459
538
|
/******/
|
|
539
|
+
/******* Object methods */
|
|
540
|
+
/******/
|
|
541
|
+
/******/
|
|
542
|
+
getObjectById<T extends Object3D = BaseObject3D>(id: BaseObject3DInfo['id']): T | null;
|
|
543
|
+
getObjectByName<T extends Object3D = BaseObject3D>(name: string): T[];
|
|
544
|
+
getObjectByUserDataProperty<T extends Object3D = BaseObject3D>(property: string | UserDataPropertyFindFunc, value: any): T[];
|
|
545
|
+
removeObjectById(id: BaseObject3DInfo['id']): boolean;
|
|
546
|
+
/******/
|
|
547
|
+
/******/
|
|
460
548
|
/******* Group methods */
|
|
461
549
|
/******/
|
|
462
550
|
/******/
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Material } from 'three';
|
|
3
|
-
export interface TexturesIndexes {
|
|
4
|
-
name: string;
|
|
5
|
-
base_map: string;
|
|
6
|
-
nor_map: string;
|
|
7
|
-
color: {
|
|
8
|
-
r: number;
|
|
9
|
-
g: number;
|
|
10
|
-
b: number;
|
|
11
|
-
a: number;
|
|
12
|
-
};
|
|
13
|
-
metallic: number;
|
|
14
|
-
roughness: number;
|
|
15
|
-
alphamode: number;
|
|
16
|
-
use_list: string[];
|
|
17
|
-
}
|
|
18
|
-
export interface MaterialsMapValue {
|
|
19
|
-
material: Material;
|
|
20
|
-
materialIndex: number;
|
|
21
|
-
}
|
|
22
|
-
declare class DatLoader extends THREE.Loader {
|
|
23
|
-
loadedTextures: Set<string>;
|
|
24
|
-
loadedMaterialsMap: Map<string, MaterialsMapValue>;
|
|
25
|
-
loadedMaterials: THREE.Material[];
|
|
26
|
-
constructor();
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param buffer
|
|
30
|
-
* @param path
|
|
31
|
-
*/
|
|
32
|
-
parseAsync(buffer: ArrayBuffer, path: string): Promise<THREE.Mesh<THREE.BufferGeometry, THREE.Material[]>>;
|
|
33
|
-
private _createMeshByStream;
|
|
34
|
-
/**
|
|
35
|
-
* 创建 material
|
|
36
|
-
* @param path
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
private _createMaterial;
|
|
40
|
-
}
|
|
41
|
-
export { DatLoader, };
|
|
42
|
-
export interface SubMesh {
|
|
43
|
-
start: number;
|
|
44
|
-
count: number;
|
|
45
|
-
uuid: string;
|
|
46
|
-
alphaMode: number;
|
|
47
|
-
}
|
|
48
|
-
export interface ChunkInfo {
|
|
49
|
-
position: Float32Array;
|
|
50
|
-
normal: Int8Array;
|
|
51
|
-
color: Uint8Array;
|
|
52
|
-
texcoord: Float32Array;
|
|
53
|
-
indice: Uint32Array;
|
|
54
|
-
sub_mesh: SubMesh[];
|
|
55
|
-
}
|
|
56
|
-
export declare const parseChunk: (arraybuffer: ArrayBuffer) => {
|
|
57
|
-
position: Float32Array;
|
|
58
|
-
normal: Int8Array;
|
|
59
|
-
color: Uint8Array;
|
|
60
|
-
texcoord: Float32Array;
|
|
61
|
-
indice: Uint32Array;
|
|
62
|
-
sub_mesh: {
|
|
63
|
-
start: number;
|
|
64
|
-
count: number;
|
|
65
|
-
uuid: string;
|
|
66
|
-
alphaMode: number;
|
|
67
|
-
}[];
|
|
68
|
-
};
|