soonspacejs 2.5.0 → 2.5.2

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.0",
3
+ "version": "2.5.2",
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": "61b7ed6ce3e0d761a30fb65d64a4eeb22acbfef9"
28
+ "gitHead": "31fbce3b336b49c8fac25f3daea7e2d18f454076"
29
29
  }
@@ -104,12 +104,9 @@ interface TopologyNodeInfo {
104
104
  position: Position;
105
105
  graphs?: TopologyNodeGraph[];
106
106
  }
107
- interface TopologyInnerNodeInfo {
108
- id: BaseObject3DInfo['id'];
109
- name?: BaseObject3DInfo['name'];
110
- position: Position;
107
+ declare type TopologyInnerNodeInfo = Omit<TopologyNodeInfo, 'graphs'> & {
111
108
  graphs: TopologyNodeGraph[];
112
- }
109
+ };
113
110
  interface TwoWaysLink {
114
111
  pointAIndex: number;
115
112
  pointBIndex: number;
@@ -8,6 +8,10 @@ interface CameraViewpointData {
8
8
  position: Position;
9
9
  rotation: Rotation;
10
10
  }
11
+ interface CameraTargetViewData {
12
+ position: Position;
13
+ target: Position;
14
+ }
11
15
  interface FlyToObjOptions extends AnimationOptions {
12
16
  padding?: number | string;
13
17
  }
@@ -136,4 +140,4 @@ export interface ToneMappingOptions {
136
140
  type?: 'None' | 'Linear' | 'Reinhard' | 'Cineon' | 'ACESFilmic';
137
141
  exposure?: number;
138
142
  }
139
- export { CameraViewpointData, FlyToObjOptions, SurroundOptions, LabelOptions, InternalOptions, SelectModelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SkyOptions, ViewportOptions, ViewportState, IntersectsOptions, };
143
+ export { CameraViewpointData, CameraTargetViewData, FlyToObjOptions, SurroundOptions, LabelOptions, InternalOptions, SelectModelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SkyOptions, ViewportOptions, ViewportState, IntersectsOptions, };
@@ -23,5 +23,6 @@ declare class Topology extends BaseObject3D {
23
23
  createCircle(param: CircleInfo): Circle;
24
24
  createLink(param: LinkInfo): Link;
25
25
  resetNodes(newNodes: TopologyInnerNodeInfo[]): void;
26
+ getLength(): number;
26
27
  }
27
28
  export { Topology, TopologyInfo, TopologyInnerInfo, };
@@ -25,5 +25,5 @@ declare function getSpaceAttributeFromObject(object: Object3D, isFromWorld?: boo
25
25
  * @param isFromWorld
26
26
  */
27
27
  declare function syncSpaceAttributeToObject(target: Object3D, source: Object3D, isFromWorld?: boolean): void;
28
- declare function isHideObject(object: Object3D): boolean;
29
- export { IVector3ToVector3, IVector3ToEuler, getBoundingBox, rotationAxisFix, rotationAFix, deg2Euler, euler2Deg, getSpaceAttributeFromObject, syncSpaceAttributeToObject, isHideObject, };
28
+ declare function isObjectVisible(object: Object3D): boolean;
29
+ export { IVector3ToVector3, IVector3ToEuler, getBoundingBox, rotationAxisFix, rotationAFix, deg2Euler, euler2Deg, getSpaceAttributeFromObject, syncSpaceAttributeToObject, isObjectVisible, };
@@ -1,5 +1,5 @@
1
1
  import { Box3, PerspectiveCamera, Vector3, Euler, Object3D } from 'three';
2
- import { Rotation, Position, AnimationOptions, FlyToViewpoint, CameraViewpointData, FlyToObjOptions, SurroundOptions, LabelOptions } from '../Interface';
2
+ import { Rotation, Position, AnimationOptions, FlyToViewpoint, CameraViewpointData, FlyToObjOptions, SurroundOptions, LabelOptions, CameraTargetViewData } from '../Interface';
3
3
  import { BaseObject3D, BaseMesh } from '../Library';
4
4
  import Viewport from '.';
5
5
  declare class CameraManager {
@@ -16,8 +16,10 @@ declare class CameraManager {
16
16
  getMainCamera(): PerspectiveCamera;
17
17
  getCameraViewpoint(): CameraViewpointData;
18
18
  setCameraViewpoint(data: CameraViewpointData): void;
19
- rotateTo(rotation: Euler, options?: AnimationOptions): Promise<void>;
19
+ getCameraTargetView(): CameraTargetViewData | null;
20
+ setCameraTargetView(data: CameraTargetViewData): void;
20
21
  moveTo(position: Position, options?: AnimationOptions): Promise<void>;
22
+ rotateTo(rotation: Euler, options?: AnimationOptions): Promise<void>;
21
23
  flyTo(position: Position, rotation?: FlyToViewpoint | Rotation | Euler, options?: AnimationOptions): Promise<void>;
22
24
  flyToBoundingBox(bbox: Box3, rotation?: FlyToViewpoint | Rotation | Euler, options?: AnimationOptions): Promise<void>;
23
25
  flyToObj(object: Object3D, rotation?: FlyToViewpoint | Rotation | Euler, options?: FlyToObjOptions): Promise<void>;
@@ -54,7 +54,6 @@ declare class Viewport {
54
54
  constructor(options: ViewportOptions);
55
55
  _initInfo(): void;
56
56
  _initStats(): void;
57
- _initViewHelper(): void;
58
57
  /**
59
58
  ***************************** post-processing ***************************
60
59
  */
package/types/index.d.ts CHANGED
@@ -8,7 +8,6 @@
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';
12
11
  import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light } from 'three';
13
12
  import * as shared from './Shared';
14
13
  import Animation from './Animation';
@@ -16,7 +15,7 @@ import * as library from './Library';
16
15
  import { BaseObject3D, BaseObject3DInfo, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo } from './Library';
17
16
  import Viewport from './Viewport';
18
17
  import Manager from './Manager';
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, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, ColorSpace, ToneMappingOptions, SSAOOptions } 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, ColorSpace, ToneMappingOptions, SSAOOptions } from './Interface';
20
19
  export declare type InitOptions = ViewportOptions;
21
20
  export declare type InitEvents = SceneGlobalEvents;
22
21
  export interface SoonSpaceConstructor {
@@ -115,10 +114,6 @@ export default class SoonSpace {
115
114
  readonly THREE: typeof THREE;
116
115
  readonly THREE_PLUGINS: {
117
116
  TransformControls: typeof TransformControls;
118
- Lensflare: {
119
- Lensflare: typeof Lensflare;
120
- LensflareElement: typeof LensflareElement;
121
- };
122
117
  };
123
118
  readonly version: string;
124
119
  readonly options: InitOptions;
@@ -281,13 +276,21 @@ export default class SoonSpace {
281
276
  /******/
282
277
  /******/
283
278
  /**
284
- * 获取当前相机视角数据
279
+ * 获取当前相机视角数据(free)
285
280
  */
286
281
  getCameraViewpoint(): CameraViewpointData;
287
282
  /**
288
- * 设置相机视角数据
283
+ * 设置相机视角数据(free)
289
284
  */
290
285
  setCameraViewpoint(data: CameraViewpointData): void;
286
+ /**
287
+ * 获取当前相机视角数据(orbit)
288
+ */
289
+ getCameraTargetView(): CameraTargetViewData | null;
290
+ /**
291
+ * 设置相机视角数据(orbit)
292
+ */
293
+ setCameraTargetView(data: CameraTargetViewData): void;
291
294
  /**
292
295
  * 相机飞向
293
296
  * @param position