soonspacejs 2.5.51 → 2.5.53

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.5.51",
3
+ "version": "2.5.53",
4
4
  "homepage": "http://www.xwbuilders.com:8800/",
5
5
  "description": "soonspacejs 2.x",
6
6
  "module": "./dist/index.esm.js",
@@ -25,5 +25,5 @@
25
25
  "@tweenjs/tween.js": "^18.6.4",
26
26
  "@types/three": "0.141.0"
27
27
  },
28
- "gitHead": "935d10e09cab915e36057f12b0754296b93a8673"
28
+ "gitHead": "788700798f632f90aa51e10bf52b0cdd85b84a7c"
29
29
  }
package/types/index.d.ts CHANGED
@@ -6,10 +6,11 @@
6
6
  |____/ \___/ \___/|_| |_|____/| .__/ \__,_|\___\___(_)/ |___/
7
7
  |_| |__/
8
8
  */
9
+ import * as THREE from 'three';
9
10
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
10
11
  import { Reflector } from 'three/examples/jsm/objects/Reflector.js';
11
12
  import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
12
- import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light, AmbientLight, DirectionalLight, HemisphereLight, SpotLight, PointLight, RectAreaLight, Texture, Mesh } from 'three';
13
+ import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light, Texture, Mesh } from 'three';
13
14
  import * as shared from './Shared';
14
15
  import Animation from './Animation';
15
16
  import * as library from './Library';
@@ -17,6 +18,7 @@ import { BaseObject3D, BaseObject3DInfo, Model, ModelInfo, Poi, PoiInfo, PoiNode
17
18
  import Viewport from './Viewport';
18
19
  import Manager from './Manager';
19
20
  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 } from './Interface';
21
+ import { BoxSpace, FindObjectsNearPosition, FindNearbyObjects, CreatePoiMeshOptions, CreatePolygonPoiMeshOptions, SetTextureOptions } from './tools';
20
22
  export declare type InitOptions = ViewportOptions;
21
23
  export declare type InitEvents = SceneGlobalEvents;
22
24
  export interface SoonSpaceConstructor {
@@ -24,29 +26,9 @@ export interface SoonSpaceConstructor {
24
26
  options?: InitOptions;
25
27
  events?: InitEvents;
26
28
  }
27
- import * as THREE from 'three';
28
29
  export * from 'three';
29
30
  export * from './Interface';
30
- import { BoxSpace, FindObjectsNearPosition, FindNearbyObjects } from './tools/find-objects';
31
- import { CreatePoiMeshOptions, CreatePolygonPoiMeshOptions } from './tools/poi-mesh';
32
- export * from './tools/units';
33
- declare global {
34
- interface Window {
35
- THREE: typeof THREE;
36
- }
37
- }
38
- export interface SetTextureOptions {
39
- /**
40
- * 是否使用缓存中的材质
41
- */
42
- cache?: boolean | null;
43
- /**
44
- * 是否只更新当前 Mesh 的贴图
45
- * @remarks
46
- * 当 Mesh 与 其它 Mesh 共享 材质时,更新纹理会拿所有共享该 材质的 Mesh 都更新,将 independ 设置为 true 可以禁止这种行为,使得只会更新传入的 Mesh 的贴图。
47
- */
48
- independ?: boolean | null;
49
- }
31
+ export * from './tools';
50
32
  export declare class SoonSpace {
51
33
  static readonly THREE: typeof THREE;
52
34
  readonly THREE: typeof THREE;
@@ -302,6 +284,10 @@ export declare class SoonSpace {
302
284
  * @param colorSpace
303
285
  */
304
286
  setColorSpace(colorSpace: IColorSpace): void;
287
+ /**
288
+ * 设置场景色调
289
+ * @param options
290
+ */
305
291
  setToneMapping(options?: ToneMappingOptions): void;
306
292
  /**
307
293
  * 设置开启鼠标悬浮
@@ -333,7 +319,7 @@ export declare class SoonSpace {
333
319
  * 设置场景环境
334
320
  * @returns
335
321
  */
336
- setEnvironment(): Texture;
322
+ setEnvironment(): THREE.Texture;
337
323
  /**
338
324
  * 播放模型动画
339
325
  * @param model
@@ -558,7 +544,7 @@ export declare class SoonSpace {
558
544
  * 创建环境关
559
545
  * @param options
560
546
  */
561
- createAmbientLight(options: AmbientLightOptions): AmbientLight;
547
+ createAmbientLight(options: AmbientLightOptions): THREE.AmbientLight;
562
548
  /**
563
549
  * 设置环境关
564
550
  * @param options
@@ -568,7 +554,7 @@ export declare class SoonSpace {
568
554
  * 创建平行光
569
555
  * @param options
570
556
  */
571
- createDirectionalLight(options: DirectionalLightOptions): DirectionalLight;
557
+ createDirectionalLight(options: DirectionalLightOptions): THREE.DirectionalLight;
572
558
  /**
573
559
  * 设置平行光
574
560
  * @param options
@@ -578,7 +564,7 @@ export declare class SoonSpace {
578
564
  * 创建半球光
579
565
  * @param options
580
566
  */
581
- createHemisphereLight(options: HemisphereLightOptions): HemisphereLight;
567
+ createHemisphereLight(options: HemisphereLightOptions): THREE.HemisphereLight;
582
568
  /**
583
569
  * 设置半球光
584
570
  * @param options
@@ -588,7 +574,7 @@ export declare class SoonSpace {
588
574
  * 创建聚光灯
589
575
  * @param options
590
576
  */
591
- createSpotLight(options: SpotLightOptions): SpotLight;
577
+ createSpotLight(options: SpotLightOptions): THREE.SpotLight;
592
578
  /**
593
579
  * 设置聚光灯
594
580
  * @param options
@@ -598,7 +584,7 @@ export declare class SoonSpace {
598
584
  * 创建点光源
599
585
  * @param options
600
586
  */
601
- createPointLight(options: PointLightOptions): PointLight;
587
+ createPointLight(options: PointLightOptions): THREE.PointLight;
602
588
  /**
603
589
  * 设置点光源
604
590
  * @param options
@@ -609,7 +595,7 @@ export declare class SoonSpace {
609
595
  * @param options
610
596
  * @returns
611
597
  */
612
- createRectAreaLight(options: RectAreaLightOptions): RectAreaLight;
598
+ createRectAreaLight(options: RectAreaLightOptions): THREE.RectAreaLight;
613
599
  /**
614
600
  * 设置矩形区域光源
615
601
  * @param options
@@ -988,10 +974,10 @@ export declare class SoonSpace {
988
974
  * 给 mesh 设置纹理贴图
989
975
  * @param mesh - 需要设置的 Mesh 对象
990
976
  * @param image - 图片 url ,或 图片元素、Canvas元素、Video 元素
991
- * @param cache - 是丰使用缓存中的材质
977
+ * @param cache - 是否使用缓存中的材质
992
978
  * @returns 返回设置的纹理对象
993
979
  */
994
- setTexture(mesh: Mesh, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: SetTextureOptions): Texture | THREE.CanvasTexture | THREE.VideoTexture;
980
+ setTexture(mesh: Mesh, image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: SetTextureOptions): THREE.Texture | THREE.CanvasTexture | THREE.VideoTexture;
995
981
  /******/
996
982
  /******/
997
983
  /******* Canvas3D methods */
@@ -0,0 +1,3 @@
1
+ export * from './find-objects';
2
+ export * from './poi-mesh';
3
+ export * from './units';
@@ -29,6 +29,18 @@ export declare function boundingIsIntersected(target: Box3 | Sphere, obj: Object
29
29
  */
30
30
  export declare function getBoundingBox(obj: Object3D): Box3;
31
31
  export declare function createTexture(image: string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, cache?: boolean, textureCache?: Map<string, Texture>): Texture | CanvasTexture | VideoTexture;
32
+ export interface SetTextureOptions {
33
+ /**
34
+ * 是否使用缓存中的材质
35
+ */
36
+ cache?: boolean | null;
37
+ /**
38
+ * 是否只更新当前 Mesh 的贴图
39
+ * @remarks
40
+ * 当 Mesh 与 其它 Mesh 共享 材质时,更新纹理会拿所有共享该 材质的 Mesh 都更新,将 independ 设置为 true 可以禁止这种行为,使得只会更新传入的 Mesh 的贴图。
41
+ */
42
+ independ?: boolean | null;
43
+ }
32
44
  /**
33
45
  * 设置贴图
34
46
  * @param material