vis-core 0.33.2 → 0.33.4
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.d.ts +135 -29
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ import { Position } from 'geojson';
|
|
|
24
24
|
import { ProjectionOptions } from 'gl-draw';
|
|
25
25
|
import { RectAreaLightObject } from 'gl-draw';
|
|
26
26
|
import { RestoreBaseObjectOptions } from 'gl-draw';
|
|
27
|
-
import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
|
|
28
27
|
import { SceneSnapshot } from 'gl-draw';
|
|
29
28
|
import { SpotLightObject } from 'gl-draw';
|
|
30
29
|
import { SpriteObject } from 'gl-draw';
|
|
@@ -54,9 +53,19 @@ declare class Arc extends LineObject {
|
|
|
54
53
|
options: Options_5;
|
|
55
54
|
constructor(options: Options_5);
|
|
56
55
|
create(): Promise<void>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/** Internal/local-space curve used for rendering, editor handles and snapshots. */
|
|
57
|
+
getCurve(): ArcCurve;
|
|
58
|
+
/** Set four world-space Bézier controls; persisted coordinates remain local. */
|
|
59
|
+
setControlPoints(points: readonly [ArcPoint, ArcPoint, ArcPoint, ArcPoint]): void;
|
|
60
|
+
/** Set a world-space path without changing this object or its parent transforms. */
|
|
61
|
+
setPath(from: ArcPoint, to: ArcPoint, options: ArcPathOptions): void;
|
|
62
|
+
/** Exact radial lift above the short great circle; preserves every object transform. */
|
|
63
|
+
setSpherePath(from: ArcPoint, to: ArcPoint, options: ArcSpherePathOptions): void;
|
|
64
|
+
private worldToLocalMatrix;
|
|
65
|
+
private validatedNodes;
|
|
66
|
+
private setWorldControls;
|
|
67
|
+
private getPickPathOptions;
|
|
68
|
+
private syncPickPathOptions;
|
|
60
69
|
private updatePickTargetGeometry;
|
|
61
70
|
pickTube: Tube | null;
|
|
62
71
|
private pickTargetVersion;
|
|
@@ -77,6 +86,36 @@ declare class Arc extends LineObject {
|
|
|
77
86
|
render(): void;
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
declare type ArcCurve = THREE.CubicBezierCurve3 | SphereArcCurve;
|
|
90
|
+
|
|
91
|
+
export declare interface ArcPathOptions {
|
|
92
|
+
/** Maximum displacement from the endpoint segment along `up`, in world units. */
|
|
93
|
+
height: number;
|
|
94
|
+
/** World-space lift direction; normalized internally. Defaults to positive Z. */
|
|
95
|
+
up?: ArcPoint;
|
|
96
|
+
setPointWidth?: (progress: number) => number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare type ArcPoint = THREE.Vector3 | readonly number[];
|
|
100
|
+
|
|
101
|
+
/** A sphere frame in Arc-local coordinates. Its basis retains world-unit lengths. */
|
|
102
|
+
declare interface ArcSpherePath {
|
|
103
|
+
matrix: number[];
|
|
104
|
+
angle: number;
|
|
105
|
+
radius: number;
|
|
106
|
+
height: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare interface ArcSpherePathOptions {
|
|
110
|
+
/** World-space sphere center. Both endpoints must lie on the same sphere. */
|
|
111
|
+
center: ArcPoint;
|
|
112
|
+
/** Maximum distance above the sphere surface, in world units. Zero follows its surface. */
|
|
113
|
+
height: number;
|
|
114
|
+
/** World-space circle-plane normal for coincident or antipodal endpoints. */
|
|
115
|
+
normal?: ArcPoint;
|
|
116
|
+
setPointWidth?: (progress: number) => number;
|
|
117
|
+
}
|
|
118
|
+
|
|
80
119
|
declare class Area extends GroupObject {
|
|
81
120
|
objectType: string;
|
|
82
121
|
options: Options_11;
|
|
@@ -112,14 +151,15 @@ declare class Base_2 extends Camera {
|
|
|
112
151
|
lead: Lead;
|
|
113
152
|
sceneResources: default_2['sceneResources'];
|
|
114
153
|
tier0: boolean;
|
|
115
|
-
pmremGenerator: THREE.PMREMGenerator | null;
|
|
116
|
-
re: RoomEnvironment | null;
|
|
117
154
|
roomEnvMap?: THREE.Texture;
|
|
118
155
|
private roomEnvTarget?;
|
|
119
156
|
private roomEnvLease?;
|
|
120
157
|
visName: string;
|
|
121
158
|
private detectRes?;
|
|
122
159
|
private ownsPencil;
|
|
160
|
+
private renderingSuspensions;
|
|
161
|
+
/* Excluded from this release type: suspendRendering */
|
|
162
|
+
private acquireRenderingSuspensions;
|
|
123
163
|
publicDir: Record<string, string>;
|
|
124
164
|
private prefabAssets;
|
|
125
165
|
private prefabMaterials;
|
|
@@ -448,7 +488,7 @@ declare class ContinentsBg extends GroupObject {
|
|
|
448
488
|
mapArr: PlaneMap[];
|
|
449
489
|
constructor(options: Options_8);
|
|
450
490
|
create(): Promise<void>;
|
|
451
|
-
getLocationPosition(location: [number, number], name?: string): [number, number, number] | undefined;
|
|
491
|
+
getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
|
|
452
492
|
private calculatePosition;
|
|
453
493
|
render(): void;
|
|
454
494
|
rebuildFromScene(): void;
|
|
@@ -536,19 +576,28 @@ declare class Earth_2 extends Base_2 {
|
|
|
536
576
|
};
|
|
537
577
|
private rotationControls?;
|
|
538
578
|
private releaseRotationLock?;
|
|
579
|
+
private visibilityChecks?;
|
|
539
580
|
private readonly stopAutoRotate;
|
|
540
581
|
private readonly resumeAutoRotate;
|
|
541
582
|
protected onRuntimeReady(): Promise<void>;
|
|
542
583
|
protected onDispose(): void;
|
|
543
|
-
|
|
584
|
+
private getLocationFrame;
|
|
585
|
+
/** 球体表面的世界坐标;height 沿真实表面法线偏移,单位为世界单位。 */
|
|
586
|
+
getLocationPosition(location: [number, number], height?: number): [number, number, number];
|
|
587
|
+
/** 球对象原点对应的世界球心。 */
|
|
588
|
+
getCenter(): [number, number, number];
|
|
589
|
+
/** 几何的本地半径,用于创建同坐标空间的地图图层。 */
|
|
544
590
|
getRadius(): number;
|
|
545
|
-
|
|
591
|
+
/** 真球的世界半径;非均匀缩放或剪切形成椭球时不能用于球面路径。 */
|
|
592
|
+
getWorldRadius(): number;
|
|
593
|
+
private requireSurfaceTransform;
|
|
594
|
+
checkBehindEarth(objArr: () => BaseObject[], cb: (obj: BaseObject[], res: boolean[]) => any): () => void;
|
|
546
595
|
/**
|
|
547
596
|
* 设置物体在球面上的位置和旋转,使其垂直于球面
|
|
548
597
|
* @param object - 要设置的物体
|
|
549
598
|
* @param location - 经纬度 [经度, 纬度]
|
|
550
|
-
* @param height -
|
|
551
|
-
* @param upAxis -
|
|
599
|
+
* @param height - 沿球面世界法线的距离,默认为0
|
|
600
|
+
* @param upAxis - Plane 的本地面法线(默认 -Z,正面朝球心);其他对象的本地朝向轴(默认 Y)
|
|
552
601
|
*/
|
|
553
602
|
setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
|
|
554
603
|
getSceneBindings(): EarthSceneBindings;
|
|
@@ -682,7 +731,7 @@ declare class Map_3 extends Base_2 {
|
|
|
682
731
|
get adcode(): number | undefined;
|
|
683
732
|
activePlaneMap: PlaneMap | null;
|
|
684
733
|
/** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
|
|
685
|
-
private safeAreaInsets
|
|
734
|
+
private safeAreaInsets?;
|
|
686
735
|
private safeAreaRefitPending;
|
|
687
736
|
parentBg: PlaneMap[];
|
|
688
737
|
continentsBg?: ContinentsBg;
|
|
@@ -698,6 +747,8 @@ declare class Map_3 extends Base_2 {
|
|
|
698
747
|
* 和 sceneBindings,因此在场景刚恢复时记录,供后续 fitTo 复用设计师视角。
|
|
699
748
|
*/
|
|
700
749
|
private regionCameraFitReference?;
|
|
750
|
+
private authoredCameraPose?;
|
|
751
|
+
private cameraAngleOverrides?;
|
|
701
752
|
setOptions(options: MapOptions): void;
|
|
702
753
|
private _getProjectionCenter;
|
|
703
754
|
private _getProjectionRotate;
|
|
@@ -760,12 +811,15 @@ declare class Map_3 extends Base_2 {
|
|
|
760
811
|
private labelGroupObject3dUserData;
|
|
761
812
|
eraseLabels(): void;
|
|
762
813
|
geAdcodePosition(adcode: number): [number, number, number] | undefined;
|
|
763
|
-
|
|
814
|
+
/** 地图顶面的世界坐标;height 沿顶面世界法线偏移,单位为世界单位。 */
|
|
815
|
+
getLocationPosition(location: [number, number], height?: number): [number, number, number];
|
|
816
|
+
private getMainMapLocationPosition;
|
|
817
|
+
private worldToObjectParent;
|
|
764
818
|
/**
|
|
765
819
|
* 设置物体在平面地图上的位置
|
|
766
820
|
* @param object - 要设置的物体
|
|
767
821
|
* @param location - 经纬度 [经度, 纬度]
|
|
768
|
-
* @param height -
|
|
822
|
+
* @param height - 沿地图顶面法线的世界距离,默认为0
|
|
769
823
|
*/
|
|
770
824
|
setObjectOnMap(object: BaseObject, location: [number, number], height?: number): void;
|
|
771
825
|
setObjectOnMapAreaByProperty(object: BaseObject, key: string, value: any, height?: number): void;
|
|
@@ -783,16 +837,19 @@ declare class Map_3 extends Base_2 {
|
|
|
783
837
|
private _loadBaseGeojson;
|
|
784
838
|
private getGeojson;
|
|
785
839
|
/* Excluded from this release type: buildRegion */
|
|
840
|
+
/** 流式读取实际世界坐标,不复制或持有地图几何。 */
|
|
841
|
+
private cameraFitPoints;
|
|
842
|
+
private cameraForPose;
|
|
843
|
+
private captureCameraFitReference;
|
|
844
|
+
/** 没有选中命名视角时,使用导出场景中的实际相机朝向和位置。 */
|
|
845
|
+
private readAuthoredCameraPose;
|
|
846
|
+
private getCameraFitReference;
|
|
786
847
|
private calcPaddingFromReference;
|
|
787
848
|
fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, smoothTime, }?: {
|
|
788
849
|
adcode?: number;
|
|
789
850
|
polarAngle?: number;
|
|
790
851
|
azimuthAngle?: number;
|
|
791
|
-
reference?:
|
|
792
|
-
lookat: [number, number, number, number, number, number];
|
|
793
|
-
adcode?: number;
|
|
794
|
-
center?: [number, number];
|
|
795
|
-
};
|
|
852
|
+
reference?: MapCameraFitReference;
|
|
796
853
|
enableTransition?: boolean;
|
|
797
854
|
smoothTime?: number;
|
|
798
855
|
z?: number;
|
|
@@ -807,11 +864,11 @@ declare class Map_3 extends Base_2 {
|
|
|
807
864
|
adcode: number;
|
|
808
865
|
extrudelineBloom?: boolean;
|
|
809
866
|
}): Promise<PlaneMap>;
|
|
810
|
-
private hasSafeAreaInsets;
|
|
811
867
|
private getEffectiveSafeAreaPadding;
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
868
|
+
/** undefined 表示沿用设计师构图;对象(包括全 0)表示宿主覆盖。 */
|
|
869
|
+
getSafeAreaInsets(): MapSafeAreaInsets | undefined;
|
|
870
|
+
setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
871
|
+
refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<boolean>;
|
|
815
872
|
findAdcodeInfo(adcode: number): {
|
|
816
873
|
adcode: number;
|
|
817
874
|
lng: number;
|
|
@@ -848,7 +905,7 @@ declare class Map_3 extends Base_2 {
|
|
|
848
905
|
/* Excluded from this release type: rebuildRegion */
|
|
849
906
|
private rebuildRegionGeometry;
|
|
850
907
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
851
|
-
playRegionEnterTransition({ duration, sourceCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
908
|
+
playRegionEnterTransition({ duration, sourceCamera, preparedCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
852
909
|
/** Region rules are page-local runtime overrides of a saved material asset. */
|
|
853
910
|
private regionRuleMaterial;
|
|
854
911
|
private setRegionTexture;
|
|
@@ -871,6 +928,20 @@ declare interface MapAssetSources {
|
|
|
871
928
|
};
|
|
872
929
|
}
|
|
873
930
|
|
|
931
|
+
declare interface MapCameraFitReference {
|
|
932
|
+
lookat: MapCameraPose;
|
|
933
|
+
adcode?: number;
|
|
934
|
+
/** 兼容原有 reference 输入;留白计算使用真实地图几何。 */
|
|
935
|
+
center?: [number, number];
|
|
936
|
+
padding?: MapSafeAreaInsets;
|
|
937
|
+
viewport?: {
|
|
938
|
+
width: number;
|
|
939
|
+
height: number;
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
declare type MapCameraPose = [number, number, number, number, number, number];
|
|
944
|
+
|
|
874
945
|
declare interface MapCityOptions extends MapOptions {
|
|
875
946
|
cacheCity?: boolean;
|
|
876
947
|
nearbyCities?: boolean | 'full';
|
|
@@ -944,6 +1015,7 @@ export declare interface MapRegionBackInteraction {
|
|
|
944
1015
|
|
|
945
1016
|
declare interface MapRegionEnterTransitionOptions extends SceneEnterTransitionOptions {
|
|
946
1017
|
sourceCamera?: [number, number, number, number, number, number];
|
|
1018
|
+
/* Excluded from this release type: preparedCamera */
|
|
947
1019
|
}
|
|
948
1020
|
|
|
949
1021
|
export declare type MapRegionSceneResolver = (document: VisSceneDocument, adcode: number) => string | SceneViewportDocument | null | undefined | Promise<string | SceneViewportDocument | null | undefined>;
|
|
@@ -1255,6 +1327,7 @@ declare interface Options_5 extends NonNullable<ConstructorParameters<typeof Lin
|
|
|
1255
1327
|
to: number[];
|
|
1256
1328
|
control1?: number[];
|
|
1257
1329
|
control2?: number[];
|
|
1330
|
+
spherePath?: ArcSpherePath;
|
|
1258
1331
|
radius?: number;
|
|
1259
1332
|
globe?: boolean;
|
|
1260
1333
|
color?: string;
|
|
@@ -1268,6 +1341,7 @@ declare interface Options_6 {
|
|
|
1268
1341
|
multiplyScalar?: number;
|
|
1269
1342
|
/** Compact saved inputs for an Arc's derived picking geometry. */
|
|
1270
1343
|
arcControlPoints?: number[][];
|
|
1344
|
+
arcSpherePath?: ArcSpherePath;
|
|
1271
1345
|
}
|
|
1272
1346
|
|
|
1273
1347
|
declare interface Options_7 {
|
|
@@ -1526,6 +1600,14 @@ declare interface SceneControlsOptions {
|
|
|
1526
1600
|
autoRotateSpeed?: number;
|
|
1527
1601
|
}
|
|
1528
1602
|
|
|
1603
|
+
export declare interface SceneDisplayContext {
|
|
1604
|
+
sceneId: string;
|
|
1605
|
+
/** 本次准备前已重新适配地图相机;false 的缓存页保留此前视角。 */
|
|
1606
|
+
cameraRefitted: boolean;
|
|
1607
|
+
/** 文档替换或 manager 销毁时取消准备。 */
|
|
1608
|
+
signal: AbortSignal;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1529
1611
|
export declare interface SceneDocumentMarker {
|
|
1530
1612
|
format: typeof SCENE_DOCUMENT_FORMAT;
|
|
1531
1613
|
schemaVersion: number;
|
|
@@ -1567,8 +1649,9 @@ export declare class SceneManager extends Event_2 {
|
|
|
1567
1649
|
private isSwitching;
|
|
1568
1650
|
private isRegionSwitching;
|
|
1569
1651
|
private pencil?;
|
|
1570
|
-
private safeAreaInsets
|
|
1652
|
+
private safeAreaInsets?;
|
|
1571
1653
|
private generation;
|
|
1654
|
+
private displayPreparationAbort;
|
|
1572
1655
|
private documentIdentityRevision;
|
|
1573
1656
|
private preparedStructures;
|
|
1574
1657
|
private pendingInstances;
|
|
@@ -1592,11 +1675,12 @@ export declare class SceneManager extends Event_2 {
|
|
|
1592
1675
|
remapCommittedIdentity(sceneId: string, previous: string, next: string, objectIdentity: boolean): boolean;
|
|
1593
1676
|
/**
|
|
1594
1677
|
* 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
|
|
1595
|
-
*
|
|
1678
|
+
* 当前、缓存和加载中的地图。对象(包括全 0)替代设计留白;undefined 清除覆盖。
|
|
1596
1679
|
*/
|
|
1597
|
-
setSafeAreaInsets(insets
|
|
1598
|
-
getSafeAreaInsets(): MapSafeAreaInsets;
|
|
1680
|
+
setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
1681
|
+
getSafeAreaInsets(): MapSafeAreaInsets | undefined;
|
|
1599
1682
|
private captureCamera;
|
|
1683
|
+
private prepareSceneDisplay;
|
|
1600
1684
|
private playTransition;
|
|
1601
1685
|
/** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
|
|
1602
1686
|
setDocument(document: VisSceneDocument): void;
|
|
@@ -1724,6 +1808,8 @@ export declare interface SceneManagerBehaviorOptions {
|
|
|
1724
1808
|
debugInteractions?: boolean;
|
|
1725
1809
|
/** 创建场景后、恢复 JSON 前调用。 */
|
|
1726
1810
|
prepareScene?: (scene: Base_2) => void;
|
|
1811
|
+
/** 场景与最终相机就绪后、提交和首帧绘制前等待宿主准备。失败时保留原场景。 */
|
|
1812
|
+
beforeSceneDisplay?: (scene: Base_2, context: SceneDisplayContext) => void | Promise<void>;
|
|
1727
1813
|
/** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
|
|
1728
1814
|
cacheScenes?: boolean;
|
|
1729
1815
|
/** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
|
|
@@ -1920,6 +2006,26 @@ declare class Sphere extends MeshObject {
|
|
|
1920
2006
|
create(): void;
|
|
1921
2007
|
}
|
|
1922
2008
|
|
|
2009
|
+
/** Exact radial lift above the short great circle, expressed in object-local space. */
|
|
2010
|
+
declare class SphereArcCurve extends THREE.Curve<THREE.Vector3> {
|
|
2011
|
+
readonly type = "SphereArcCurve";
|
|
2012
|
+
readonly data: ArcSpherePath;
|
|
2013
|
+
readonly matrix: THREE.Matrix4;
|
|
2014
|
+
constructor(path: ArcSpherePath);
|
|
2015
|
+
get v0(): THREE.Vector3;
|
|
2016
|
+
get v3(): THREE.Vector3;
|
|
2017
|
+
getPoint(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2018
|
+
getTangent(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2019
|
+
clone(): this;
|
|
2020
|
+
copy(source: THREE.Curve<THREE.Vector3>): this;
|
|
2021
|
+
toJSON(): SphereArcCurveJSON;
|
|
2022
|
+
fromJSON(json: THREE.CurveJSON): this;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
declare interface SphereArcCurveJSON extends THREE.CurveJSON {
|
|
2026
|
+
spherePath: ArcSpherePath;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
1923
2029
|
declare class SphereShadow extends MeshObject {
|
|
1924
2030
|
objectType: string;
|
|
1925
2031
|
options: Required<Options_3>;
|
|
@@ -1993,7 +2099,7 @@ declare interface TweenOptions {
|
|
|
1993
2099
|
|
|
1994
2100
|
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
1995
2101
|
|
|
1996
|
-
export declare const VERSION = "0.33.
|
|
2102
|
+
export declare const VERSION = "0.33.4";
|
|
1997
2103
|
|
|
1998
2104
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
1999
2105
|
entrySceneId: string;
|