soonspacejs 2.5.15 → 2.5.17
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 -5
- package/package.json +3 -2
- package/types/Manager/ModelManage.d.ts +4 -0
- package/types/Math/bvh/GenerateMeshBVHWorker.d.ts +1 -0
- package/types/Math/dijkstra/index.d.ts +6 -5
- package/types/Shared/MinHeap.d.ts +13 -11
- package/types/Viewport/index.d.ts +1 -1
- package/types/index.d.ts +81 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.17",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
"author": "xuek",
|
|
23
23
|
"license": "UNLICENSED",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@robotlegsjs/signals": "^1.1.0",
|
|
25
26
|
"@tweenjs/tween.js": "^18.6.4",
|
|
26
27
|
"@types/three": "0.141.0"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "162366d21d73252f78bb3c2382a8d2e34b463bf4"
|
|
29
30
|
}
|
|
@@ -9,6 +9,10 @@ import { CloneModelInfo } from '../Interface';
|
|
|
9
9
|
import DefaultManage from './DefaultManage';
|
|
10
10
|
declare class ModelManage extends DefaultManage {
|
|
11
11
|
readonly viewport: Viewport;
|
|
12
|
+
/**
|
|
13
|
+
* 场景是否卸载
|
|
14
|
+
*/
|
|
15
|
+
isDisposed: boolean;
|
|
12
16
|
modelsPromiseMap: Map<string, Promise<Model | null>>;
|
|
13
17
|
modelsMap: Map<string, Model>;
|
|
14
18
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseObject3DInfo } from '../../Library';
|
|
1
2
|
import { MinHeap } from '../../Shared';
|
|
2
3
|
/**
|
|
3
4
|
* Javascript implementation of Dijkstra's algorithm
|
|
@@ -18,13 +19,13 @@ import { MinHeap } from '../../Shared';
|
|
|
18
19
|
* const path = d.getPath('A', 'D');
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
|
-
declare type
|
|
22
|
-
declare type
|
|
22
|
+
declare type BaseId = BaseObject3DInfo['id'];
|
|
23
|
+
declare type Graph = Map<BaseId, Map<BaseId, number>>;
|
|
24
|
+
declare type InputGraph = [BaseId, [BaseId, number][]][];
|
|
23
25
|
declare class Dijkstras {
|
|
24
26
|
graph: Graph;
|
|
25
27
|
queue: MinHeap | null;
|
|
26
|
-
|
|
27
|
-
previous: (number | null)[];
|
|
28
|
+
previous: Map<BaseId, BaseId | null>;
|
|
28
29
|
constructor();
|
|
29
30
|
/**
|
|
30
31
|
* Creates a graph from array.
|
|
@@ -48,6 +49,6 @@ declare class Dijkstras {
|
|
|
48
49
|
* @param target The target node.
|
|
49
50
|
* @return array Path to target, or empty array if unable to find path.
|
|
50
51
|
*/
|
|
51
|
-
getPath(source:
|
|
52
|
+
getPath(source: BaseId, target: BaseId): BaseId[];
|
|
52
53
|
}
|
|
53
54
|
export { Graph, InputGraph, Dijkstras, };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import { BaseObject3DInfo } from '../Library';
|
|
2
|
+
declare type BaseId = BaseObject3DInfo['id'];
|
|
1
3
|
interface MinHeapNode {
|
|
2
|
-
nodeIndex:
|
|
4
|
+
nodeIndex: BaseId;
|
|
3
5
|
distance: number;
|
|
4
6
|
depth: number;
|
|
5
|
-
parent: null |
|
|
6
|
-
children:
|
|
7
|
+
parent: null | BaseId;
|
|
8
|
+
children: BaseId[];
|
|
7
9
|
}
|
|
8
10
|
declare class MinHeap {
|
|
9
|
-
min:
|
|
10
|
-
roots:
|
|
11
|
-
nodes: MinHeapNode
|
|
11
|
+
min: BaseId | null;
|
|
12
|
+
roots: BaseId[];
|
|
13
|
+
nodes: Map<BaseId, MinHeapNode>;
|
|
12
14
|
constructor();
|
|
13
|
-
shift(): number | null;
|
|
15
|
+
shift(): string | number | null;
|
|
14
16
|
consolidate(): void;
|
|
15
|
-
add(nodeIndex:
|
|
16
|
-
update(nodeIndex:
|
|
17
|
-
remove(nodeIndex:
|
|
18
|
-
getDistance(nodeIndex:
|
|
17
|
+
add(nodeIndex: BaseId, distance: number): void;
|
|
18
|
+
update(nodeIndex: BaseId, distance: number): void;
|
|
19
|
+
remove(nodeIndex: BaseId): void;
|
|
20
|
+
getDistance(nodeIndex: BaseId): number;
|
|
19
21
|
}
|
|
20
22
|
export { MinHeapNode, MinHeap, };
|
|
@@ -117,7 +117,7 @@ declare class Viewport {
|
|
|
117
117
|
rayClash(startPoint?: Vector3, dir?: Vector3, objects?: Object3D<import("three").Event>[]): Intersection<Object3D<import("three").Event>>[];
|
|
118
118
|
setHoverEnabled(enabled: boolean): void;
|
|
119
119
|
clearSignals(): void;
|
|
120
|
-
dispose():
|
|
120
|
+
dispose(): void;
|
|
121
121
|
_signalsEventListenr(): void;
|
|
122
122
|
_containerAddEventListener(container: HTMLElement): void;
|
|
123
123
|
/**
|
package/types/index.d.ts
CHANGED
|
@@ -115,7 +115,87 @@ export declare class SoonSpace {
|
|
|
115
115
|
remove: (tween: import("@tweenjs/tween.js").Tween<Record<string, any>>) => void;
|
|
116
116
|
update: (time?: number | undefined, preserve?: boolean | undefined) => boolean;
|
|
117
117
|
};
|
|
118
|
+
readonly TWEEN: {
|
|
119
|
+
Easing: {
|
|
120
|
+
Linear: {
|
|
121
|
+
None: (amount: number) => number;
|
|
122
|
+
};
|
|
123
|
+
Quadratic: {
|
|
124
|
+
In: (amount: number) => number;
|
|
125
|
+
Out: (amount: number) => number;
|
|
126
|
+
InOut: (amount: number) => number;
|
|
127
|
+
};
|
|
128
|
+
Cubic: {
|
|
129
|
+
In: (amount: number) => number;
|
|
130
|
+
Out: (amount: number) => number;
|
|
131
|
+
InOut: (amount: number) => number;
|
|
132
|
+
};
|
|
133
|
+
Quartic: {
|
|
134
|
+
In: (amount: number) => number;
|
|
135
|
+
Out: (amount: number) => number;
|
|
136
|
+
InOut: (amount: number) => number;
|
|
137
|
+
};
|
|
138
|
+
Quintic: {
|
|
139
|
+
In: (amount: number) => number;
|
|
140
|
+
Out: (amount: number) => number;
|
|
141
|
+
InOut: (amount: number) => number;
|
|
142
|
+
};
|
|
143
|
+
Sinusoidal: {
|
|
144
|
+
In: (amount: number) => number;
|
|
145
|
+
Out: (amount: number) => number;
|
|
146
|
+
InOut: (amount: number) => number;
|
|
147
|
+
};
|
|
148
|
+
Exponential: {
|
|
149
|
+
In: (amount: number) => number;
|
|
150
|
+
Out: (amount: number) => number;
|
|
151
|
+
InOut: (amount: number) => number;
|
|
152
|
+
};
|
|
153
|
+
Circular: {
|
|
154
|
+
In: (amount: number) => number;
|
|
155
|
+
Out: (amount: number) => number;
|
|
156
|
+
InOut: (amount: number) => number;
|
|
157
|
+
};
|
|
158
|
+
Elastic: {
|
|
159
|
+
In: (amount: number) => number;
|
|
160
|
+
Out: (amount: number) => number;
|
|
161
|
+
InOut: (amount: number) => number;
|
|
162
|
+
};
|
|
163
|
+
Back: {
|
|
164
|
+
In: (amount: number) => number;
|
|
165
|
+
Out: (amount: number) => number;
|
|
166
|
+
InOut: (amount: number) => number;
|
|
167
|
+
};
|
|
168
|
+
Bounce: {
|
|
169
|
+
In: (amount: number) => number;
|
|
170
|
+
Out: (amount: number) => number;
|
|
171
|
+
InOut: (amount: number) => number;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
Group: typeof import("@tweenjs/tween.js").Group;
|
|
175
|
+
Interpolation: {
|
|
176
|
+
Linear: (v: number[], k: number) => number;
|
|
177
|
+
Bezier: (v: number[], k: number) => number;
|
|
178
|
+
CatmullRom: (v: number[], k: number) => number;
|
|
179
|
+
Utils: {
|
|
180
|
+
Linear: (p0: number, p1: number, t: number) => number;
|
|
181
|
+
Bernstein: (n: number, i: number) => number;
|
|
182
|
+
Factorial: (n: number) => number;
|
|
183
|
+
CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => number;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
now: () => number;
|
|
187
|
+
Sequence: typeof import("@tweenjs/tween.js").Sequence;
|
|
188
|
+
nextId: typeof import("@tweenjs/tween.js").Sequence.nextId;
|
|
189
|
+
Tween: typeof import("@tweenjs/tween.js").Tween;
|
|
190
|
+
VERSION: string;
|
|
191
|
+
getAll: () => import("@tweenjs/tween.js").Tween<Record<string, any>>[];
|
|
192
|
+
removeAll: () => void;
|
|
193
|
+
add: (tween: import("@tweenjs/tween.js").Tween<Record<string, any>>) => void;
|
|
194
|
+
remove: (tween: import("@tweenjs/tween.js").Tween<Record<string, any>>) => void;
|
|
195
|
+
update: (time?: number | undefined, preserve?: boolean | undefined) => boolean;
|
|
196
|
+
};
|
|
118
197
|
static readonly utils: typeof shared;
|
|
198
|
+
readonly utils: typeof shared;
|
|
119
199
|
readonly THREE_PLUGINS: {
|
|
120
200
|
TransformControls: typeof TransformControls;
|
|
121
201
|
};
|
|
@@ -124,7 +204,6 @@ export declare class SoonSpace {
|
|
|
124
204
|
readonly domElement: HTMLElement | null;
|
|
125
205
|
readonly animation: typeof Animation;
|
|
126
206
|
readonly library: typeof library;
|
|
127
|
-
readonly utils: typeof shared;
|
|
128
207
|
readonly signals: SignalsState;
|
|
129
208
|
readonly viewport: Viewport;
|
|
130
209
|
readonly manager: Manager;
|
|
@@ -273,7 +352,7 @@ export declare class SoonSpace {
|
|
|
273
352
|
/**
|
|
274
353
|
* 销毁场景
|
|
275
354
|
*/
|
|
276
|
-
dispose():
|
|
355
|
+
dispose(): void;
|
|
277
356
|
/******/
|
|
278
357
|
/******/
|
|
279
358
|
/******* Viewport cameraManager methods */
|