soonspacejs 2.11.44 → 2.11.45
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 +3 -3
- package/package.json +2 -2
- package/types/Constants/index.d.ts +3 -2
- package/types/Manager/ModelManage.d.ts +35 -0
- package/types/Viewport/RendererManager.d.ts +1 -3
- package/types/Viewport/ViewHelper.d.ts +2 -3
- package/types/Viewport/index.d.ts +2 -6
- package/types/index.d.ts +8 -10
- package/types/Viewport/SoonGISManager/coords-to-matrix.d.ts +0 -8
- package/types/Viewport/SoonGISManager/index.d.ts +0 -42
- package/types/Viewport/SoonGISManager/sync-camera.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.45",
|
|
4
4
|
"homepage": "https://www.xwbuilders.com/soonspacejs/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"three": ">=0.155.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ca9a3e502e638afcd979543604db399e5ca9b0be"
|
|
31
31
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { LoadingManager, Object3D } from 'three';
|
|
2
2
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
3
|
+
import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';
|
|
3
4
|
import localforage from 'localforage';
|
|
4
5
|
import { FBXLoader } from '../Loader/FBXLoader.js';
|
|
6
|
+
import { OBJLoader } from '../Loader/OBJLoader.js';
|
|
5
7
|
import Viewport from '../Viewport';
|
|
6
8
|
import { Group, GroupInfo, Model, ModelInfo } from '../Library';
|
|
7
9
|
import { CloneModelInfo, ManageCache } from '../Interface';
|
|
@@ -24,6 +26,8 @@ declare class ModelManage extends DefaultManage {
|
|
|
24
26
|
loadingManager: LoadingManager;
|
|
25
27
|
gltfLoader: GLTFLoader;
|
|
26
28
|
fbxLoader: FBXLoader;
|
|
29
|
+
objLoader: OBJLoader;
|
|
30
|
+
stlLoader: STLLoader;
|
|
27
31
|
constructor(viewport: Viewport, cache: ManageCache);
|
|
28
32
|
/**
|
|
29
33
|
* 设置 draco path
|
|
@@ -59,10 +63,41 @@ declare class ModelManage extends DefaultManage {
|
|
|
59
63
|
*/
|
|
60
64
|
private _initLoadingManager;
|
|
61
65
|
private _setModelsMap;
|
|
66
|
+
/**
|
|
67
|
+
* 解析 sbm 格式
|
|
68
|
+
* @param modelInfo
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
62
71
|
private _parseSbm;
|
|
72
|
+
/**
|
|
73
|
+
* 解析 sbmx 格式
|
|
74
|
+
* @param modelInfo
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
63
77
|
private _parseSbmx;
|
|
78
|
+
/**
|
|
79
|
+
* 解析 gltf、glb 格式
|
|
80
|
+
* @param modelInfo
|
|
81
|
+
* @param _buffer
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
64
84
|
private _parseGltf;
|
|
85
|
+
/**
|
|
86
|
+
* 解析 fbx 格式
|
|
87
|
+
* @param modelInfo
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
65
90
|
private _parseFbx;
|
|
91
|
+
/**
|
|
92
|
+
* 解析 obj 格式
|
|
93
|
+
* @param modelInfo
|
|
94
|
+
*/
|
|
95
|
+
private _parseObj;
|
|
96
|
+
/**
|
|
97
|
+
* 解析 stl 格式
|
|
98
|
+
* @param modelInfo
|
|
99
|
+
*/
|
|
100
|
+
private _parseStl;
|
|
66
101
|
private _innerLoad;
|
|
67
102
|
private _fetchBuffer;
|
|
68
103
|
private _getBuffer;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { WebGLRenderer } from 'three';
|
|
2
|
-
import type SoonGIS from 'soongis';
|
|
3
2
|
import { CSS2DRenderer, CSS3DRenderer } from '../Renderer';
|
|
4
3
|
import { InternalOptions } from '../Interface';
|
|
5
4
|
import Viewport from '.';
|
|
6
5
|
declare class RendererManager {
|
|
7
6
|
readonly viewport: Viewport;
|
|
8
|
-
readonly soongis?: SoonGIS | undefined;
|
|
9
7
|
internalOptions: InternalOptions;
|
|
10
8
|
renderer: WebGLRenderer;
|
|
11
9
|
container: HTMLElement;
|
|
12
10
|
interactiveContainer: HTMLElement;
|
|
13
11
|
rendererCSS2D: CSS2DRenderer;
|
|
14
12
|
rendererCSS3D: CSS3DRenderer;
|
|
15
|
-
constructor(viewport: Viewport
|
|
13
|
+
constructor(viewport: Viewport);
|
|
16
14
|
setInternalState(name: keyof InternalOptions, state: boolean): void;
|
|
17
15
|
_initContainer(): HTMLElement;
|
|
18
16
|
_initRenderer(): WebGLRenderer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Camera, WebGLRenderer } from 'three';
|
|
1
|
+
import { Camera, Object3D, WebGLRenderer } from 'three';
|
|
3
2
|
import { Controls } from '../Controls';
|
|
4
|
-
declare class ViewHelper extends
|
|
3
|
+
declare class ViewHelper extends Object3D {
|
|
5
4
|
camera: Camera;
|
|
6
5
|
controls: Controls;
|
|
7
6
|
render: (renderer: WebGLRenderer) => void;
|
|
@@ -4,10 +4,8 @@ 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
6
|
import { AnimationOperate } from '@three3d/animation';
|
|
7
|
-
import type SoonGIS from 'soongis';
|
|
8
7
|
import Scener from './Scener';
|
|
9
8
|
import { CSS2DRenderer, CSS3DRenderer } from '../Renderer';
|
|
10
|
-
import SoonGISManager from './SoonGISManager';
|
|
11
9
|
import RendererManager from './RendererManager';
|
|
12
10
|
import CameraManager from './CameraManager';
|
|
13
11
|
import EffectManager from './EffectManager';
|
|
@@ -22,7 +20,6 @@ export declare const innerRenderState: {
|
|
|
22
20
|
needsUpdate: boolean;
|
|
23
21
|
};
|
|
24
22
|
declare class Viewport {
|
|
25
|
-
readonly soongis?: SoonGIS | undefined;
|
|
26
23
|
clock: Clock;
|
|
27
24
|
raycaster: Raycaster;
|
|
28
25
|
options: ViewportOptions;
|
|
@@ -49,8 +46,7 @@ declare class Viewport {
|
|
|
49
46
|
mixer: AnimationMixer;
|
|
50
47
|
clipsSet: Set<AnimationClip>;
|
|
51
48
|
viewHelper: ViewHelper;
|
|
52
|
-
|
|
53
|
-
eventHandler: EventHandler | undefined;
|
|
49
|
+
eventHandler: EventHandler;
|
|
54
50
|
/**
|
|
55
51
|
* render 前回调(每帧执行)
|
|
56
52
|
*/
|
|
@@ -61,7 +57,7 @@ declare class Viewport {
|
|
|
61
57
|
postRender: Map<string | number, () => void>;
|
|
62
58
|
private _loop;
|
|
63
59
|
resizeObserver: ResizeObserver;
|
|
64
|
-
constructor(options: ViewportOptions
|
|
60
|
+
constructor(options: ViewportOptions);
|
|
65
61
|
_initInfo(): void;
|
|
66
62
|
_initStats(): void;
|
|
67
63
|
/**
|
package/types/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import * as THREE from 'three';
|
|
10
10
|
import { Object3D, Vector3, Euler, Box3, AnimationClip, Light, Texture, Mesh, Skeleton } from 'three';
|
|
11
11
|
import type { Camera } from 'three';
|
|
12
|
-
import type SoonGIS from 'soongis';
|
|
13
12
|
import * as shared from './Shared';
|
|
14
13
|
import Animation from './Animation';
|
|
15
14
|
import { PathAnimation, PathAnimationOptions } from './Animation/path-animation';
|
|
@@ -17,7 +16,6 @@ import { CreatePathAnimationOptions, CreatePathAnimationActionForCameraOptions,
|
|
|
17
16
|
import * as library from './Library';
|
|
18
17
|
import { BaseObject3D, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo, DecalInfo, Decal, DecalGeometryInfo } from './Library';
|
|
19
18
|
import { Controls } from './Controls';
|
|
20
|
-
import SoonGISManager from './Viewport/SoonGISManager';
|
|
21
19
|
import Viewport from './Viewport';
|
|
22
20
|
import Manager from './Manager';
|
|
23
21
|
import { BaseObjectInfo, ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, ModelAnimationFindFunc, TopologyNodeInfo, FlyToViewpoint, FlyToOptions, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, IColorSpace, ToneMappingOptions, SSROptions, SSAOOptions, BloomOptions, IVector3, EnvironmentOptions, PluginsConstructorWithOptions, TopologyPassableInfo, CameraViewpointData, CameraViewpointDataLegacy, CameraType } from './Interface';
|
|
@@ -30,7 +28,6 @@ export interface SoonSpaceConstructor {
|
|
|
30
28
|
el?: string | HTMLElement;
|
|
31
29
|
options?: InitOptions;
|
|
32
30
|
events?: InitEvents;
|
|
33
|
-
soongis?: SoonGIS;
|
|
34
31
|
}
|
|
35
32
|
export * from './Library';
|
|
36
33
|
export * from './Interface';
|
|
@@ -54,6 +51,9 @@ export declare class SoonSpace {
|
|
|
54
51
|
Cubic: {
|
|
55
52
|
In: (amount: number) => number;
|
|
56
53
|
Out: (amount: number) => number;
|
|
54
|
+
/******* Init methods */
|
|
55
|
+
/******/
|
|
56
|
+
/******/
|
|
57
57
|
InOut: (amount: number) => number;
|
|
58
58
|
};
|
|
59
59
|
Quartic: {
|
|
@@ -63,9 +63,7 @@ export declare class SoonSpace {
|
|
|
63
63
|
};
|
|
64
64
|
Quintic: {
|
|
65
65
|
In: (amount: number) => number;
|
|
66
|
-
Out: (amount: number) => number;
|
|
67
|
-
/******/
|
|
68
|
-
/******/
|
|
66
|
+
Out: (amount: number) => number;
|
|
69
67
|
InOut: (amount: number) => number;
|
|
70
68
|
};
|
|
71
69
|
Sinusoidal: {
|
|
@@ -135,6 +133,9 @@ export declare class SoonSpace {
|
|
|
135
133
|
Cubic: {
|
|
136
134
|
In: (amount: number) => number;
|
|
137
135
|
Out: (amount: number) => number;
|
|
136
|
+
/******* Init methods */
|
|
137
|
+
/******/
|
|
138
|
+
/******/
|
|
138
139
|
InOut: (amount: number) => number;
|
|
139
140
|
};
|
|
140
141
|
Quartic: {
|
|
@@ -144,9 +145,7 @@ export declare class SoonSpace {
|
|
|
144
145
|
};
|
|
145
146
|
Quintic: {
|
|
146
147
|
In: (amount: number) => number;
|
|
147
|
-
Out: (amount: number) => number;
|
|
148
|
-
/******/
|
|
149
|
-
/******/
|
|
148
|
+
Out: (amount: number) => number;
|
|
150
149
|
InOut: (amount: number) => number;
|
|
151
150
|
};
|
|
152
151
|
Sinusoidal: {
|
|
@@ -231,7 +230,6 @@ export declare class SoonSpace {
|
|
|
231
230
|
readonly library: typeof library;
|
|
232
231
|
readonly signals: SignalsState;
|
|
233
232
|
readonly controls: Controls;
|
|
234
|
-
readonly soongisManager: SoonGISManager;
|
|
235
233
|
readonly viewport: Viewport;
|
|
236
234
|
readonly manager: Manager;
|
|
237
235
|
readonly plugins: Record<string, any>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MercatorCoordinate } from 'maplibre-gl';
|
|
2
|
-
export type Coordinate = {
|
|
3
|
-
longitude: number;
|
|
4
|
-
latitude: number;
|
|
5
|
-
altitude: number;
|
|
6
|
-
};
|
|
7
|
-
/** calculate Matrix4 from coordinates */
|
|
8
|
-
export declare function coordsToMatrix({ longitude, latitude, altitude, }: Coordinate, fromLngLat: typeof MercatorCoordinate.fromLngLat): import("three").Matrix4Tuple;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { PerspectiveCamera, Vector3 } from 'three';
|
|
2
|
-
import type { Map, MercatorCoordinate } from 'maplibre-gl';
|
|
3
|
-
import type SoonGIS from 'soongis';
|
|
4
|
-
import Viewport from '..';
|
|
5
|
-
import { IVector3 } from '../..';
|
|
6
|
-
import { Coordinate } from './coords-to-matrix';
|
|
7
|
-
declare class SoonGISManager {
|
|
8
|
-
readonly viewport: Viewport;
|
|
9
|
-
readonly soongis?: SoonGIS | undefined;
|
|
10
|
-
readonly SOONSPACE_LAYER_ID = "SOONSPACE_LAYER";
|
|
11
|
-
readonly map: Map | undefined;
|
|
12
|
-
readonly camera: PerspectiveCamera;
|
|
13
|
-
readonly _basisCoordinate: Coordinate;
|
|
14
|
-
readonly _basisMercatorCoordinate: MercatorCoordinate | undefined;
|
|
15
|
-
readonly _mapResize: () => void;
|
|
16
|
-
constructor(viewport: Viewport, soongis?: SoonGIS | undefined);
|
|
17
|
-
/**
|
|
18
|
-
* 从笛卡尔转经纬度
|
|
19
|
-
* @param position
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
fromPositionToCoordinate(position: IVector3): Coordinate | null;
|
|
23
|
-
/**
|
|
24
|
-
* 从经纬度转笛卡尔
|
|
25
|
-
* @param coordinates
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
fromCoordinateToPosition(coordinate: Coordinate): Vector3 | null;
|
|
29
|
-
/**
|
|
30
|
-
* 设置经纬度、海拔
|
|
31
|
-
* @param coordinates
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* 使用 map 的 render 代替 soonspace render
|
|
35
|
-
*/
|
|
36
|
-
triggerRender(): void;
|
|
37
|
-
dispose(): void;
|
|
38
|
-
_initialize(): void;
|
|
39
|
-
_initSspSetting(): void;
|
|
40
|
-
_initLayer(): void;
|
|
41
|
-
}
|
|
42
|
-
export default SoonGISManager;
|