soonspacejs 2.3.16 → 2.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.17",
|
|
4
4
|
"description": "soonspacejs 2.x",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"@robotlegsjs/signals": "1.1.0",
|
|
18
18
|
"@soonspacejs/xml2json": "0.0.2",
|
|
19
19
|
"@tweenjs/tween.js": "18.6.4",
|
|
20
|
-
"
|
|
20
|
+
"@types/three": "^0.138.0",
|
|
21
|
+
"localforage": "1.9.0",
|
|
22
|
+
"three": "^0.138.3"
|
|
21
23
|
},
|
|
22
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "615a37b746fc1f12beab499a49807a4fdd667688"
|
|
23
25
|
}
|
|
@@ -24,7 +24,6 @@ interface InternalOptions {
|
|
|
24
24
|
enableRenderCss2D: boolean;
|
|
25
25
|
enableRenderCss2DHalf: boolean;
|
|
26
26
|
enableRenderCss3D: boolean;
|
|
27
|
-
enableReflection: boolean;
|
|
28
27
|
}
|
|
29
28
|
interface SelectModelOptions<TOptions> {
|
|
30
29
|
objects: Object3D[];
|
|
@@ -54,9 +53,6 @@ interface FogOptions {
|
|
|
54
53
|
near?: number;
|
|
55
54
|
far?: number;
|
|
56
55
|
}
|
|
57
|
-
export interface ReflectionOptions {
|
|
58
|
-
enable: boolean;
|
|
59
|
-
}
|
|
60
56
|
interface SkyOptions {
|
|
61
57
|
enable?: boolean;
|
|
62
58
|
position?: Position;
|
|
@@ -69,6 +65,7 @@ interface SkyOptions {
|
|
|
69
65
|
}
|
|
70
66
|
interface ViewportOptions {
|
|
71
67
|
showInfo?: boolean;
|
|
68
|
+
showStats?: boolean;
|
|
72
69
|
showGrid?: boolean | GridHelperOptions;
|
|
73
70
|
background?: {
|
|
74
71
|
color?: IColor | null;
|
|
@@ -91,4 +88,13 @@ interface ViewportState {
|
|
|
91
88
|
useFreq: number;
|
|
92
89
|
animationTotal: number;
|
|
93
90
|
}
|
|
91
|
+
export interface BloomOptions {
|
|
92
|
+
enable?: boolean;
|
|
93
|
+
strength?: number;
|
|
94
|
+
radius?: number;
|
|
95
|
+
threshold?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface SobelOptions {
|
|
98
|
+
enable?: boolean;
|
|
99
|
+
}
|
|
94
100
|
export { CameraViewpointData, FlyToObjOptions, SurroundOptions, LabelOptions, InternalOptions, SelectModelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SkyOptions, ViewportOptions, ViewportState, };
|
package/types/Viewport/Info.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Scene } from 'three';
|
|
2
2
|
import { SignalsState } from '../Interface';
|
|
3
3
|
declare class Info {
|
|
4
|
+
readonly scene: Scene;
|
|
5
|
+
readonly signals: SignalsState;
|
|
4
6
|
container: HTMLDivElement;
|
|
5
7
|
state: {
|
|
6
8
|
objects: number;
|
|
@@ -10,5 +12,6 @@ declare class Info {
|
|
|
10
12
|
lodFrametime: number;
|
|
11
13
|
};
|
|
12
14
|
constructor(scene: Scene, signals: SignalsState);
|
|
15
|
+
addListeners(): void;
|
|
13
16
|
}
|
|
14
17
|
export default Info;
|
|
@@ -3,14 +3,15 @@ import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer
|
|
|
3
3
|
import { Pass } from 'three/examples/jsm/postprocessing/Pass.js';
|
|
4
4
|
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
|
|
5
5
|
import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js';
|
|
6
|
-
import {
|
|
6
|
+
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js';
|
|
7
7
|
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
|
|
8
8
|
import { CSS2DRenderer, CSS2DHalfRenderer, CSS3DRenderer } from '../Renderer';
|
|
9
9
|
import { InternalOptions, ViewportOptions } from '../Interface';
|
|
10
10
|
export interface PassObj {
|
|
11
11
|
renderPass: RenderPass;
|
|
12
12
|
outlinePass: OutlinePass;
|
|
13
|
-
|
|
13
|
+
unrealBloomPass: UnrealBloomPass;
|
|
14
|
+
sobelPass: ShaderPass;
|
|
14
15
|
gammaCorrectionPass: ShaderPass;
|
|
15
16
|
}
|
|
16
17
|
declare class RendererManager {
|
|
@@ -42,7 +43,8 @@ declare class RendererManager {
|
|
|
42
43
|
_initInteractiveContainer(): HTMLElement;
|
|
43
44
|
_initRenderPass(camera: Camera): RenderPass;
|
|
44
45
|
_initOutlinePass(camera: Camera): OutlinePass;
|
|
45
|
-
|
|
46
|
+
_initUnrealBloomPass(): UnrealBloomPass;
|
|
47
|
+
_initSobelPass(): ShaderPass;
|
|
46
48
|
_initGammaCorrectionPass(): ShaderPass;
|
|
47
49
|
}
|
|
48
50
|
export default RendererManager;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, Vector3, AnimationMixer, Intersection, Object3D, AnimationAction, AnimationClip } from 'three';
|
|
2
|
+
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
2
3
|
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
3
4
|
import Scener from './Scener';
|
|
4
5
|
import { CSS2DRenderer, CSS2DHalfRenderer, CSS3DRenderer } from '../Renderer';
|
|
@@ -7,7 +8,7 @@ import RendererManager, { PassObj } from './RendererManager';
|
|
|
7
8
|
import CameraManager from './CameraManager';
|
|
8
9
|
import { FullFreeControls } from '../Controls';
|
|
9
10
|
import { Model } from '../Library';
|
|
10
|
-
import { ColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState,
|
|
11
|
+
import { ColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, BloomOptions, SobelOptions } from '../Interface';
|
|
11
12
|
import Info from './Info';
|
|
12
13
|
export declare const innerRenderState: Record<string, boolean>;
|
|
13
14
|
declare class Viewport {
|
|
@@ -26,6 +27,7 @@ declare class Viewport {
|
|
|
26
27
|
rendererCSS2DHalf: CSS2DHalfRenderer;
|
|
27
28
|
pmremGenerator: PMREMGenerator;
|
|
28
29
|
info: Info;
|
|
30
|
+
stats: Stats;
|
|
29
31
|
cameraManager: CameraManager;
|
|
30
32
|
camera: PerspectiveCamera;
|
|
31
33
|
controls: FullFreeControls;
|
|
@@ -45,13 +47,12 @@ declare class Viewport {
|
|
|
45
47
|
private _loop;
|
|
46
48
|
constructor(options: ViewportOptions);
|
|
47
49
|
initInfo(): void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
setReflection(options: ReflectionOptions): void;
|
|
50
|
+
initStats(): void;
|
|
51
|
+
setSobel(options?: SobelOptions): void;
|
|
52
52
|
/**
|
|
53
53
|
***************************** renderer ***************************
|
|
54
54
|
*/
|
|
55
|
+
setBloom(options?: BloomOptions): void;
|
|
55
56
|
setColorSpace(colorSpace: ColorSpace): void;
|
|
56
57
|
/**
|
|
57
58
|
***************************** background ***************************
|
package/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import * as THREE from 'three';
|
|
10
10
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
11
|
+
import { Lensflare, LensflareElement } from 'three/examples/jsm/objects/Lensflare.js';
|
|
11
12
|
import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light } from 'three';
|
|
12
13
|
import * as shared from './Shared';
|
|
13
14
|
import Animation from './Animation';
|
|
@@ -15,7 +16,7 @@ import * as library from './Library';
|
|
|
15
16
|
import { BaseObject3D, BaseObject3DInfo, Sbm, SbmInfo, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo } from './Library';
|
|
16
17
|
import Viewport from './Viewport';
|
|
17
18
|
import Manager from './Manager';
|
|
18
|
-
import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, FlyToViewpoint, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneSbmInfo, ModelLoadingProgressCallback, GroupProgressCallback, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, ColorSpace } from './Interface';
|
|
19
|
+
import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, FlyToViewpoint, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneSbmInfo, ModelLoadingProgressCallback, GroupProgressCallback, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, ColorSpace, BloomOptions, SobelOptions } from './Interface';
|
|
19
20
|
export declare type InitOptions = ViewportOptions;
|
|
20
21
|
export declare type InitEvents = SceneGlobalEvents;
|
|
21
22
|
export interface SoonSpaceConstructor {
|
|
@@ -33,6 +34,10 @@ export default class SoonSpace {
|
|
|
33
34
|
readonly THREE: typeof THREE;
|
|
34
35
|
readonly THREE_PLUGINS: {
|
|
35
36
|
TransformControls: typeof TransformControls;
|
|
37
|
+
Lensflare: {
|
|
38
|
+
Lensflare: typeof Lensflare;
|
|
39
|
+
LensflareElement: typeof LensflareElement;
|
|
40
|
+
};
|
|
36
41
|
};
|
|
37
42
|
readonly version: string;
|
|
38
43
|
readonly options: InitOptions;
|
|
@@ -102,6 +107,16 @@ export default class SoonSpace {
|
|
|
102
107
|
/******* Viewport methods */
|
|
103
108
|
/******/
|
|
104
109
|
/******/
|
|
110
|
+
/**
|
|
111
|
+
* 设置边缘检测
|
|
112
|
+
* @param options
|
|
113
|
+
*/
|
|
114
|
+
setSobel(options: SobelOptions): void;
|
|
115
|
+
/**
|
|
116
|
+
* 设置泛光
|
|
117
|
+
* @param bloom
|
|
118
|
+
*/
|
|
119
|
+
setBloom(bloom?: BloomOptions): void;
|
|
105
120
|
/**
|
|
106
121
|
* 设置场景的颜色空间
|
|
107
122
|
* @param colorSpace
|