@mapgis/webclient-cesium-plugin 17.2.4 → 17.2.6

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.
@@ -0,0 +1,1904 @@
1
+ <header id="page-title" class="page-title">
2
+
3
+ <span class="page-title-main">类名</span>
4
+ <span class="page-title-sub">CollisionDetectionByRender</span>
5
+
6
+ </header>
7
+
8
+
9
+
10
+
11
+
12
+ <section>
13
+
14
+ <article>
15
+ <div class="container-overview">
16
+
17
+
18
+ <div class='vertical-section'>
19
+ <div class="members">
20
+ <div class="member">
21
+
22
+
23
+
24
+
25
+ <h4 class="name" id="CollisionDetectionByRender">
26
+ <a class="href-link" href="#CollisionDetectionByRender">#</a>
27
+
28
+ <span class="code-name" id="CollisionDetectionByRender" style="font-size:30px">
29
+
30
+ new CollisionDetectionByRender<span class="signature">(viewer, collider, options<span class="signature-attributes">opt</span>)</span>
31
+
32
+ </span>
33
+ </h4>
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <h4>参数</h4>
47
+
48
+ <div class="table-container">
49
+ <table class="params table">
50
+ <thead>
51
+ <tr>
52
+
53
+ <th>名称</th>
54
+
55
+
56
+ <th>类型</th>
57
+
58
+
59
+ <th style="min-width: 100px;">默认值</th>
60
+
61
+
62
+ <th class="last">描述</th>
63
+ </tr>
64
+ </thead>
65
+
66
+ <tbody>
67
+
68
+
69
+
70
+ <tr class="deep-level-0">
71
+
72
+ <td class="name"><code>viewer</code></td>
73
+
74
+
75
+ <td class="type">
76
+
77
+
78
+ <span class="param-type">
79
+
80
+ Viewer
81
+
82
+ </span>
83
+
84
+
85
+
86
+
87
+ </td>
88
+
89
+
90
+ <td class="default">
91
+
92
+ </td>
93
+
94
+
95
+ <td class="description last"><p>场景视图</p></td>
96
+ </tr>
97
+
98
+
99
+
100
+
101
+
102
+
103
+ <tr class="deep-level-0">
104
+
105
+ <td class="name"><code>collider</code></td>
106
+
107
+
108
+ <td class="type">
109
+
110
+
111
+ <span class="param-type">
112
+
113
+ Cesium.Camera
114
+
115
+ </span>
116
+ |
117
+
118
+ <span class="param-type">
119
+
120
+ Cesium.MapGISM3D
121
+
122
+ </span>
123
+ |
124
+
125
+ <span class="param-type">
126
+
127
+ Cesium.Entity
128
+
129
+ </span>
130
+
131
+
132
+
133
+
134
+ </td>
135
+
136
+
137
+ <td class="default">
138
+
139
+ </td>
140
+
141
+
142
+ <td class="description last"><p>做碰撞检测的对象</p></td>
143
+ </tr>
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <tr class="deep-level-0">
151
+
152
+ <td class="name"><code>options</code></td>
153
+
154
+
155
+ <td class="type">
156
+
157
+
158
+ <span class="param-type">
159
+
160
+ Object
161
+
162
+ </span>
163
+
164
+
165
+
166
+
167
+ </td>
168
+
169
+
170
+ <td class="default">
171
+
172
+ </td>
173
+
174
+
175
+ <td class="description last"><p>可选参数</p></td>
176
+ </tr>
177
+
178
+
179
+
180
+
181
+ <tr class="deep-level-1">
182
+
183
+ <td class="name"><code>colliderLength</code></td>
184
+
185
+
186
+ <td class="type">
187
+
188
+
189
+ <span class="param-type">
190
+
191
+ Number
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+ </td>
199
+
200
+
201
+ <td class="default">
202
+
203
+ 0.4
204
+
205
+ </td>
206
+
207
+
208
+ <td class="description last"><p>碰撞盒的长(单位米)</p></td>
209
+ </tr>
210
+
211
+
212
+
213
+
214
+ <tr class="deep-level-1">
215
+
216
+ <td class="name"><code>colliderWidth</code></td>
217
+
218
+
219
+ <td class="type">
220
+
221
+
222
+ <span class="param-type">
223
+
224
+ Number
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+ </td>
232
+
233
+
234
+ <td class="default">
235
+
236
+ 0.4
237
+
238
+ </td>
239
+
240
+
241
+ <td class="description last"><p>碰撞盒的宽(单位米)</p></td>
242
+ </tr>
243
+
244
+
245
+
246
+
247
+ <tr class="deep-level-1">
248
+
249
+ <td class="name"><code>colliderHeight</code></td>
250
+
251
+
252
+ <td class="type">
253
+
254
+
255
+ <span class="param-type">
256
+
257
+ Number
258
+
259
+ </span>
260
+
261
+
262
+
263
+
264
+ </td>
265
+
266
+
267
+ <td class="default">
268
+
269
+ 1.7
270
+
271
+ </td>
272
+
273
+
274
+ <td class="description last"><p>碰撞盒的高(单位米)
275
+ <br/><br/>
276
+ 原点高度属性用于通知碰撞检测实例碰撞对象的坐标原点所在的高度,如单体模型的坐标原点有的在其底部,有的在其中间。<br/>
277
+ 默认值设为1.7是因为默认的碰撞对象是相机。</p></td>
278
+ </tr>
279
+
280
+
281
+
282
+
283
+ <tr class="deep-level-1">
284
+
285
+ <td class="name"><code>colliderPositionOffset</code></td>
286
+
287
+
288
+ <td class="type">
289
+
290
+
291
+ <span class="param-type">
292
+
293
+ Cesium.Cartesian3
294
+
295
+ </span>
296
+
297
+
298
+
299
+
300
+ </td>
301
+
302
+
303
+ <td class="default">
304
+
305
+ (0,0,0)
306
+
307
+ </td>
308
+
309
+
310
+ <td class="description last"><p>碰撞盒的位置偏移(单位米)</p></td>
311
+ </tr>
312
+
313
+
314
+
315
+
316
+ <tr class="deep-level-1">
317
+
318
+ <td class="name"><code>maxPassableHeight</code></td>
319
+
320
+
321
+ <td class="type">
322
+
323
+
324
+ <span class="param-type">
325
+
326
+ Number
327
+
328
+ </span>
329
+
330
+
331
+
332
+
333
+ </td>
334
+
335
+
336
+ <td class="default">
337
+
338
+ 0.5
339
+
340
+ </td>
341
+
342
+
343
+ <td class="description last"><p>最大可通过高度(单位米)</p></td>
344
+ </tr>
345
+
346
+
347
+
348
+
349
+ <tr class="deep-level-1">
350
+
351
+ <td class="name"><code>highPrecision</code></td>
352
+
353
+
354
+ <td class="type">
355
+
356
+
357
+ <span class="param-type">
358
+
359
+ Boolean
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+ </td>
367
+
368
+
369
+ <td class="default">
370
+
371
+ false
372
+
373
+ </td>
374
+
375
+
376
+ <td class="description last"><p>是否开启高精度碰撞检测
377
+ <br/><br/>
378
+ 基于性能考虑默认不开启高精度碰撞检测。非高精度状态下只检测碰撞盒的边框所覆盖的区域,高精度状态下对碰撞盒覆盖的整个区域做检测。</p></td>
379
+ </tr>
380
+
381
+
382
+
383
+
384
+ <tr class="deep-level-1">
385
+
386
+ <td class="name"><code>debugShowDepthMap</code></td>
387
+
388
+
389
+ <td class="type">
390
+
391
+
392
+ <span class="param-type">
393
+
394
+ Boolean
395
+
396
+ </span>
397
+
398
+
399
+
400
+
401
+ </td>
402
+
403
+
404
+ <td class="default">
405
+
406
+ false
407
+
408
+ </td>
409
+
410
+
411
+ <td class="description last"><p>检查深度图(debug模式)</p></td>
412
+ </tr>
413
+
414
+
415
+
416
+
417
+ <tr class="deep-level-1">
418
+
419
+ <td class="name"><code>debugShowCollider</code></td>
420
+
421
+
422
+ <td class="type">
423
+
424
+
425
+ <span class="param-type">
426
+
427
+ Boolean
428
+
429
+ </span>
430
+
431
+
432
+
433
+
434
+ </td>
435
+
436
+
437
+ <td class="default">
438
+
439
+ false
440
+
441
+ </td>
442
+
443
+
444
+ <td class="description last"><p>检查碰撞盒(debug模式)
445
+ <br/><br/>
446
+ debug模式生成的碰撞盒所使用的位置是上一帧的碰撞检测结果,所以并不能精确的表示碰撞盒与场景的碰撞关系。<br/>
447
+ 深度图中可查看到较为精确的碰撞关系。<br/>
448
+ 开启碰撞盒检查主要是为了方便调整碰撞盒与模型相匹配。<br/>
449
+ 相机做为碰撞对象时,开启碰撞盒检查,相机会被碰撞盒包在里面。</p></td>
450
+ </tr>
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+ </tbody>
459
+ </table>
460
+ </div>
461
+
462
+
463
+
464
+
465
+
466
+
467
+ <dl class="details">
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+ </dl>
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+
518
+
519
+
520
+
521
+
522
+
523
+ <h5>示例</h5>
524
+
525
+
526
+ <pre class="prettyprint"><code>// 1. 默认使用相机做为碰撞检测对象
527
  camera.setView({
1
528
  destination: result.computedPosition,
2
529
  orientation: {
3
530
  heading: camera.heading,
4
531
  pitch: camera.pitch,
5
532
  roll: 0.0
6
533
  }
7
534
  });
8
535
  maximumScreenSpaceError: 0,
9
536
  autoReset: false,
10
537
  loaded: function(layer) {
11
538
  m3d = layer;
12
539
  collisionDetection = new Cesium.CollisionDetectionByRender(viewer, layer._root, {
13
540
  colliderLength: 0.8, // 设置碰撞盒长
14
541
  colliderWidth: 0.6, // 设置碰撞盒宽
15
542
  colliderHeight: 1, // 设置碰撞盒高
16
543
  colliderPositionOffset: new Cesium.Cesium.Cartesian3(0, 0, 0.5), // 设置碰撞盒偏移
17
544
  debugShowCollider: true, // 打开debug模式,碰撞盒检查
18
545
  debugShowDepthMap: true // 打开debug模式,深度图检查
19
546
  });
20
547
  }
21
548
  // 获取模型变换矩阵
22
549
  let modelMatrix = m3d.tileset.modelMatrix;
23
550
  // 求模型变换矩阵的逆
24
551
  Cesium.Cesium.Matrix4.inverse(modelMatrix, invModelMat);
25
552
  // 未碰撞移动到该位置
26
553
  Cesium.Cesium.Matrix4.setTranslation(transform, result.computedPosition, newTransform);
27
554
  // 乘上模型变换矩阵的逆矩阵
28
555
  Cesium.Cesium.Matrix4.multiply(invModelMat, newTransform, newTransform);
29
556
  // 设置新的变换矩阵
30
557
  m3d.transform = Cesium.Matrix4.clone(newTransform);
31
558
  name: url,
32
559
  position: position,
33
560
  orientation: orientation,
34
561
  model: {
35
562
  uri: url,
36
563
  minimumPixelSize: 32,
37
564
  maximumScale: 20000,
38
565
  },
39
566
  colliderLength: 2,
40
567
  colliderWidth: 0.6,
41
568
  colliderHeight: 0.6,
42
569
  colliderPositionOffset: new Cesium.Cesium.Cartesian3(0, 0, 0.6)
43
570
  entity.position = result.computedPosition;
44
571
  debugShowCollider: false, // 相机做为碰撞检测对象时不打开碰撞盒检查
45
572
  debugShowDepthMap: true, // 打开debug模式,深度图检查
573
+
574
+
575
+
576
+
577
+ </div>
578
+ </div>
579
+ </div>
580
+
581
+
582
+ </div>
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+ <div class='vertical-section'>
598
+ <h3 id='member'>成员变量</h3>
599
+ <h4 style="margin-top: 20px;margin-bottom: 20px;">成员变量概述</h4>
600
+ <div class="table-container">
601
+ <table class="params table">
602
+ <thead>
603
+ <tr>
604
+ <th>名称</th>
605
+ <th>类型</th>
606
+ <th>描述</th>
607
+ </tr>
608
+ </thead>
609
+ <tbody>
610
+
611
+ <tr class="deep-level-0">
612
+ <td class="name"><code><a href="#collider">collider</a></code></td>
613
+ <td class="name">
614
+ <code>
615
+
616
+ <span class="param-type">
617
+
618
+ Cesium.Camera
619
+
620
+ </span>
621
+ |
622
+
623
+ <span class="param-type">
624
+
625
+ Cesium.MapGISM3D
626
+
627
+ </span>
628
+ |
629
+
630
+ <span class="param-type">
631
+
632
+ Cesium.Entity
633
+
634
+ </span>
635
+
636
+
637
+
638
+ </code>
639
+ </td>
640
+ <td class="name"><code><p>碰撞检测对象</p></code></td>
641
+ </tr>
642
+
643
+ <tr class="deep-level-0">
644
+ <td class="name"><code><a href="#colliderHeight">colliderHeight</a></code></td>
645
+ <td class="name">
646
+ <code>
647
+
648
+ <span class="param-type">
649
+
650
+ Number
651
+
652
+ </span>
653
+
654
+
655
+
656
+ </code>
657
+ </td>
658
+ <td class="name"><code><p>碰撞盒高</p></code></td>
659
+ </tr>
660
+
661
+ <tr class="deep-level-0">
662
+ <td class="name"><code><a href="#colliderLength">colliderLength</a></code></td>
663
+ <td class="name">
664
+ <code>
665
+
666
+ <span class="param-type">
667
+
668
+ Number
669
+
670
+ </span>
671
+
672
+
673
+
674
+ </code>
675
+ </td>
676
+ <td class="name"><code><p>碰撞盒长</p></code></td>
677
+ </tr>
678
+
679
+ <tr class="deep-level-0">
680
+ <td class="name"><code><a href="#colliderPositionOffset">colliderPositionOffset</a></code></td>
681
+ <td class="name">
682
+ <code>
683
+
684
+ <span class="param-type">
685
+
686
+ Cesium.Cartesian3
687
+
688
+ </span>
689
+
690
+
691
+
692
+ </code>
693
+ </td>
694
+ <td class="name"><code><p>碰撞盒位置偏移</p></code></td>
695
+ </tr>
696
+
697
+ <tr class="deep-level-0">
698
+ <td class="name"><code><a href="#colliderWidth">colliderWidth</a></code></td>
699
+ <td class="name">
700
+ <code>
701
+
702
+ <span class="param-type">
703
+
704
+ Number
705
+
706
+ </span>
707
+
708
+
709
+
710
+ </code>
711
+ </td>
712
+ <td class="name"><code><p>碰撞盒宽</p></code></td>
713
+ </tr>
714
+
715
+ <tr class="deep-level-0">
716
+ <td class="name"><code><a href="#highPrecision">highPrecision</a></code></td>
717
+ <td class="name">
718
+ <code>
719
+
720
+ <span class="param-type">
721
+
722
+ Boolean
723
+
724
+ </span>
725
+
726
+
727
+
728
+ </code>
729
+ </td>
730
+ <td class="name"><code><p>是否开启高精度模式
731
+ <br/></p>
732
+ <table>
733
+ <tr>
734
+ <td>
735
+ <img src="Images/defaultPrecision.jpg" alt="defaultPrecision" />
736
+ <br />
737
+ 默认模式下只检测碰撞盒的边框部分
738
+ </td>
739
+ <td>
740
+ <img src="Images/highPrecision.jpg" alt="highPrecision" />
741
+ <br />
742
+ 高精度模式下对整个碰撞盒做检测
743
+ </td>
744
+ </tr>
745
+ </table></code></td>
746
+ </tr>
747
+
748
+ <tr class="deep-level-0">
749
+ <td class="name"><code><a href="#maxPassableHeight">maxPassableHeight</a></code></td>
750
+ <td class="name">
751
+ <code>
752
+
753
+ <span class="param-type">
754
+
755
+ Number
756
+
757
+ </span>
758
+
759
+
760
+
761
+ </code>
762
+ </td>
763
+ <td class="name"><code><p>最大可通过高度</p></code></td>
764
+ </tr>
765
+
766
+ </tbody>
767
+ </table>
768
+ </div>
769
+ <h4 style="margin-top: 20px;margin-bottom: 20px;">成员变量详情</h4>
770
+ <div class="members">
771
+
772
+ <div class="member">
773
+
774
+ <span class="method-parameter is-pulled-right">
775
+ <label>类型:</label>
776
+
777
+ <span class="param-type">
778
+
779
+ Cesium.Camera
780
+
781
+ </span>
782
+ |
783
+
784
+ <span class="param-type">
785
+
786
+ Cesium.MapGISM3D
787
+
788
+ </span>
789
+ |
790
+
791
+ <span class="param-type">
792
+
793
+ Cesium.Entity
794
+
795
+ </span>
796
+
797
+
798
+
799
+ </span>
800
+
801
+ <h4 class="name" id="collider">
802
+ <a class="href-link" href="#collider">#</a>
803
+
804
+
805
+ <span class='tag'>readonly</span>
806
+
807
+
808
+ <span class="code-name">
809
+ collider
810
+ </span>
811
+
812
+ </h4>
813
+
814
+
815
+
816
+
817
+ <div class="description">
818
+ <p>碰撞检测对象</p>
819
+ </div>
820
+
821
+
822
+
823
+
824
+
825
+ <dl class="details">
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+
856
+
857
+ </dl>
858
+
859
+
860
+
861
+
862
+
863
+ </div>
864
+
865
+ <div class="member">
866
+
867
+ <span class="method-parameter is-pulled-right">
868
+ <label>类型:</label>
869
+
870
+ <span class="param-type">
871
+
872
+ Number
873
+
874
+ </span>
875
+
876
+
877
+
878
+ </span>
879
+
880
+ <h4 class="name" id="colliderHeight">
881
+ <a class="href-link" href="#colliderHeight">#</a>
882
+
883
+ <span class="code-name">
884
+ colliderHeight
885
+ </span>
886
+
887
+ </h4>
888
+
889
+
890
+
891
+
892
+ <div class="description">
893
+ <p>碰撞盒高</p>
894
+ </div>
895
+
896
+
897
+
898
+
899
+
900
+ <dl class="details">
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
+ </dl>
933
+
934
+
935
+
936
+
937
+
938
+ </div>
939
+
940
+ <div class="member">
941
+
942
+ <span class="method-parameter is-pulled-right">
943
+ <label>类型:</label>
944
+
945
+ <span class="param-type">
946
+
947
+ Number
948
+
949
+ </span>
950
+
951
+
952
+
953
+ </span>
954
+
955
+ <h4 class="name" id="colliderLength">
956
+ <a class="href-link" href="#colliderLength">#</a>
957
+
958
+ <span class="code-name">
959
+ colliderLength
960
+ </span>
961
+
962
+ </h4>
963
+
964
+
965
+
966
+
967
+ <div class="description">
968
+ <p>碰撞盒长</p>
969
+ </div>
970
+
971
+
972
+
973
+
974
+
975
+ <dl class="details">
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+ </dl>
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+ </div>
1014
+
1015
+ <div class="member">
1016
+
1017
+ <span class="method-parameter is-pulled-right">
1018
+ <label>类型:</label>
1019
+
1020
+ <span class="param-type">
1021
+
1022
+ Cesium.Cartesian3
1023
+
1024
+ </span>
1025
+
1026
+
1027
+
1028
+ </span>
1029
+
1030
+ <h4 class="name" id="colliderPositionOffset">
1031
+ <a class="href-link" href="#colliderPositionOffset">#</a>
1032
+
1033
+ <span class="code-name">
1034
+ colliderPositionOffset
1035
+ </span>
1036
+
1037
+ </h4>
1038
+
1039
+
1040
+
1041
+
1042
+ <div class="description">
1043
+ <p>碰撞盒位置偏移</p>
1044
+ </div>
1045
+
1046
+
1047
+
1048
+
1049
+
1050
+ <dl class="details">
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+
1059
+
1060
+
1061
+
1062
+
1063
+
1064
+
1065
+
1066
+
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+ </dl>
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+ </div>
1089
+
1090
+ <div class="member">
1091
+
1092
+ <span class="method-parameter is-pulled-right">
1093
+ <label>类型:</label>
1094
+
1095
+ <span class="param-type">
1096
+
1097
+ Number
1098
+
1099
+ </span>
1100
+
1101
+
1102
+
1103
+ </span>
1104
+
1105
+ <h4 class="name" id="colliderWidth">
1106
+ <a class="href-link" href="#colliderWidth">#</a>
1107
+
1108
+ <span class="code-name">
1109
+ colliderWidth
1110
+ </span>
1111
+
1112
+ </h4>
1113
+
1114
+
1115
+
1116
+
1117
+ <div class="description">
1118
+ <p>碰撞盒宽</p>
1119
+ </div>
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+ <dl class="details">
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+ </dl>
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+ </div>
1164
+
1165
+ <div class="member">
1166
+
1167
+ <span class="method-parameter is-pulled-right">
1168
+ <label>类型:</label>
1169
+
1170
+ <span class="param-type">
1171
+
1172
+ Boolean
1173
+
1174
+ </span>
1175
+
1176
+
1177
+
1178
+ </span>
1179
+
1180
+ <h4 class="name" id="highPrecision">
1181
+ <a class="href-link" href="#highPrecision">#</a>
1182
+
1183
+ <span class="code-name">
1184
+ highPrecision
1185
+ </span>
1186
+
1187
+ </h4>
1188
+
1189
+
1190
+
1191
+
1192
+ <div class="description">
1193
+ <p>是否开启高精度模式
1194
+ <br/></p>
1195
+ <table>
1196
+ <tr>
1197
+ <td>
1198
+ <img src="Images/defaultPrecision.jpg" alt="defaultPrecision" />
1199
+ <br />
1200
+ 默认模式下只检测碰撞盒的边框部分
1201
+ </td>
1202
+ <td>
1203
+ <img src="Images/highPrecision.jpg" alt="highPrecision" />
1204
+ <br />
1205
+ 高精度模式下对整个碰撞盒做检测
1206
+ </td>
1207
+ </tr>
1208
+ </table>
1209
+ </div>
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+ <dl class="details">
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+
1231
+
1232
+
1233
+
1234
+
1235
+
1236
+
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+ </dl>
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+ </div>
1254
+
1255
+ <div class="member">
1256
+
1257
+ <span class="method-parameter is-pulled-right">
1258
+ <label>类型:</label>
1259
+
1260
+ <span class="param-type">
1261
+
1262
+ Number
1263
+
1264
+ </span>
1265
+
1266
+
1267
+
1268
+ </span>
1269
+
1270
+ <h4 class="name" id="maxPassableHeight">
1271
+ <a class="href-link" href="#maxPassableHeight">#</a>
1272
+
1273
+ <span class="code-name">
1274
+ maxPassableHeight
1275
+ </span>
1276
+
1277
+ </h4>
1278
+
1279
+
1280
+
1281
+
1282
+ <div class="description">
1283
+ <p>最大可通过高度</p>
1284
+ </div>
1285
+
1286
+
1287
+
1288
+
1289
+
1290
+ <dl class="details">
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+
1314
+
1315
+
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+ </dl>
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+ </div>
1329
+
1330
+ </div>
1331
+ </div>
1332
+
1333
+
1334
+
1335
+ <div class='vertical-section'>
1336
+ <h3 id='function'>方法</h3>
1337
+ <h4 style="margin-top: 20px;margin-bottom: 20px;">方法概述</h4>
1338
+ <div class="members">
1339
+ <div class="table-container">
1340
+ <table class="params table">
1341
+ <thead>
1342
+ <tr>
1343
+ <th>名称</th>
1344
+ <th>返回值类型</th>
1345
+ <th>描述</th>
1346
+ </tr>
1347
+ </thead>
1348
+ <tbody>
1349
+
1350
+ <tr class="deep-level-0">
1351
+ <td class="name"><code><a href="#checkCollision">checkCollision</a></code></td>
1352
+ <td class="name">
1353
+ <code>
1354
+
1355
+
1356
+ <span class="param-type">
1357
+
1358
+ Object
1359
+
1360
+ </span>
1361
+
1362
+
1363
+
1364
+
1365
+ </code>
1366
+ </td>
1367
+ <td class="name"><code><p>检测目标位置是否会碰撞,需要在场景渲染完成后即postRender事件中做检查。</p></code></td>
1368
+ </tr>
1369
+
1370
+ <tr class="deep-level-0">
1371
+ <td class="name"><code><a href="#destory">destory</a></code></td>
1372
+ <td class="name">
1373
+ <code>
1374
+
1375
+ </code>
1376
+ </td>
1377
+ <td class="name"><code><p>销毁碰撞检测</p></code></td>
1378
+ </tr>
1379
+
1380
+ </tbody>
1381
+ </table>
1382
+ </div>
1383
+ <h4 style="margin-top: 20px;margin-bottom: 20px;">方法详情</h4>
1384
+
1385
+ <div class="member">
1386
+
1387
+
1388
+
1389
+ <h4 class="name" id="checkCollision">
1390
+ <a class="href-link" href="#checkCollision">#</a>
1391
+
1392
+ <span class="code-name" id="checkCollision" style="font-size:30px">
1393
+
1394
+ checkCollision<span class="signature">(targetPosition, heading, options<span class="signature-attributes">opt</span>)</span>
1395
+
1396
+ </span>
1397
+ </h4>
1398
+
1399
+
1400
+
1401
+ <div class="description">
1402
+ <p>检测目标位置是否会碰撞,需要在场景渲染完成后即postRender事件中做检查。</p>
1403
+ </div>
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+ <h4>参数</h4>
1415
+
1416
+ <div class="table-container">
1417
+ <table class="params table">
1418
+ <thead>
1419
+ <tr>
1420
+
1421
+ <th>名称</th>
1422
+
1423
+
1424
+ <th>类型</th>
1425
+
1426
+
1427
+ <th style="min-width: 100px;">默认值</th>
1428
+
1429
+
1430
+ <th class="last">描述</th>
1431
+ </tr>
1432
+ </thead>
1433
+
1434
+ <tbody>
1435
+
1436
+
1437
+
1438
+ <tr class="deep-level-0">
1439
+
1440
+ <td class="name"><code>targetPosition</code></td>
1441
+
1442
+
1443
+ <td class="type">
1444
+
1445
+
1446
+ <span class="param-type">
1447
+
1448
+ Cesium.Cartesian3
1449
+
1450
+ </span>
1451
+
1452
+
1453
+
1454
+
1455
+ </td>
1456
+
1457
+
1458
+ <td class="default">
1459
+
1460
+ </td>
1461
+
1462
+
1463
+ <td class="description last"><p>目标位置</p></td>
1464
+ </tr>
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+ <tr class="deep-level-0">
1472
+
1473
+ <td class="name"><code>heading</code></td>
1474
+
1475
+
1476
+ <td class="type">
1477
+
1478
+
1479
+ <span class="param-type">
1480
+
1481
+ Number
1482
+
1483
+ </span>
1484
+ |
1485
+
1486
+ <span class="param-type">
1487
+
1488
+ undefined
1489
+
1490
+ </span>
1491
+
1492
+
1493
+
1494
+
1495
+ </td>
1496
+
1497
+
1498
+ <td class="default">
1499
+
1500
+ </td>
1501
+
1502
+
1503
+ <td class="description last"><p>碰撞体航向
1504
+ <br/><br/>
1505
+ 置空时只做俯视图的检查。<br/></p></td>
1506
+ </tr>
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+ <tr class="deep-level-0">
1514
+
1515
+ <td class="name"><code>options</code></td>
1516
+
1517
+
1518
+ <td class="type">
1519
+
1520
+
1521
+ <span class="param-type">
1522
+
1523
+ Object
1524
+
1525
+ </span>
1526
+
1527
+
1528
+
1529
+
1530
+ </td>
1531
+
1532
+
1533
+ <td class="default">
1534
+
1535
+ {}
1536
+
1537
+ </td>
1538
+
1539
+
1540
+ <td class="description last"><p>可选参数</p></td>
1541
+ </tr>
1542
+
1543
+
1544
+
1545
+
1546
+ <tr class="deep-level-1">
1547
+
1548
+ <td class="name"><code>colliderLength</code></td>
1549
+
1550
+
1551
+ <td class="type">
1552
+
1553
+
1554
+ <span class="param-type">
1555
+
1556
+ Number
1557
+
1558
+ </span>
1559
+
1560
+
1561
+
1562
+
1563
+ </td>
1564
+
1565
+
1566
+ <td class="default">
1567
+
1568
+ </td>
1569
+
1570
+
1571
+ <td class="description last"><p>碰撞盒长,默认值取实例的同名属性值</p></td>
1572
+ </tr>
1573
+
1574
+
1575
+
1576
+
1577
+ <tr class="deep-level-1">
1578
+
1579
+ <td class="name"><code>colliderWidth</code></td>
1580
+
1581
+
1582
+ <td class="type">
1583
+
1584
+
1585
+ <span class="param-type">
1586
+
1587
+ Number
1588
+
1589
+ </span>
1590
+
1591
+
1592
+
1593
+
1594
+ </td>
1595
+
1596
+
1597
+ <td class="default">
1598
+
1599
+ </td>
1600
+
1601
+
1602
+ <td class="description last"><p>碰撞盒宽,默认值取实例的同名属性值</p></td>
1603
+ </tr>
1604
+
1605
+
1606
+
1607
+
1608
+ <tr class="deep-level-1">
1609
+
1610
+ <td class="name"><code>colliderHeight</code></td>
1611
+
1612
+
1613
+ <td class="type">
1614
+
1615
+
1616
+ <span class="param-type">
1617
+
1618
+ Number
1619
+
1620
+ </span>
1621
+
1622
+
1623
+
1624
+
1625
+ </td>
1626
+
1627
+
1628
+ <td class="default">
1629
+
1630
+ </td>
1631
+
1632
+
1633
+ <td class="description last"><p>碰撞盒高,默认值取实例的同名属性值</p></td>
1634
+ </tr>
1635
+
1636
+
1637
+
1638
+
1639
+ <tr class="deep-level-1">
1640
+
1641
+ <td class="name"><code>colliderPositionOffset</code></td>
1642
+
1643
+
1644
+ <td class="type">
1645
+
1646
+
1647
+ <span class="param-type">
1648
+
1649
+ Cesium.Cartesian3
1650
+
1651
+ </span>
1652
+
1653
+
1654
+
1655
+
1656
+ </td>
1657
+
1658
+
1659
+ <td class="default">
1660
+
1661
+ (0,0,0)
1662
+
1663
+ </td>
1664
+
1665
+
1666
+ <td class="description last"><p>碰撞盒的位置偏移,默认值取实例的同名属性值</p></td>
1667
+ </tr>
1668
+
1669
+
1670
+
1671
+
1672
+ <tr class="deep-level-1">
1673
+
1674
+ <td class="name"><code>maxPassableHeight</code></td>
1675
+
1676
+
1677
+ <td class="type">
1678
+
1679
+
1680
+ <span class="param-type">
1681
+
1682
+ Number
1683
+
1684
+ </span>
1685
+
1686
+
1687
+
1688
+
1689
+ </td>
1690
+
1691
+
1692
+ <td class="default">
1693
+
1694
+ </td>
1695
+
1696
+
1697
+ <td class="description last"><p>最大可通过高度,默认值取实例的同名属性值</p></td>
1698
+ </tr>
1699
+
1700
+
1701
+
1702
+
1703
+ <tr class="deep-level-1">
1704
+
1705
+ <td class="name"><code>highPrecision</code></td>
1706
+
1707
+
1708
+ <td class="type">
1709
+
1710
+
1711
+ <span class="param-type">
1712
+
1713
+ Boolean
1714
+
1715
+ </span>
1716
+
1717
+
1718
+
1719
+
1720
+ </td>
1721
+
1722
+
1723
+ <td class="default">
1724
+
1725
+ false
1726
+
1727
+ </td>
1728
+
1729
+
1730
+ <td class="description last"><p>是否开启高精度碰撞检测,默认值取实例的同名属性值</p></td>
1731
+ </tr>
1732
+
1733
+
1734
+
1735
+
1736
+
1737
+
1738
+
1739
+ </tbody>
1740
+ </table>
1741
+ </div>
1742
+
1743
+
1744
+
1745
+
1746
+
1747
+
1748
+ <dl class="details">
1749
+
1750
+
1751
+
1752
+
1753
+
1754
+
1755
+
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1763
+
1764
+
1765
+
1766
+
1767
+
1768
+
1769
+
1770
+
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+
1778
+
1779
+
1780
+ </dl>
1781
+
1782
+
1783
+
1784
+
1785
+
1786
+
1787
+
1788
+
1789
+
1790
+
1791
+
1792
+
1793
+
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+ <div class='columns method-parameter'>
1800
+ <div class="column is-2"><label>返回值</label></div>
1801
+ <div class="column is-10">
1802
+
1803
+
1804
+
1805
+ <div class="columns">
1806
+
1807
+ <div class='param-desc column is-7'><p>碰撞检测结果数据结构说明:</p>
1808
+ <table>
1809
+ <tr>
1810
+ <td>result</td> <td>computedPosition</td> <td></td>
1811
+ </tr>
1812
+ <tr>
1813
+ <td>'collided'</td> <td>targetPosition</td> <td>发生了碰撞,返回传入的位置。</td>
1814
+ </tr>
1815
+ <tr>
1816
+ <td>'noCollision'</td> <td>targetPosition</td> <td>没有发生碰撞,返回传入的位置。</td>
1817
+ </tr>
1818
+ <tr>
1819
+ <td>'passable'</td> <td>碰撞后抬高的位置</td> <td>发生了碰撞但可以通过,计算新的位置。</td>
1820
+ </tr>
1821
+ </table></div>
1822
+
1823
+
1824
+ <div class='column is-5 has-text-left'>
1825
+ <label>类型: </label>
1826
+
1827
+ <span class="param-type">
1828
+
1829
+ Object
1830
+
1831
+ </span>
1832
+
1833
+
1834
+
1835
+ </div>
1836
+
1837
+ </div>
1838
+
1839
+
1840
+ </div>
1841
+ </div>
1842
+
1843
+
1844
+
1845
+
1846
+
1847
+
1848
+ </div>
1849
+
1850
+ <div class="member">
1851
+
1852
+
1853
+
1854
+ <h4 class="name" id="destory">
1855
+ <a class="href-link" href="#destory">#</a>
1856
+
1857
+ <span class="code-name" id="destory" style="font-size:30px">
1858
+
1859
+ destory<span class="signature">()</span>
1860
+
1861
+ </span>
1862
+ </h4>
1863
+
1864
+
1865
+
1866
+ <div class="description">
1867
+ <p>销毁碰撞检测</p>
1868
+ </div>
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+
1876
+
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+ <dl class="details">
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+
1891
+
1892
+
1893
+
1894
+
1895
+
1896
+
1897
+
1898
+
1899
+
1900
+
1901
+
1902
+
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+
1909
+
1910
+
1911
+
1912
+
1913
+
1914
+
1915
+ </dl>
1916
+
1917
+
1918
+
1919
+
1920
+
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+
1927
+
1928
+
1929
+
1930
+
1931
+
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+ </div>
1940
+
1941
+ </div>
1942
+ </div>
1943
+
1944
+
1945
+
1946
+
1947
+
1948
+ </article>
1949
+
1950
+ </section>