@mapgis/webclient-cesium-plugin 17.8.1 → 17.10.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/README.md +280 -482
- package/dist/esm/commonjsHelpers.js +1 -0
- package/dist/esm/s3m.js +1 -0
- package/dist/esm/webclient-cesium-plugin.js +1 -0
- package/dist/umd/webclient-cesium-plugin.min.js +1 -0
- package/{documention → documentation}/AlgorithmLib.html +169 -149
- package/{documention → documentation}/AngulationTool.html +85 -51
- package/{documention → documentation}/AnimationTool.html +30 -30
- package/{documention → documentation}/ArcGISMapServerImageryProvider.html +9 -13
- package/{documention → documentation}/ArcGISMapServerSingleImageryProvider.html +90 -30
- package/{documention → documentation}/ArcGISTileServerImageryProvider.html +17 -17
- package/{documention → documentation}/ArcGISVectorTileImageryProvider.html +21 -8
- package/{documention → documentation}/BaseImageryProvider.html +2 -2
- package/{documention → documentation}/Cesium.Material.html +2 -2
- package/{documention → documentation}/Cesium.Viewer.html +5 -5
- package/{documention → documentation}/Cesium3DTileset.html +43 -25
- package/{documention → documentation}/CesiumHeatmap.html +22 -19
- package/{documention/S3MTileset.html → documentation/CesiumNavigation.html} +52 -85
- package/{documention → documentation}/CesiumTerrainProvider.html +55 -15
- package/{documention/OpenWeatherImageryProvider.html → documentation/CircleWaveMaterialProperty.html} +75 -95
- package/{documention → documentation}/CollisionDetectionByRender.html +245 -88
- package/{documention → documentation}/CompatibleFunc.html +24 -33
- package/{documention → documentation}/CustomPrimitive.html +3 -5
- package/{documention → documentation}/CustomProjection.html +3 -3
- package/{documention → documentation}/CustomTilingScheme.html +35 -36
- package/{documention → documentation}/CutFillAnalysis.html +59 -27
- package/{documention → documentation}/CuttingTool.html +198 -103
- package/{documention → documentation}/Deferred.html +2 -2
- package/{documention → documentation}/DrawElement.html +418 -34
- package/{documention → documentation}/DrawTool.html +81 -29
- package/documentation/EditTool.html +2819 -0
- package/{documention → documentation}/FirstPersonPerspective.html +18 -10
- package/{documention → documentation}/FloodAnalysis.html +93 -23
- package/{documention → documentation}/FloodAnalysisReflection.html +18 -44
- package/documentation/FlowParticle.html +863 -0
- package/{documention → documentation}/Fluid.html +473 -74
- package/{documention → documentation}/FluidFoam.html +36 -16
- package/{documention → documentation}/FluidReflection.html +68 -15
- package/{documention → documentation}/FluidShadow.html +67 -14
- package/{documention → documentation}/FluidSourceCollection.html +14 -7
- package/{documention → documentation}/FluidSpecular.html +33 -14
- package/documentation/FluidSurfaceDistortion.html +682 -0
- package/documentation/FluidSurfaceFoam.html +1006 -0
- package/{documention → documentation}/FollowPerspective.html +15 -7
- package/{documention → documentation}/GeoJSONLayerUtil.html +38 -10
- package/documentation/GeoJSONLayerView.html +1353 -0
- package/{documention → documentation}/GlobeIndependentTranslucency.html +89 -6
- package/{documention → documentation}/GodPerspective.html +14 -6
- package/{documention → documentation}/Graphic.html +1053 -1042
- package/{documention → documentation}/GraphicTransformTool.html +65 -23
- package/{documention → documentation}/GraphicsLayer.html +359 -156
- package/{documention → documentation}/GraphicsLayerUtil.html +28 -10
- package/documentation/GraphicsLayerView.html +759 -0
- package/{documention/EditTool.html → documentation/HashMap.html} +253 -418
- package/{documention → documentation}/HeightLimited.html +54 -21
- package/documentation/IGSFeatureLayerUtil.html +840 -0
- package/documentation/IGSFeatureLayerView.html +1348 -0
- package/documentation/IGSMapImageLayerUtil.html +855 -0
- package/{documention/IGSFeatureLayerUtil.html → documentation/IGSMapImageLayerView.html} +68 -46
- package/documentation/IGSTileLayerView.html +658 -0
- package/{documention → documentation}/ISSceneLayerUtil.html +3 -3
- package/{documention → documentation}/KeyboardCameraController.html +54 -6
- package/documentation/LightningStorm.html +2073 -0
- package/documentation/MapGISClusterPrimitiveCollection.html +1050 -0
- package/{documention → documentation}/MapGISDynamicLabelCollection.html +370 -178
- package/{documention → documentation}/MapGISFeatureGridCollection.html +123 -89
- package/{documention → documentation}/MapGISImageServerImageryProvider.html +93 -71
- package/{documention → documentation}/MapGISImageServerSingleImageryProvider.html +140 -92
- package/{documention → documentation}/MapGISM3DSet.html +49 -33
- package/{documention → documentation}/MapGISMapServerImageryProvider.html +78 -87
- package/{documention → documentation}/MapGISMapServerSingleImageryProvider.html +111 -43
- package/{documention → documentation}/MapGISTerrainProvider.html +268 -208
- package/{documention → documentation}/MapGISTerrainService.html +124 -82
- package/{documention → documentation}/MapGISTileAvailability.html +104 -47
- package/{documention → documentation}/MapGISTileServerImageryProvider.html +76 -83
- package/{documention → documentation}/MapGISVectorTileImageryProvider.html +135 -115
- package/{documention → documentation}/MeasureAreaTool.html +53 -14
- package/{documention → documentation}/MeasureLengthTool.html +17 -14
- package/{documention → documentation}/MeasureSlopeTool.html +73 -34
- package/{documention/FlowParticle.html → documentation/ModelEditor.html} +132 -116
- package/{documention → documentation}/ModelFilterTool.html +27 -32
- package/{documention → documentation}/ModelTransformTool.html +195 -110
- package/{documention → documentation}/NavigationControl.html +25 -5
- package/{documention → documentation}/NavigationTool.html +36 -14
- package/{documention → documentation}/NormalPerspective.html +33 -7
- package/documentation/OpenWeatherImageryProvider.html +1133 -0
- package/{documention → documentation}/PointFluidSource.html +22 -13
- package/{documention → documentation}/PolylineTrailLinkMaterialProperty.html +104 -20
- package/{documention → documentation}/Popup.html +246 -63
- package/{documention/CesiumNavigation.html → documentation/PostProcessShaderBuilder.html} +10 -54
- package/{documention → documentation}/PostProcessStageLibrary.html +3127 -121
- package/{documention → documentation}/Promise.html +6 -6
- package/{documention → documentation}/ProviderBaseUrlRegExp.html +20 -4
- package/{documention → documentation}/Puddle.html +30 -9
- package/{documention → documentation}/RadarMaterialProperty.html +73 -18
- package/{documention → documentation}/ReImg.html +164 -15
- package/{documention → documentation}/RenderUtil.html +158 -6
- package/{documention → documentation}/ResetViewNavigationControl.html +28 -8
- package/{documention → documentation}/RiverGeometry.html +7 -7
- package/{documention → documentation}/RoamParticle.html +86 -79
- package/{documention → documentation}/RouteAnimationControl.html +37 -15
- package/{documention → documentation}/RouteAnimationLabel.html +39 -12
- package/{documention → documentation}/RouteAnimationModel.html +43 -16
- package/{documention → documentation}/RouteAnimationPath.html +156 -18
- package/{documention → documentation}/RouteAnimationPerspective.html +12 -3
- package/{documention → documentation}/RouteAnimationTool.html +244 -24
- package/documentation/S3MTileset.html +570 -0
- package/{documention → documentation}/SSR.html +20 -39
- package/{documention → documentation}/SceneView.html +615 -419
- package/documentation/SceneViewUtil.html +1253 -0
- package/documentation/Screenshot.html +964 -0
- package/{documention → documentation}/SelectTool.html +31 -77
- package/{documention → documentation}/ShadowRateAnalysis.html +236 -54
- package/{documention → documentation}/ShadowRateDrawCommand.html +18 -6
- package/{documention → documentation}/SingleImageryProvider.html +32 -10
- package/{documention → documentation}/SketchEditor.html +280 -127
- package/documentation/SkyLineAnalysis.html +576 -0
- package/{documention → documentation}/StableParticle.html +165 -46
- package/{documention → documentation}/Style.html +249 -249
- package/{documention → documentation}/TerrainAnalyse.html +391 -105
- package/{documention → documentation}/TerrainExcavateTool.html +99 -3
- package/{documention → documentation}/TerrainProfile.html +198 -56
- package/{documention → documentation}/ThemeManager.html +93 -42
- package/{documention → documentation}/Tooltip.html +35 -18
- package/documentation/TransformTool.html +1010 -0
- package/{documention → documentation}/TriangulationTool.html +122 -83
- package/documentation/UnderfluidCaustic.html +843 -0
- package/documentation/UnderfluidDistortion.html +600 -0
- package/documentation/UnderfluidFog.html +843 -0
- package/documentation/UnderfluidGodRay.html +843 -0
- package/documentation/UnderwaterCaustic.html +867 -0
- package/documentation/UnderwaterDistortion.html +578 -0
- package/documentation/UnderwaterFog.html +867 -0
- package/documentation/UnderwaterGodRay.html +821 -0
- package/{documention → documentation}/UrlTemplateImageryProvider.html +21 -9
- package/{documention → documentation}/UserInterfaceControl.html +28 -9
- package/documentation/VectorTileLayerUtil.html +1364 -0
- package/{documention → documentation}/VisiblityAnalysis.html +15 -12
- package/{documention → documentation}/VolumeCloud.html +113 -21
- package/{documention → documentation}/VolumeFluidSource.html +24 -8
- package/{documention → documentation}/WFSLayerUtil.html +39 -10
- package/documentation/WFSLayerView.html +1353 -0
- package/documentation/WMSLayerUtil.html +879 -0
- package/documentation/WMTSLayerUtil.html +877 -0
- package/documentation/WaterDepth.html +583 -0
- package/{documention → documentation}/WaterReflection.html +29 -26
- package/documentation/WaterSurface.html +2555 -0
- package/{documention/Underwater.html → documentation/WaterSurfaceDistortion.html} +79 -81
- package/documentation/WaterSurfaceFoam.html +1029 -0
- package/documentation/WaterSurfaceSSR.html +867 -0
- package/{documention → documentation}/WebMapServiceImageryProvider.html +8 -12
- package/{documention → documentation}/WebMapServiceSingleImageryProvider.html +94 -32
- package/{documention → documentation}/WebMapTileServiceImageryProvider.html +10 -15
- package/documentation/WebTileLayerUtil.html +877 -0
- package/{documention → documentation}/Wind3D.html +133 -54
- package/{documention → documentation}/ZoomNavigationControl.html +145 -9
- package/documentation/fonts/glyphicons-halflings-regular.svg +543 -0
- package/{documention → documentation}/global.html +14130 -2719
- package/{documention → documentation}/index.html +1 -1
- package/{documention → documentation}/initializeOptions.html +2 -2
- package/{documention → documentation}/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.EchartsLayer.html +96 -95
- package/{documention → documentation}/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.MapVLayer.html +47 -46
- package/{documention → documentation}/module.exports_module.exports.html +2 -2
- package/{documention → documentation}/nav.html +3267 -1392
- package/documentation/nav.json +320 -0
- package/documentation/styles/adminlte/AdminLTE.min.css +4966 -0
- package/documentation/styles/adminlte/skin-blue.min.css +135 -0
- package/documentation/styles/bootstrap.min.css +7005 -0
- package/documentation/styles/common.css +173 -0
- package/documentation/styles/examples.css +119 -0
- package/{documention → documentation}/styles/font-awesome.css +692 -687
- package/documentation/styles/header.css +558 -0
- package/documentation/styles/jaguar.css +551 -0
- package/{documention → documentation}/styles/prettify-tomorrow.css +59 -28
- package/{documention → documentation}/styles/style.customize.css +83 -99
- package/package.json +42 -22
- package/dist/es5/webclient-cesium-plugin.min.js +0 -77
- package/dist/es5/webclient-common.min.js +0 -159
- package/dist/webclient-cesium-plugin-es6.min.js +0 -77
- package/documention/CircleWaveMaterialProperty.html +0 -382
- package/documention/DynamicEntityVisualizer.html +0 -348
- package/documention/DynamicLabelLayer.html +0 -1841
- package/documention/GroundPrimitiveLayer.html +0 -1675
- package/documention/HashMap.html +0 -4197
- package/documention/ModelEditor.html +0 -374
- package/documention/SceneViewCesium.html +0 -5544
- package/documention/Screenshot.html +0 -773
- package/documention/SketchEditorCesium.html +0 -1571
- package/documention/createColorTexture.html +0 -369
- package/documention/fonts/glyphicons-halflings-regular.svg +0 -288
- package/documention/isCounterClockwise.html +0 -760
- package/documention/scripts/app.min.js +0 -1
- package/documention/scripts/jquery.min.map +0 -1
- package/documention/scripts/search.js +0 -20
- package/documention/scripts/sideBar.js +0 -228
- package/documention/scripts/underscore-min.map +0 -1
- package/documention/styles/adminlte/AdminLTE.min.css +0 -7
- package/documention/styles/adminlte/skin-blue.min.css +0 -1
- package/documention/styles/anchor.png +0 -0
- package/documention/styles/app.min.css +0 -1
- package/documention/styles/bootstrap.min.css +0 -6
- package/documention/styles/c.png +0 -0
- package/documention/styles/common.css +0 -175
- package/documention/styles/examples.css +0 -116
- package/documention/styles/header.css +0 -556
- package/documention/styles/iframe.css +0 -29
- package/documention/styles/jaguar.css +0 -553
- package/documention/styles/m.png +0 -0
- package/documention/styles/reset.css +0 -44
- package/documention/styles/up-arrow.png +0 -0
- package/documention/tutorial-1./345/277/253/351/200/237/345/205/245/351/227/250.html +0 -162
- /package/{documention → documentation}/fonts/fontawesome-webfont.woff2 +0 -0
- /package/{documention → documentation}/fonts/glyphicons-halflings-regular.eot +0 -0
- /package/{documention → documentation}/fonts/glyphicons-halflings-regular.ttf +0 -0
- /package/{documention → documentation}/fonts/glyphicons-halflings-regular.woff +0 -0
- /package/{documention → documentation}/fonts/glyphicons-halflings-regular.woff2 +0 -0
- /package/{documention → documentation}/scripts/adminlte/app.min.js +0 -0
- /package/{documention → documentation}/scripts/bootstrap.min.js +0 -0
- /package/{documention → documentation}/scripts/jquery.min.js +0 -0
- /package/{documention → documentation}/scripts/linenumber.js +0 -0
- /package/{documention → documentation}/scripts/main.js +0 -0
- /package/{documention → documentation}/scripts/prettify/Apache-License-2.0.txt +0 -0
- /package/{documention → documentation}/scripts/prettify/lang-css.js +0 -0
- /package/{documention → documentation}/scripts/prettify/prettify.js +0 -0
- /package/{documention → documentation}/scripts/underscore-min.js +0 -0
- /package/{documention → documentation}/styles/adminlte/font-awesome.min.css +0 -0
- /package/{documention → documentation}/styles/prettify-jsdoc.css +0 -0
|
@@ -71,8 +71,6 @@
|
|
|
71
71
|
|
|
72
72
|
</h2>
|
|
73
73
|
|
|
74
|
-
<div class="class-description"><p>CollisionDetectionByRender</p></div>
|
|
75
|
-
|
|
76
74
|
</header>
|
|
77
75
|
|
|
78
76
|
<article>
|
|
@@ -90,7 +88,7 @@
|
|
|
90
88
|
|
|
91
89
|
|
|
92
90
|
<div class="tag-source">
|
|
93
|
-
engineExtensions/analysis/CollisionDetectionByRender.js, line
|
|
91
|
+
engineExtensions/analysis/CollisionDetectionByRender.js, line 4
|
|
94
92
|
</div>
|
|
95
93
|
|
|
96
94
|
</div>
|
|
@@ -100,6 +98,17 @@
|
|
|
100
98
|
<dd>
|
|
101
99
|
|
|
102
100
|
|
|
101
|
+
<div class="description">
|
|
102
|
+
<p>基于深度渲染的碰撞检测工具。</p>
|
|
103
|
+
<p><code>CollisionDetectionByRender</code> 会为相机、M3D 模型或 Entity 构建一个碰撞盒,
|
|
104
|
+
通过俯视与正视两个深度视图判断目标位置是否与场景发生碰撞。该方案更适合室内、小范围、低速漫游场景;
|
|
105
|
+
当物体单帧位移过大、目标区域不在当前视锥可见范围内,或碰撞对象形态过于尖锐时,检测结果可能出现误差。</p>
|
|
106
|
+
<p>使用限制:
|
|
107
|
+
高速运动物体容易出现穿隧问题,即单帧位移超过碰撞盒检测范围时可能跳过碰撞结果。
|
|
108
|
+
场景相机不可见区域可能因 Cesium 视锥剔除而缺少深度信息,导致后退或遮挡区域检测失效。
|
|
109
|
+
对锥形等尖锐物体,默认边框检测模式可能无法完整覆盖目标,可改用高精度模式提升识别率,但会增加性能开销。</p>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
103
112
|
|
|
104
113
|
|
|
105
114
|
|
|
@@ -118,6 +127,8 @@
|
|
|
118
127
|
<th>Type</th>
|
|
119
128
|
|
|
120
129
|
|
|
130
|
+
<th>Default</th>
|
|
131
|
+
|
|
121
132
|
|
|
122
133
|
<th class="last">Description</th>
|
|
123
134
|
</tr>
|
|
@@ -134,13 +145,17 @@
|
|
|
134
145
|
<td class="type">
|
|
135
146
|
|
|
136
147
|
|
|
137
|
-
<span class="param-type">Viewer</span>
|
|
148
|
+
<span class="param-type"><a href="Cesium.Viewer.html">Cesium.Viewer</a></span>
|
|
138
149
|
|
|
139
150
|
|
|
140
151
|
|
|
141
152
|
</td>
|
|
142
153
|
|
|
143
154
|
|
|
155
|
+
<td class="default">
|
|
156
|
+
|
|
157
|
+
</td>
|
|
158
|
+
|
|
144
159
|
|
|
145
160
|
<td class="description last">
|
|
146
161
|
|
|
@@ -149,7 +164,7 @@
|
|
|
149
164
|
|
|
150
165
|
|
|
151
166
|
|
|
152
|
-
<p
|
|
167
|
+
<p>场景视图对象。</p></td>
|
|
153
168
|
</tr>
|
|
154
169
|
|
|
155
170
|
|
|
@@ -175,6 +190,10 @@
|
|
|
175
190
|
</td>
|
|
176
191
|
|
|
177
192
|
|
|
193
|
+
<td class="default">
|
|
194
|
+
|
|
195
|
+
</td>
|
|
196
|
+
|
|
178
197
|
|
|
179
198
|
<td class="description last">
|
|
180
199
|
|
|
@@ -183,7 +202,7 @@
|
|
|
183
202
|
|
|
184
203
|
|
|
185
204
|
|
|
186
|
-
<p
|
|
205
|
+
<p>需要参与碰撞检测的对象。</p></td>
|
|
187
206
|
</tr>
|
|
188
207
|
|
|
189
208
|
|
|
@@ -203,6 +222,12 @@
|
|
|
203
222
|
</td>
|
|
204
223
|
|
|
205
224
|
|
|
225
|
+
<td class="default">
|
|
226
|
+
|
|
227
|
+
{}
|
|
228
|
+
|
|
229
|
+
</td>
|
|
230
|
+
|
|
206
231
|
|
|
207
232
|
<td class="description last">
|
|
208
233
|
|
|
@@ -213,7 +238,7 @@
|
|
|
213
238
|
|
|
214
239
|
|
|
215
240
|
|
|
216
|
-
<p
|
|
241
|
+
<p>碰撞检测初始化参数。</p>
|
|
217
242
|
|
|
218
243
|
|
|
219
244
|
<table class="params">
|
|
@@ -267,7 +292,7 @@
|
|
|
267
292
|
|
|
268
293
|
|
|
269
294
|
|
|
270
|
-
<p
|
|
295
|
+
<p>碰撞盒长度,单位为米。</p></td>
|
|
271
296
|
</tr>
|
|
272
297
|
|
|
273
298
|
|
|
@@ -303,7 +328,7 @@
|
|
|
303
328
|
|
|
304
329
|
|
|
305
330
|
|
|
306
|
-
<p
|
|
331
|
+
<p>碰撞盒宽度,单位为米。</p></td>
|
|
307
332
|
</tr>
|
|
308
333
|
|
|
309
334
|
|
|
@@ -339,10 +364,7 @@
|
|
|
339
364
|
|
|
340
365
|
|
|
341
366
|
|
|
342
|
-
<p
|
|
343
|
-
<br/><br/>
|
|
344
|
-
原点高度属性用于通知碰撞检测实例碰撞对象的坐标原点所在的高度,如单体模型的坐标原点有的在其底部,有的在其中间。<br/>
|
|
345
|
-
默认值设为1.7是因为默认的碰撞对象是相机。</p></td>
|
|
367
|
+
<p>碰撞盒高度,单位为米。</p></td>
|
|
346
368
|
</tr>
|
|
347
369
|
|
|
348
370
|
|
|
@@ -364,7 +386,7 @@
|
|
|
364
386
|
|
|
365
387
|
<td class="default">
|
|
366
388
|
|
|
367
|
-
(0,0,0)
|
|
389
|
+
new Cesium.Cartesian3(0, 0, 0)
|
|
368
390
|
|
|
369
391
|
</td>
|
|
370
392
|
|
|
@@ -378,7 +400,43 @@
|
|
|
378
400
|
|
|
379
401
|
|
|
380
402
|
|
|
381
|
-
<p
|
|
403
|
+
<p>碰撞盒相对碰撞对象原点的位置偏移,单位为米。</p></td>
|
|
404
|
+
</tr>
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
<tr>
|
|
409
|
+
|
|
410
|
+
<td class="name"><code>colliderThickness</code></td>
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
<td class="type">
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<span class="param-type">Number</span>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</td>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
<td class="default">
|
|
424
|
+
|
|
425
|
+
1
|
|
426
|
+
|
|
427
|
+
</td>
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
<td class="description last">
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
<span class="optional"> 可选</span>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
<p>碰撞盒边框检测厚度。</p></td>
|
|
382
440
|
</tr>
|
|
383
441
|
|
|
384
442
|
|
|
@@ -414,7 +472,7 @@
|
|
|
414
472
|
|
|
415
473
|
|
|
416
474
|
|
|
417
|
-
<p
|
|
475
|
+
<p>发生碰撞后允许自动抬升通过的最大高度,单位为米。</p></td>
|
|
418
476
|
</tr>
|
|
419
477
|
|
|
420
478
|
|
|
@@ -450,9 +508,7 @@
|
|
|
450
508
|
|
|
451
509
|
|
|
452
510
|
|
|
453
|
-
<p
|
|
454
|
-
<br/><br/>
|
|
455
|
-
基于性能考虑默认不开启高精度碰撞检测。非高精度状态下只检测碰撞盒的边框所覆盖的区域,高精度状态下对碰撞盒覆盖的整个区域做检测。</p></td>
|
|
511
|
+
<p>是否开启高精度模式。关闭时仅检测碰撞盒边框,开启后检测整个盒体覆盖区域。</p></td>
|
|
456
512
|
</tr>
|
|
457
513
|
|
|
458
514
|
|
|
@@ -488,7 +544,7 @@
|
|
|
488
544
|
|
|
489
545
|
|
|
490
546
|
|
|
491
|
-
<p
|
|
547
|
+
<p>是否显示深度图调试结果。</p></td>
|
|
492
548
|
</tr>
|
|
493
549
|
|
|
494
550
|
|
|
@@ -524,12 +580,7 @@
|
|
|
524
580
|
|
|
525
581
|
|
|
526
582
|
|
|
527
|
-
<p
|
|
528
|
-
<br/><br/>
|
|
529
|
-
debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果,所以并不能精确的表示碰撞盒与场景的碰撞关系。<br/>
|
|
530
|
-
深度图中可查看到较为精确的碰撞关系。<br/>
|
|
531
|
-
开启碰撞盒检查主要是为了方便调整碰撞盒与模型相匹配。<br/>
|
|
532
|
-
相机做为碰撞对象时,开启碰撞盒检查,相机会被碰撞盒包在里面。</p></td>
|
|
583
|
+
<p>是否显示碰撞盒调试结果。</p></td>
|
|
533
584
|
</tr>
|
|
534
585
|
|
|
535
586
|
|
|
@@ -580,11 +631,127 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
580
631
|
|
|
581
632
|
|
|
582
633
|
|
|
583
|
-
<h5>
|
|
634
|
+
<h5>Examples</h5>
|
|
584
635
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
<pre class="prettyprint"><code>const { CollisionDetectionByRender } = zondy.cesium
|
|
588
636
|
camera.setView({
|
|
589
637
|
destination: result.computedPosition,
|
|
590
638
|
orientation: {
|
|
591
639
|
heading: camera.heading,
|
|
592
640
|
pitch: camera.pitch,
|
|
593
641
|
roll: 0.0
|
|
594
642
|
}
|
|
595
643
|
});
|
|
596
644
|
maximumScreenSpaceError: 0,
|
|
597
645
|
autoReset: false,
|
|
598
646
|
loaded: function(layer) {
|
|
599
647
|
m3d = layer;
|
|
600
648
|
collisionDetection = new CollisionDetectionByRender(viewer, layer._root, {
|
|
601
649
|
colliderLength: 0.8, // 设置碰撞盒长
|
|
602
650
|
colliderWidth: 0.6, // 设置碰撞盒宽
|
|
603
651
|
colliderHeight: 1, // 设置碰撞盒高
|
|
604
652
|
colliderPositionOffset: new Cesium.Cartesian3(0, 0, 0.5), // 设置碰撞盒偏移
|
|
605
653
|
debugShowCollider: true, // 打开debug模式,碰撞盒检查
|
|
606
654
|
debugShowDepthMap: true // 打开debug模式,深度图检查
|
|
607
655
|
});
|
|
608
656
|
}
|
|
609
657
|
// 获取模型变换矩阵
|
|
610
658
|
let modelMatrix = m3d.tileset.modelMatrix;
|
|
611
659
|
// 求模型变换矩阵的逆
|
|
612
660
|
Cesium.Matrix4.inverse(modelMatrix, invModelMat);
|
|
613
661
|
// 未碰撞移动到该位置
|
|
614
662
|
Cesium.Matrix4.setTranslation(transform, result.computedPosition, newTransform);
|
|
615
663
|
// 乘上模型变换矩阵的逆矩阵
|
|
616
664
|
Cesium.Matrix4.multiply(invModelMat, newTransform, newTransform);
|
|
617
665
|
// 设置新的变换矩阵
|
|
618
666
|
m3d.transform = Cesium.Matrix4.clone(newTransform);
|
|
619
667
|
name: url,
|
|
620
668
|
position: position,
|
|
621
669
|
orientation: orientation,
|
|
622
670
|
model: {
|
|
623
671
|
uri: url,
|
|
624
672
|
minimumPixelSize: 32,
|
|
625
673
|
maximumScale: 20000,
|
|
626
674
|
},
|
|
627
675
|
colliderLength: 2,
|
|
628
676
|
colliderWidth: 0.6,
|
|
629
677
|
colliderHeight: 0.6,
|
|
630
678
|
colliderPositionOffset: new Cesium.Cartesian3(0, 0, 0.6)
|
|
631
679
|
entity.position = result.computedPosition;
|
|
632
680
|
debugShowCollider: false, // 相机做为碰撞检测对象时不打开碰撞盒检查
|
|
633
681
|
debugShowDepthMap: true, // 打开debug模式,深度图检查
|
|
682
|
+
<p class="code-caption"><h7 id='example1'>相机碰撞检测</h7></p>
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
687
|
+
const { CollisionDetectionByRender } = zondy.cesium
|
|
688
|
+
|
|
689
|
+
// ES6引入方式
|
|
690
|
+
import { CollisionDetectionByRender } from "@mapgis/webclient-cesium-plugin"
|
|
691
|
+
|
|
692
|
+
const collisionDetection = new CollisionDetectionByRender(viewer, viewer.camera, {
|
|
693
|
+
colliderHeight: 1.7,
|
|
694
|
+
maxPassableHeight: 0.5
|
|
695
|
+
})
|
|
696
|
+
const result = collisionDetection.checkCollision(targetPosition, viewer.camera.heading)
|
|
697
|
+
if (result.result !== 'collided') {
|
|
698
|
+
viewer.camera.setView({
|
|
699
|
+
destination: result.computedPosition,
|
|
700
|
+
orientation: {
|
|
701
|
+
heading: viewer.camera.heading,
|
|
702
|
+
pitch: viewer.camera.pitch,
|
|
703
|
+
roll: 0.0
|
|
704
|
+
}
|
|
705
|
+
})
|
|
706
|
+
}</code></pre>
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
<p class="code-caption"><h7 id='example2'>M3D 模型碰撞检测</h7></p>
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
714
|
+
const { CollisionDetectionByRender } = zondy.cesium
|
|
715
|
+
|
|
716
|
+
// ES6引入方式
|
|
717
|
+
import { CollisionDetectionByRender } from "@mapgis/webclient-cesium-plugin"
|
|
718
|
+
|
|
719
|
+
let collisionDetection
|
|
720
|
+
let m3d
|
|
721
|
+
const url = 'http://192.168.82.89:8200/3DData/ModelCache/M3D/2.0/wujiangdizhiti/wujiangdizhiti.mcj'
|
|
722
|
+
const options = {
|
|
723
|
+
maximumScreenSpaceError: 0,
|
|
724
|
+
autoReset: false,
|
|
725
|
+
loaded(layer) {
|
|
726
|
+
m3d = layer
|
|
727
|
+
collisionDetection = new CollisionDetectionByRender(viewer, layer._root, {
|
|
728
|
+
colliderLength: 0.8,
|
|
729
|
+
colliderWidth: 0.6,
|
|
730
|
+
colliderHeight: 1,
|
|
731
|
+
colliderPositionOffset: new Cesium.Cartesian3(0, 0, 0.5),
|
|
732
|
+
debugShowCollider: true,
|
|
733
|
+
debugShowDepthMap: true
|
|
734
|
+
})
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
viewer.scene.layers.appendM3DLayer(url, options)
|
|
738
|
+
const result = collisionDetection.checkCollision(targetPosition, 0)
|
|
739
|
+
const transform = m3d.computedTransform
|
|
740
|
+
const newTransform = new Cesium.Matrix4()
|
|
741
|
+
const invModelMat = new Cesium.Matrix4()
|
|
742
|
+
if (result.result !== 'collided') {
|
|
743
|
+
const modelMatrix = m3d.tileset.modelMatrix
|
|
744
|
+
Cesium.Matrix4.inverse(modelMatrix, invModelMat)
|
|
745
|
+
Cesium.Matrix4.setTranslation(transform, result.computedPosition, newTransform)
|
|
746
|
+
Cesium.Matrix4.multiply(invModelMat, newTransform, newTransform)
|
|
747
|
+
m3d.transform = Cesium.Matrix4.clone(newTransform)
|
|
748
|
+
}</code></pre>
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
<p class="code-caption"><h7 id='example3'>Entity 模型碰撞检测</h7></p>
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
756
|
+
const { CollisionDetectionByRender } = zondy.cesium
|
|
757
|
+
|
|
758
|
+
// ES6引入方式
|
|
759
|
+
import { CollisionDetectionByRender } from "@mapgis/webclient-cesium-plugin"
|
|
760
|
+
|
|
761
|
+
const url = '../../SampleData/models/GroundVehicle/GroundVehicle.glb'
|
|
762
|
+
const position = Cesium.Cartesian3.fromDegrees(108.9594, 34.2186, 5)
|
|
763
|
+
const hpr = new Cesium.HeadingPitchRoll(0, 0, 0)
|
|
764
|
+
const orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr)
|
|
765
|
+
const entity = viewer.entities.add({
|
|
766
|
+
name: url,
|
|
767
|
+
position,
|
|
768
|
+
orientation,
|
|
769
|
+
model: {
|
|
770
|
+
uri: url,
|
|
771
|
+
minimumPixelSize: 32,
|
|
772
|
+
maximumScale: 20000
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
const collisionDetectionForEntity = new CollisionDetectionByRender(viewer, entity, {
|
|
776
|
+
colliderLength: 2,
|
|
777
|
+
colliderWidth: 0.6,
|
|
778
|
+
colliderHeight: 0.6,
|
|
779
|
+
colliderPositionOffset: new Cesium.Cartesian3(0, 0, 0.6)
|
|
780
|
+
})
|
|
781
|
+
const entityResult = collisionDetectionForEntity.checkCollision(positionWC, 0)
|
|
782
|
+
if (entityResult.result !== 'collided') {
|
|
783
|
+
entity.position = entityResult.computedPosition
|
|
784
|
+
}</code></pre>
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
<p class="code-caption"><h7 id='example4'>调试模式</h7></p>
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
<pre class="prettyprint"><code>// ES5引入方式
|
|
792
|
+
const { CollisionDetectionByRender } = zondy.cesium
|
|
793
|
+
|
|
794
|
+
// ES6引入方式
|
|
795
|
+
import { CollisionDetectionByRender } from "@mapgis/webclient-cesium-plugin"
|
|
796
|
+
|
|
797
|
+
const debugCollisionDetection = new CollisionDetectionByRender(viewer, viewer.camera, {
|
|
798
|
+
debugShowCollider: false,
|
|
799
|
+
debugShowDepthMap: true
|
|
800
|
+
})</code></pre>
|
|
634
801
|
|
|
635
802
|
|
|
636
803
|
|
|
@@ -955,7 +1122,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
955
1122
|
|
|
956
1123
|
|
|
957
1124
|
<div class="tag-source">
|
|
958
|
-
engineExtensions/analysis/CollisionDetectionByRender.js, line
|
|
1125
|
+
engineExtensions/analysis/CollisionDetectionByRender.js, line 907
|
|
959
1126
|
</div>
|
|
960
1127
|
|
|
961
1128
|
</div>
|
|
@@ -966,7 +1133,9 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
966
1133
|
|
|
967
1134
|
|
|
968
1135
|
<div class="description">
|
|
969
|
-
<p
|
|
1136
|
+
<p>检测目标位置是否会发生碰撞。</p>
|
|
1137
|
+
<p>调用时应确保场景已完成一帧渲染,通常适合在 <code>postRender</code> 之后或由内部实时检测流程触发。
|
|
1138
|
+
当 <code>heading</code> 为空时,仅执行俯视碰撞检查;传入航向后会同时执行正视方向检查。</p>
|
|
970
1139
|
</div>
|
|
971
1140
|
|
|
972
1141
|
|
|
@@ -1024,7 +1193,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1024
1193
|
|
|
1025
1194
|
|
|
1026
1195
|
|
|
1027
|
-
<p
|
|
1196
|
+
<p>待检测的目标位置。</p></td>
|
|
1028
1197
|
</tr>
|
|
1029
1198
|
|
|
1030
1199
|
|
|
@@ -1059,9 +1228,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1059
1228
|
|
|
1060
1229
|
|
|
1061
1230
|
|
|
1062
|
-
<p
|
|
1063
|
-
<br/><br/>
|
|
1064
|
-
置空时只做俯视图的检查。<br/></p></td>
|
|
1231
|
+
<p>碰撞体航向角,单位为弧度。</p></td>
|
|
1065
1232
|
</tr>
|
|
1066
1233
|
|
|
1067
1234
|
|
|
@@ -1097,7 +1264,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1097
1264
|
|
|
1098
1265
|
|
|
1099
1266
|
|
|
1100
|
-
<p
|
|
1267
|
+
<p>本次检测的覆写参数,未传入时使用实例属性。</p>
|
|
1101
1268
|
|
|
1102
1269
|
|
|
1103
1270
|
<table class="params">
|
|
@@ -1110,8 +1277,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1110
1277
|
<th>Type</th>
|
|
1111
1278
|
|
|
1112
1279
|
|
|
1113
|
-
<th>Default</th>
|
|
1114
|
-
|
|
1115
1280
|
|
|
1116
1281
|
<th class="last">Description</th>
|
|
1117
1282
|
</tr>
|
|
@@ -1135,10 +1300,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1135
1300
|
</td>
|
|
1136
1301
|
|
|
1137
1302
|
|
|
1138
|
-
<td class="default">
|
|
1139
|
-
|
|
1140
|
-
</td>
|
|
1141
|
-
|
|
1142
1303
|
|
|
1143
1304
|
<td class="description last">
|
|
1144
1305
|
|
|
@@ -1149,7 +1310,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1149
1310
|
|
|
1150
1311
|
|
|
1151
1312
|
|
|
1152
|
-
<p
|
|
1313
|
+
<p>碰撞盒长度。</p></td>
|
|
1153
1314
|
</tr>
|
|
1154
1315
|
|
|
1155
1316
|
|
|
@@ -1169,10 +1330,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1169
1330
|
</td>
|
|
1170
1331
|
|
|
1171
1332
|
|
|
1172
|
-
<td class="default">
|
|
1173
|
-
|
|
1174
|
-
</td>
|
|
1175
|
-
|
|
1176
1333
|
|
|
1177
1334
|
<td class="description last">
|
|
1178
1335
|
|
|
@@ -1183,7 +1340,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1183
1340
|
|
|
1184
1341
|
|
|
1185
1342
|
|
|
1186
|
-
<p
|
|
1343
|
+
<p>碰撞盒宽度。</p></td>
|
|
1187
1344
|
</tr>
|
|
1188
1345
|
|
|
1189
1346
|
|
|
@@ -1203,10 +1360,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1203
1360
|
</td>
|
|
1204
1361
|
|
|
1205
1362
|
|
|
1206
|
-
<td class="default">
|
|
1207
|
-
|
|
1208
|
-
</td>
|
|
1209
|
-
|
|
1210
1363
|
|
|
1211
1364
|
<td class="description last">
|
|
1212
1365
|
|
|
@@ -1217,7 +1370,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1217
1370
|
|
|
1218
1371
|
|
|
1219
1372
|
|
|
1220
|
-
<p
|
|
1373
|
+
<p>碰撞盒高度。</p></td>
|
|
1221
1374
|
</tr>
|
|
1222
1375
|
|
|
1223
1376
|
|
|
@@ -1237,11 +1390,35 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1237
1390
|
</td>
|
|
1238
1391
|
|
|
1239
1392
|
|
|
1240
|
-
|
|
1393
|
+
|
|
1394
|
+
<td class="description last">
|
|
1241
1395
|
|
|
1242
|
-
|
|
1396
|
+
|
|
1397
|
+
<span class="optional"> 可选</span>
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
|
|
1243
1402
|
|
|
1244
|
-
|
|
1403
|
+
<p>碰撞盒位置偏移。</p></td>
|
|
1404
|
+
</tr>
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
<tr>
|
|
1409
|
+
|
|
1410
|
+
<td class="name"><code>colliderThickness</code></td>
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
<td class="type">
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
<span class="param-type">Number</span>
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
</td>
|
|
1421
|
+
|
|
1245
1422
|
|
|
1246
1423
|
|
|
1247
1424
|
<td class="description last">
|
|
@@ -1253,7 +1430,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1253
1430
|
|
|
1254
1431
|
|
|
1255
1432
|
|
|
1256
|
-
<p
|
|
1433
|
+
<p>碰撞盒边框检测厚度。</p></td>
|
|
1257
1434
|
</tr>
|
|
1258
1435
|
|
|
1259
1436
|
|
|
@@ -1273,10 +1450,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1273
1450
|
</td>
|
|
1274
1451
|
|
|
1275
1452
|
|
|
1276
|
-
<td class="default">
|
|
1277
|
-
|
|
1278
|
-
</td>
|
|
1279
|
-
|
|
1280
1453
|
|
|
1281
1454
|
<td class="description last">
|
|
1282
1455
|
|
|
@@ -1287,7 +1460,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1287
1460
|
|
|
1288
1461
|
|
|
1289
1462
|
|
|
1290
|
-
<p
|
|
1463
|
+
<p>最大可抬升通过高度。</p></td>
|
|
1291
1464
|
</tr>
|
|
1292
1465
|
|
|
1293
1466
|
|
|
@@ -1307,12 +1480,6 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1307
1480
|
</td>
|
|
1308
1481
|
|
|
1309
1482
|
|
|
1310
|
-
<td class="default">
|
|
1311
|
-
|
|
1312
|
-
false
|
|
1313
|
-
|
|
1314
|
-
</td>
|
|
1315
|
-
|
|
1316
1483
|
|
|
1317
1484
|
<td class="description last">
|
|
1318
1485
|
|
|
@@ -1323,7 +1490,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1323
1490
|
|
|
1324
1491
|
|
|
1325
1492
|
|
|
1326
|
-
<p
|
|
1493
|
+
<p>是否开启高精度模式。</p></td>
|
|
1327
1494
|
</tr>
|
|
1328
1495
|
|
|
1329
1496
|
|
|
@@ -1394,21 +1561,11 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1394
1561
|
|
|
1395
1562
|
|
|
1396
1563
|
</td>
|
|
1397
|
-
<td class="description last"
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
<tr>
|
|
1403
|
-
<td>'collided'</td> <td>targetPosition</td> <td>发生了碰撞,返回传入的位置。</td>
|
|
1404
|
-
</tr>
|
|
1405
|
-
<tr>
|
|
1406
|
-
<td>'noCollision'</td> <td>targetPosition</td> <td>没有发生碰撞,返回传入的位置。</td>
|
|
1407
|
-
</tr>
|
|
1408
|
-
<tr>
|
|
1409
|
-
<td>'passable'</td> <td>碰撞后抬高的位置</td> <td>发生了碰撞但可以通过,计算新的位置。</td>
|
|
1410
|
-
</tr>
|
|
1411
|
-
</table></td>
|
|
1564
|
+
<td class="description last">碰撞检测结果对象。
|
|
1565
|
+
返回值说明:
|
|
1566
|
+
<code>result === 'collided'</code> 时表示发生碰撞,<code>computedPosition</code> 返回传入的 <code>targetPosition</code>。
|
|
1567
|
+
<code>result === 'noCollision'</code> 时表示未碰撞,<code>computedPosition</code> 返回传入的 <code>targetPosition</code>。
|
|
1568
|
+
<code>result === 'passable'</code> 时表示发生碰撞但可抬升通过,<code>computedPosition</code> 返回抬升后的建议位置。</td>
|
|
1412
1569
|
</tr>
|
|
1413
1570
|
|
|
1414
1571
|
</tbody>
|
|
@@ -1430,7 +1587,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1430
1587
|
|
|
1431
1588
|
|
|
1432
1589
|
<div class="tag-source">
|
|
1433
|
-
engineExtensions/analysis/CollisionDetectionByRender.js, line
|
|
1590
|
+
engineExtensions/analysis/CollisionDetectionByRender.js, line 574
|
|
1434
1591
|
</div>
|
|
1435
1592
|
|
|
1436
1593
|
</div>
|
|
@@ -1441,7 +1598,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1441
1598
|
|
|
1442
1599
|
|
|
1443
1600
|
<div class="description">
|
|
1444
|
-
<p
|
|
1601
|
+
<p>销毁碰撞检测实例并释放内部帧缓冲与深度资源。</p>
|
|
1445
1602
|
</div>
|
|
1446
1603
|
|
|
1447
1604
|
|
|
@@ -1504,7 +1661,7 @@ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果
|
|
|
1504
1661
|
|
|
1505
1662
|
|
|
1506
1663
|
<footer>
|
|
1507
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> on
|
|
1664
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> on Sat Sep 12 2026 11:55:59 GMT+0800 (中国标准时间)
|
|
1508
1665
|
</footer>
|
|
1509
1666
|
</div>
|
|
1510
1667
|
</div>
|