soonspacejs 2.6.7 → 2.6.9
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 -3
- package/types/Interface/viewport.d.ts +31 -0
- package/types/Shared/map.d.ts +4 -4
- package/types/Shared/viewport.d.ts +5 -0
- package/types/Viewport/Bvh/index.d.ts +1 -2
- package/types/Viewport/EffectManager.d.ts +2 -0
- package/types/Viewport/index.d.ts +4 -4
- package/types/index.d.ts +4 -3
- package/types/three-patches.d.ts +9 -0
- package/types/tools/units.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.9",
|
|
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.150.
|
|
29
|
+
"three": ">=0.150.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "e88a2bd8a1ed89d6cbf041ba88e4bb9ac8d5c047"
|
|
32
32
|
}
|
|
@@ -102,6 +102,13 @@ interface ViewportState {
|
|
|
102
102
|
interface IntersectsOptions {
|
|
103
103
|
isFilterHideObject?: boolean;
|
|
104
104
|
}
|
|
105
|
+
export interface GetTextureOptions {
|
|
106
|
+
path?: string;
|
|
107
|
+
file: string | string[];
|
|
108
|
+
}
|
|
109
|
+
export interface EnvironmentOptions extends GetTextureOptions {
|
|
110
|
+
background?: boolean;
|
|
111
|
+
}
|
|
105
112
|
export interface BloomOptions {
|
|
106
113
|
enabled?: boolean;
|
|
107
114
|
mipmapBlur?: boolean;
|
|
@@ -135,6 +142,30 @@ export interface SSAOOptions {
|
|
|
135
142
|
color?: IColor;
|
|
136
143
|
resolutionScale?: number;
|
|
137
144
|
}
|
|
145
|
+
export interface SSGIOptions {
|
|
146
|
+
enabled?: boolean;
|
|
147
|
+
distance?: number;
|
|
148
|
+
thickness?: number;
|
|
149
|
+
autoThickness?: boolean;
|
|
150
|
+
maxRoughness?: number;
|
|
151
|
+
blend?: number;
|
|
152
|
+
denoiseIterations?: number;
|
|
153
|
+
denoiseKernel?: number;
|
|
154
|
+
denoiseDiffuse?: number;
|
|
155
|
+
denoiseSpecular?: number;
|
|
156
|
+
depthPhi?: number;
|
|
157
|
+
normalPhi?: number;
|
|
158
|
+
roughnessPhi?: number;
|
|
159
|
+
envBlur?: number;
|
|
160
|
+
importanceSampling?: boolean;
|
|
161
|
+
directLightMultiplier?: number;
|
|
162
|
+
maxEnvLuminance?: number;
|
|
163
|
+
steps?: number;
|
|
164
|
+
refineSteps?: number;
|
|
165
|
+
spp?: number;
|
|
166
|
+
resolutionScale?: number;
|
|
167
|
+
missedRays?: boolean;
|
|
168
|
+
}
|
|
138
169
|
export interface SSROptions {
|
|
139
170
|
enabled?: boolean;
|
|
140
171
|
intensity?: number;
|
package/types/Shared/map.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IColor } from '../Interface';
|
|
3
|
-
declare function
|
|
4
|
-
export {
|
|
1
|
+
import { Texture } from 'three';
|
|
2
|
+
import { GetTextureOptions, IColor } from '../Interface';
|
|
3
|
+
declare function getTexture({ path, file, }: GetTextureOptions): Promise<Texture>;
|
|
4
|
+
export { getTexture, };
|
|
5
5
|
interface GradientTextureOptions {
|
|
6
6
|
colors: IColor[];
|
|
7
7
|
stops?: number[];
|
|
@@ -2,6 +2,11 @@ import { Vector3, Euler, Box3, Object3D } from 'three';
|
|
|
2
2
|
import { IVector3, AxisType } from '../Interface';
|
|
3
3
|
declare function IVector3ToVector3(val: IVector3 | Vector3): Vector3;
|
|
4
4
|
declare function IVector3ToEuler(val: IVector3 | Euler): Euler;
|
|
5
|
+
/**
|
|
6
|
+
* 获取 object box
|
|
7
|
+
* @param object
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
5
10
|
declare function getBoundingBox(object: Object3D): Box3;
|
|
6
11
|
declare function rotationAxisFix(axis: AxisType, source: Euler, target: Euler): Euler;
|
|
7
12
|
declare function rotationAFix(source: Euler, target: Euler): Euler;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import Viewport from '..';
|
|
3
2
|
export type ModelsBoundsTreeOptions = {
|
|
4
3
|
type?: 'block' | 'slice' | 'worker';
|
|
@@ -9,7 +8,7 @@ export type ModelsBoundsTreeOptions = {
|
|
|
9
8
|
declare class Bvh {
|
|
10
9
|
readonly viewport: Viewport;
|
|
11
10
|
cameraChanging: boolean;
|
|
12
|
-
timer:
|
|
11
|
+
timer: number | null;
|
|
13
12
|
computedGeometriesUuid: Map<string, string>;
|
|
14
13
|
generateMeshBVHWorker: import("./GenerateMeshBVHWorker").GenerateMeshBVHWorker;
|
|
15
14
|
constructor(viewport: Viewport);
|
|
@@ -11,8 +11,10 @@ declare class EffectManager {
|
|
|
11
11
|
static CONSTANTS: {
|
|
12
12
|
renderPass: string;
|
|
13
13
|
normalPass: string;
|
|
14
|
+
velocityDepthNormalPass: string;
|
|
14
15
|
effectPass: string;
|
|
15
16
|
smaaEffect: string;
|
|
17
|
+
ssgiEffect: string;
|
|
16
18
|
ssaoEffect: string;
|
|
17
19
|
outlineEffect: string;
|
|
18
20
|
ssrEffect: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mesh,
|
|
1
|
+
import { Mesh, Clock, Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, Vector3, AnimationMixer, Raycaster, Intersection, Object3D, AnimationAction, AnimationClip, Texture } from 'three';
|
|
2
2
|
import { EffectComposer } from 'postprocessing';
|
|
3
3
|
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
4
4
|
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
@@ -10,7 +10,7 @@ import EffectManager from './EffectManager';
|
|
|
10
10
|
import Bvh from './Bvh';
|
|
11
11
|
import { Controls } from '../Controls';
|
|
12
12
|
import { Model } from '../Library';
|
|
13
|
-
import { IColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, ToneMappingOptions, SSAOOptions, SSROptions, BloomOptions, IntersectsOptions } from '../Interface';
|
|
13
|
+
import { IColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, ToneMappingOptions, SSAOOptions, SSROptions, BloomOptions, IntersectsOptions, EnvironmentOptions } from '../Interface';
|
|
14
14
|
import { License } from '../License';
|
|
15
15
|
import Info from './Info';
|
|
16
16
|
import { ViewHelper } from './ViewHelper';
|
|
@@ -86,7 +86,7 @@ declare class Viewport {
|
|
|
86
86
|
/**
|
|
87
87
|
***************************** environment ***************************
|
|
88
88
|
*/
|
|
89
|
-
setEnvironment(): Texture
|
|
89
|
+
setEnvironment(options?: EnvironmentOptions): Promise<Texture>;
|
|
90
90
|
/**
|
|
91
91
|
***************************** modelAnimation ***************************
|
|
92
92
|
*/
|
|
@@ -123,7 +123,7 @@ declare class Viewport {
|
|
|
123
123
|
};
|
|
124
124
|
getPositionByOffset(offset: OffsetPoint, z?: number): Vector3;
|
|
125
125
|
getIntersects(event: MouseEvent | TouchEvent | OffsetPoint, objects?: Object3D<import("three").Event>[], options?: IntersectsOptions): Intersection<Object3D<import("three").Event>>[];
|
|
126
|
-
rayClash(startPoint?: Vector3, dir?: Vector3, objects?: Mesh<BufferGeometry, import("three").Material | import("three").Material[]>[]): Intersection<Object3D<import("three").Event>>[];
|
|
126
|
+
rayClash(startPoint?: Vector3, dir?: Vector3, objects?: Mesh<import("three").BufferGeometry, import("three").Material | import("three").Material[]>[]): Intersection<Object3D<import("three").Event>>[];
|
|
127
127
|
setHoverEnabled(enabled: boolean): void;
|
|
128
128
|
clearSignals(): void;
|
|
129
129
|
dispose(): void;
|
package/types/index.d.ts
CHANGED
|
@@ -15,9 +15,10 @@ import * as library from './Library';
|
|
|
15
15
|
import { BaseObject3D, BaseObject3DInfo, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo } from './Library';
|
|
16
16
|
import Viewport from './Viewport';
|
|
17
17
|
import Manager from './Manager';
|
|
18
|
-
import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, CameraTargetViewData, FlyToViewpoint, 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 } from './Interface';
|
|
18
|
+
import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, CameraTargetViewData, FlyToViewpoint, 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 } from './Interface';
|
|
19
19
|
import { BoxSpace, FindObjectsNearPosition, FindNearbyObjects, CreatePoiMeshOptions, CreatePolygonPoiMeshOptions, SetTextureOptions } from './tools';
|
|
20
20
|
import { ModelsBoundsTreeOptions } from './Viewport/Bvh';
|
|
21
|
+
import './three-patches';
|
|
21
22
|
export type InitOptions = ViewportOptions;
|
|
22
23
|
export type InitEvents = SceneGlobalEvents;
|
|
23
24
|
export interface SoonSpaceConstructor {
|
|
@@ -314,12 +315,12 @@ export declare class SoonSpace {
|
|
|
314
315
|
* @param dirPath
|
|
315
316
|
* @param fileNames
|
|
316
317
|
*/
|
|
317
|
-
setSkyBackground(dirPath: string, fileNames
|
|
318
|
+
setSkyBackground(dirPath: string, fileNames?: string[]): Promise<void>;
|
|
318
319
|
/**
|
|
319
320
|
* 设置场景环境
|
|
320
321
|
* @returns
|
|
321
322
|
*/
|
|
322
|
-
setEnvironment(): THREE.Texture
|
|
323
|
+
setEnvironment(options?: EnvironmentOptions): Promise<THREE.Texture>;
|
|
323
324
|
/**
|
|
324
325
|
* 播放模型动画
|
|
325
326
|
* @param model
|
package/types/tools/units.d.ts
CHANGED
|
@@ -24,10 +24,6 @@ export declare function createUVMatrix(box: Box2): Matrix3;
|
|
|
24
24
|
* 判断包围合 与 对象的包围盒是否相交
|
|
25
25
|
*/
|
|
26
26
|
export declare function boundingIsIntersected(target: Box3 | Sphere, obj: Object3D): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 获取对象的包围合
|
|
29
|
-
*/
|
|
30
|
-
export declare function getBoundingBox(obj: Object3D): Box3;
|
|
31
27
|
export declare function createTexture(image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture | CanvasTexture | VideoTexture;
|
|
32
28
|
export interface SetTextureOptions {
|
|
33
29
|
/**
|