gltf-parser-plugin 1.1.1 → 1.1.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/build/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Box3 } from 'three';
|
|
1
2
|
import { EventDispatcher } from 'three';
|
|
2
3
|
import { Intersection } from 'three';
|
|
3
4
|
import { Material } from 'three';
|
|
4
5
|
import { Mesh } from 'three';
|
|
5
6
|
import { Texture } from 'three';
|
|
6
7
|
import { TilesRenderer } from '3d-tiles-renderer';
|
|
8
|
+
import { Vector2 } from 'three';
|
|
7
9
|
import { WebGLRenderer } from 'three';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -78,6 +80,25 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
78
80
|
* 首次调用时会自动请求
|
|
79
81
|
*/
|
|
80
82
|
getStructureData(): Promise<StructureData | null>;
|
|
83
|
+
private _pointInPolygon;
|
|
84
|
+
private _segmentsIntersect;
|
|
85
|
+
private _polygonIntersectsRect;
|
|
86
|
+
/**
|
|
87
|
+
* 选择包围盒范围内的构件(包含相交和包含两种情况)
|
|
88
|
+
* @param box 查询用的 Box3 范围,坐标系与 structure.json 中 bbox 一致
|
|
89
|
+
* @returns 范围内所有构件的 oid 数组
|
|
90
|
+
*/
|
|
91
|
+
selectByBox(box: Box3): Promise<number[]>;
|
|
92
|
+
/**
|
|
93
|
+
* 选择多边形(平面投影)范围内的构件(包含相交和包含两种情况)
|
|
94
|
+
* @param polygon 多边形顶点数组(Vector2),按顺序连接构成闭合多边形
|
|
95
|
+
* @param axis 投影平面,决定使用 bbox 的哪两个轴做 2D 判定
|
|
96
|
+
* - 'xz'(默认):俯视图,取 bbox 的 x/z 坐标
|
|
97
|
+
* - 'xy':正视图,取 bbox 的 x/y 坐标
|
|
98
|
+
* - 'yz':侧视图,取 bbox 的 y/z 坐标
|
|
99
|
+
* @returns 范围内所有构件的 oid 数组
|
|
100
|
+
*/
|
|
101
|
+
selectByPolygon(polygon: Vector2[], axis?: "xy" | "xz" | "yz"): Promise<number[]>;
|
|
81
102
|
private _getModelInfoUrl;
|
|
82
103
|
private _fetchModelInfo;
|
|
83
104
|
private _ensureModelInfoLoaded;
|
|
@@ -122,10 +143,18 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
122
143
|
* 冻结指定构件,被冻结的构件不再响应任何交互和事件
|
|
123
144
|
*/
|
|
124
145
|
freezeByOids(oids: number[]): void;
|
|
146
|
+
/**
|
|
147
|
+
* 冻结单个构件
|
|
148
|
+
*/
|
|
149
|
+
freezeByOid(oid: number): void;
|
|
125
150
|
/**
|
|
126
151
|
* 解冻指定构件
|
|
127
152
|
*/
|
|
128
153
|
unfreezeByOids(oids: number[]): void;
|
|
154
|
+
/**
|
|
155
|
+
* 解冻单个构件
|
|
156
|
+
*/
|
|
157
|
+
unfreezeByOid(oid: number): void;
|
|
129
158
|
/**
|
|
130
159
|
* 解冻全部构件
|
|
131
160
|
*/
|
|
@@ -138,10 +167,18 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
138
167
|
* 隔离指定构件,隔离模式下只有被隔离的构件才能响应交互和事件
|
|
139
168
|
*/
|
|
140
169
|
isolateByOids(oids: number[]): void;
|
|
170
|
+
/**
|
|
171
|
+
* 往隔离集合中添加单个构件
|
|
172
|
+
*/
|
|
173
|
+
isolateByOid(oid: number): void;
|
|
141
174
|
/**
|
|
142
175
|
* 取消隔离指定构件
|
|
143
176
|
*/
|
|
144
177
|
unisolateByOids(oids: number[]): void;
|
|
178
|
+
/**
|
|
179
|
+
* 从隔离集合中移除单个构件
|
|
180
|
+
*/
|
|
181
|
+
unisolateByOid(oid: number): void;
|
|
145
182
|
/**
|
|
146
183
|
* 取消全部隔离,恢复所有构件的交互能力
|
|
147
184
|
*/
|