File: CastleBoxes.TBox3D.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (938 lines) | stat: -rw-r--r-- 56,588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
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
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
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
933
934
935
936
937
938
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleBoxes: Object TBox3D</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="TBox3D"></a><h1 class="cio">Object TBox3D</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td><a class="section" href="#PasDoc-Fields">Fields</a></td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td>Properties</td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a  href="CastleBoxes.html">CastleBoxes</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TBox3D = object(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Axis-aligned box. Rectangular prism with all sides parallel to basic planes X = 0, Y = 0 and Z = 0. This is sometimes called AABB, &quot;axis-aligned bounding box&quot;. Many geometric operations are fast and easy on this type.

<p>The actual box dimensions are stored inside the <a class="normal" href="CastleBoxes.TBox3D.html#Data">Data</a> field, as two 3D points. First point has always all the smaller coords, second point has all the larger coords. I.e. always

<p></p>

<pre class="preformatted">
  Data[0, 0] &lt;= Data[1, 0] and
  Data[0, 1] &lt;= Data[1, 1] and
  Data[0, 2] &lt;= Data[1, 2]
</pre>

<p> The only exception is the special value <a class="normal" href="CastleBoxes.html#EmptyBox3D">EmptyBox3D</a>.

<p>Note that the box may still have all sizes equal 0. Consider a 3D model with only a single 3D point &mdash; it's not empty, but all the sizes must be 0.

<p>This is an old-style object (withut any virtual methods). This way there's no need for using constructors / destructors to manage this, you can simply declare <code>TBox3D</code> type and copy / pass around this box to other procedures.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">TBox3D</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Fields"></a><h3 class="summary">Fields</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code><b><a  href="CastleBoxes.TBox3D.html#Data">Data</a></b>: array [0..1   ] of <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
</table>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#IsEmpty">IsEmpty</a></b>: boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#IsEmptyOrZero">IsEmptyOrZero</a></b>: boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#CheckNonEmpty">CheckNonEmpty</a></b>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Middle">Middle</a></b>: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#AverageSize">AverageSize</a></b>: Single; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#MaxSize">MaxSize</a></b>: Single; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#MinSize">MinSize</a></b>: Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SizeX">SizeX</a></b>: Single;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SizeY">SizeY</a></b>: Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SizeZ">SizeZ</a></b>: Single;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#AverageSize">AverageSize</a></b>(const AllowZero: boolean; const EmptyBoxSize: Single): Single; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#MaxSize">MaxSize</a></b>(const AllowZero: boolean; const EmptyBoxSize: Single): Single; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Area">Area</a></b>(const AllowZero: boolean; const EmptyBoxArea: Single): Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#ExpandMe">ExpandMe</a></b>(const AExpand: Single); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#ExpandMe">ExpandMe</a></b>(const AExpand: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Expand">Expand</a></b>(const AExpand: Single): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Expand">Expand</a></b>(const AExpand: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PointInside">PointInside</a></b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PointInside">PointInside</a></b>(const Point: <a  href="CastleVectors.html#TVector3Double">TVector3Double</a>): boolean; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PointInside2D">PointInside2D</a></b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IgnoreIndex: Integer): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#Add">Add</a></b>(const box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#Add">Add</a></b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Sizes">Sizes</a></b>: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#GetAllPoints">GetAllPoints</a></b>(allpoints: <a  href="CastleVectors.html#PVector3Single">PVector3Single</a>);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Transform">Transform</a></b>(const Matrix: <a  href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Translate">Translate</a></b>(const Translation: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#AntiTranslate">AntiTranslate</a></b>(const Translation: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#ToNiceStr">ToNiceStr</a></b>: string;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#ToRawStr">ToRawStr</a></b>: string;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#Clamp">Clamp</a></b>(var point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#Clamp">Clamp</a></b>(var point: <a  href="CastleVectors.html#TVector3Double">TVector3Double</a>); overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#TryRayClosestIntersection">TryRayClosestIntersection</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#TryRayClosestIntersection">TryRayClosestIntersection</a></b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#TryRayClosestIntersection">TryRayClosestIntersection</a></b>( out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#TryRayEntrance">TryRayEntrance</a></b>( out Entrance: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out EntranceDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#TryRayEntrance">TryRayEntrance</a></b>( out Entrance: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SegmentCollision">SegmentCollision</a></b>( const Segment1, Segment2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PlaneCollision">PlaneCollision</a></b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): <a  href="CastleBoxes.html#TPlaneCollision">TPlaneCollision</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PlaneCollisionInside">PlaneCollisionInside</a></b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PlaneCollisionOutside">PlaneCollisionOutside</a></b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#IsTriangleCollision">IsTriangleCollision</a></b>( const Triangle: <a  href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#BoundingSphere">BoundingSphere</a></b>( var SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; var SphereRadiusSqr: Single);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Collision">Collision</a></b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Radius">Radius</a></b>: Single;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Radius2D">Radius2D</a></b>(const IgnoreIndex: Integer): Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SphereSimpleCollision">SphereSimpleCollision</a></b>( const SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const SphereRadius: Single): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#SphereCollision">SphereCollision</a></b>( const SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const SphereRadius: Single): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#MaximumPlane">MaximumPlane</a></b>(const Direction: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#MinimumPlane">MinimumPlane</a></b>(const Direction: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#PointDistances">PointDistances</a></b>(const P: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out MinDistance, MaxDistance: Single);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleBoxes.TBox3D.html#DirectionDistances">DirectionDistances</a></b>( const Point, Dir: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out MinDistance, MaxDistance: Single);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PointDistance">PointDistance</a></b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): Single;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#PointMaxDistance">PointMaxDistance</a></b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const EmptyBoxDistance: Single): Single;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Equal">Equal</a></b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>): boolean;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Equal">Equal</a></b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const EqualityEpsilon: Single): boolean;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleBoxes.TBox3D.html#Diagonal">Diagonal</a></b>: Single;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Fields</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Data"></a><code><b>Data</b>: array [0..1   ] of <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsEmpty"></a><code>function <b>IsEmpty</b>: boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is box empty. You can think of this function as &quot;compare Box with <a class="normal" href="CastleBoxes.html#EmptyBox3D">EmptyBox3D</a>&quot;.

<p>But actually it works a little faster, by utilizing the assumption that <a class="normal" href="CastleBoxes.html#EmptyBox3D">EmptyBox3D</a> is the only allowed value that breaks <code>Data[0, 0] &lt;= Data[1, 0]</code> rule.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsEmptyOrZero"></a><code>function <b>IsEmptyOrZero</b>: boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is box empty or has all the sizes equal 0.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="CheckNonEmpty"></a><code>procedure <b>CheckNonEmpty</b>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Middle"></a><code>function <b>Middle</b>: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
These functions calculate the middle point, average size, max size and particular sizes of given bounding box.

<p>

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>If the Box is empty.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="AverageSize"></a><code>function <b>AverageSize</b>: Single; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MaxSize"></a><code>function <b>MaxSize</b>: Single; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MinSize"></a><code>function <b>MinSize</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SizeX"></a><code>function <b>SizeX</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SizeY"></a><code>function <b>SizeY</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SizeZ"></a><code>function <b>SizeZ</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="AverageSize"></a><code>function <b>AverageSize</b>(const AllowZero: boolean; const EmptyBoxSize: Single): Single; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Average size of <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a>, or EmptyBoxSize if box is empty. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AllowZero</dt>
<dd>Decides what to do when box is not empty but the result would be zero, which means that the box is infinitely thin in all axes. If <code>True</code>, then result is just 0, otherwise it's EmptyBoxSize.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MaxSize"></a><code>function <b>MaxSize</b>(const AllowZero: boolean; const EmptyBoxSize: Single): Single; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Largest size of <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a>, or EmptyBoxSize if box is empty. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AllowZero</dt>
<dd>Decides what to do when box is not empty but the result would be zero, which means that the box is infinitely thin in all axes. If <code>True</code>, then result is just 0, otherwise it's EmptyBoxSize.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Area"></a><code>function <b>Area</b>(const AllowZero: boolean; const EmptyBoxArea: Single): Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Area of the six <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a> sides, EmptyBoxArea if box is empty. </p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>AllowZero</dt>
<dd>Decides what to do when box is not empty but the result would be zero, which means that the box is infinitely thin in all axes. If <code>True</code>, then result is just 0, otherwise it's EmptyBoxSize.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ExpandMe"></a><code>procedure <b>ExpandMe</b>(const AExpand: Single); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
This decreases Data[0, 0], Data[0, 1], Data[0, 2] by AExpand and increases Data[1, 0], Data[1, 1], Data[1, 2] by AExpand. So you get Box with all sizes increased by 2 * AExpand.

<p>Box must not be empty. Note that AExpand may be negative, but then you must be sure that it doesn't make Box empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ExpandMe"></a><code>procedure <b>ExpandMe</b>(const AExpand: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
This decreases Data[0] by AExpand, and increases Data[1] by AExpand. So you get Box with all sizes increased by 2 * AExpand.

<p>Box must not be empty. Note that AExpand may be negative, but then you must be sure that it doesn't make Box empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Expand"></a><code>function <b>Expand</b>(const AExpand: Single): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Expand"></a><code>function <b>Expand</b>(const AExpand: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointInside"></a><code>function <b>PointInside</b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is the point inside the box. Always false if Box is empty (obviously, no point is inside an empty box).

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointInside"></a><code>function <b>PointInside</b>(const Point: <a  href="CastleVectors.html#TVector3Double">TVector3Double</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointInside2D"></a><code>function <b>PointInside2D</b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const IgnoreIndex: Integer): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Is the 2D point inside the 2D projection of the box. 2D projection (of point and box) is obtained by rejecting the IgnoreIndex coordinate (must be 0, 1 or 2).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Add"></a><code>procedure <b>Add</b>(const box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Sum two <a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a> values. This calculates the smallest box that encloses both Box1 and Box2. You can also use + operator.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Add"></a><code>procedure <b>Add</b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Make box larger, if necessary, to contain given Point.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Sizes"></a><code>function <b>Sizes</b>: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Three box sizes.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GetAllPoints"></a><code>procedure <b>GetAllPoints</b>(allpoints: <a  href="CastleVectors.html#PVector3Single">PVector3Single</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Calculate eight corners of the box. Place them in AllPoints&circ;[0..7].</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Transform"></a><code>function <b>Transform</b>(const Matrix: <a  href="CastleVectors.html#TMatrix4Single">TMatrix4Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Transform the Box by given matrix. Since this is still an axis-aligned box, rotating etc. of the box usually makes larger box.

<p>Note that this is very optimized for Matrix with no projection (where last row of the last matrix = [0, 0, 0, 1]). It still works for all matrices (eventually fallbacks to simple &quot;transform 8 corners and get box enclosing them&quot; method).

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleVectors.ETransformedResultInvalid.html">ETransformedResultInvalid</a></dt>
<dd>When the Matrix will transform some point to a direction (vector with 4th component equal zero). In this case we just cannot interpret the result as a 3D point, so we also cannot interpret the final result as a box.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Translate"></a><code>function <b>Translate</b>(const Translation: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Move Box. Does nothing if Box is empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="AntiTranslate"></a><code>function <b>AntiTranslate</b>(const Translation: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleBoxes.TBox3D.html">TBox3D</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Move Box, by -Translation. Does nothing if Box is empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ToNiceStr"></a><code>function <b>ToNiceStr</b>: string;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="ToRawStr"></a><code>function <b>ToRawStr</b>: string;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Clamp"></a><code>procedure <b>Clamp</b>(var point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Clamp"></a><code>procedure <b>Clamp</b>(var point: <a  href="CastleVectors.html#TVector3Double">TVector3Double</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TryRayClosestIntersection"></a><code>function <b>TryRayClosestIntersection</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
TryBoxRayClosestIntersection calculates intersection between the ray (returns closest intersection to RayOrigin) and the box.

<p>The box is treated just like a set of 6 rectangles in 3D. This means that the intersection will always be placed on one of the box sides, even if RayOrigin starts inside the box. See TryBoxRayEntrance for the other version.

<p>Returns also IntersectionDistance, which is the distance to the Intersection relative to RayDirection (i.e. Intersection is always = RayOrigin + IntersectionDistance * RayDirection).

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TryRayClosestIntersection"></a><code>function <b>TryRayClosestIntersection</b>( out Intersection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TryRayClosestIntersection"></a><code>function <b>TryRayClosestIntersection</b>( out IntersectionDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TryRayEntrance"></a><code>function <b>TryRayEntrance</b>( out Entrance: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out EntranceDistance: Single; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Intersection between the ray (returns closest intersection to RayOrigin) and the box, treating the box as a filled volume.

<p>If RayOrigin is inside the box, TryBoxRayEntrance simply returns RayOrigin. If RayOrigin is outside of the box, the answer is the same as with TryBoxRayClosestIntersection.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TryRayEntrance"></a><code>function <b>TryRayEntrance</b>( out Entrance: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const RayOrigin, RayDirection: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean; overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SegmentCollision"></a><code>function <b>SegmentCollision</b>( const Segment1, Segment2: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PlaneCollision"></a><code>function <b>PlaneCollision</b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): <a  href="CastleBoxes.html#TPlaneCollision">TPlaneCollision</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Collision between axis-aligned box (<a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a>) and 3D plane. Returns detailed result as <a class="normal" href="CastleBoxes.html#TPlaneCollision">TPlaneCollision</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PlaneCollisionInside"></a><code>function <b>PlaneCollisionInside</b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check is axis-aligned box (<a class="normal" href="CastleBoxes.TBox3D.html">TBox3D</a>) fully inside/outside the plane.

<p>Inside/outside are defined as for <a class="normal" href="CastleBoxes.html#TPlaneCollision">TPlaneCollision</a>: Outside is where plane direction (normal) points. Inside is where the <i>inverted</i> plane direction (normal) points.

<p>They work exactly like Box3DPlaneCollision, except they returns <code>True</code> when box is inside/outside (when Box3DPlaneCollision returned pcInside/pcOutside), and <code>False</code> otherwise.

<p>For example Box3DPlaneCollisionInside doesn't differentiate between case when box is empty, of partially intersects the plane, and is on the outside. But it works (very slightly) faster.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PlaneCollisionOutside"></a><code>function <b>PlaneCollisionOutside</b>(const Plane: <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="IsTriangleCollision"></a><code>function <b>IsTriangleCollision</b>( const Triangle: <a  href="CastleTriangles.html#TTriangle3Single">TTriangle3Single</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BoundingSphere"></a><code>procedure <b>BoundingSphere</b>( var SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; var SphereRadiusSqr: Single);</code></td>
</tr>
<tr><td colspan="2">
<p>
Smallest possible sphere completely enclosing given Box. When Box is empty we return SphereRadiusSqr = 0 and undefined SphereCenter.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Collision"></a><code>function <b>Collision</b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Radius"></a><code>function <b>Radius</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Radius of the minimal sphere that contains this box. Sphere center is assumed to be in (0, 0, 0). 0 if box is empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Radius2D"></a><code>function <b>Radius2D</b>(const IgnoreIndex: Integer): Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Radius of the minimal circle that contains the 2D projection of this box. 2D box projection is obtained by rejecting the IgnoreIndex coordinate (must be 0, 1 or 2). Circle center is assumed to be in (0, 0). 0 if box is empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SphereSimpleCollision"></a><code>function <b>SphereSimpleCollision</b>( const SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const SphereRadius: Single): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check for collision between box and sphere, fast <i>but not entirely correct</i>.

<p>This considers a Box enlarged by SphereRadius in each direction. Then checks whether SphereCenter is inside such enlarged Box. So this check will incorrectly report collision while in fact there's no collision in the case when the sphere center is near the corner of the Box.

<p>So this check is not 100% correct. But often this is good enough &mdash; in games, if you know that the SphereRadius is going to be relatively small compared to the Box, this may be perfectly acceptable. And it's fast.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="SphereCollision"></a><code>function <b>SphereCollision</b>( const SphereCenter: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const SphereRadius: Single): boolean;</code></td>
</tr>
<tr><td colspan="2">
<p>
Check for box &lt;-&gt; sphere collision. This is a little slower than <a class="normal" href="CastleBoxes.TBox3D.html#SphereSimpleCollision">SphereSimpleCollision</a>, although still damn fast, and it's a precise check.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MaximumPlane"></a><code>function <b>MaximumPlane</b>(const Direction: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Calculate a plane in 3D space with direction = given Direction, moved maximally in Direction and still intersecting the given Box.

<p>For example, if Direction = -Z = (0, 0, -1), then this will return the bottom plane of this box. For Direction = (1, 1, 1), this will return a plane intersecting the Data[1] (maximum) point, with slope = (1, 1, 1). The resulting plane always intersects at least one of the 8 corners of the box.

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>If the Box is empty.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MinimumPlane"></a><code>function <b>MinimumPlane</b>(const Direction: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): <a  href="CastleVectors.html#TVector4Single">TVector4Single</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Calculate a plane in 3D space with direction = given Direction, moved such that it touches the Box but takes minimum volume of this box.

<p>For example, if Direction = +Z = (0, 0, 1), then this will return the bottom plane of this box. For Direction = (1, 1, 1), this will return a plane intersecting the Data[0] (minimum) point, with slope = (1, 1, 1). The resulting plane always intersects at least one of the 8 corners of the box.

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>If the Box is empty.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointDistances"></a><code>procedure <b>PointDistances</b>(const P: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out MinDistance, MaxDistance: Single);</code></td>
</tr>
<tr><td colspan="2">
<p>
Calculate the distances between a given 3D point and a box. MinDistance is the distance to the closest point of the box, MaxDistance is the distance to the farthest point of the box.

<p>Note that always MinDistance &lt;= MaxDistance. Note that both distances are always &gt;= 0.

<p>When the point is inside the box, it works correct too: minimum distance is zero in this case.

<p>

<p>TODO: calculation of MinDistance is not perfect now. We assume that the closest/farthest point of the box is one of the 8 box corners. Which may not be true in case of the closest point, because it may lie in the middle of some box face (imagine a sphere with increasing radius reaching from a point to a box). So our minimum may be a *little* too large.</p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>When used with an empty box.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="DirectionDistances"></a><code>procedure <b>DirectionDistances</b>( const Point, Dir: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; out MinDistance, MaxDistance: Single);</code></td>
</tr>
<tr><td colspan="2">
<p>
Calculate the distances along a direction to a box. The idea is that you have a 3D plane orthogonal to direction Dir and passing through Point. You can move this plane, but you have to keep it's direction constant. MinDistance is the minimal distance along the Dir that you can move this plane, such that it touches the box. MaxDistance is the maximum such distance.

<p>Note that always MinDistance &lt;= MaxDistance. Note that one distance (MinDistance) or both distances may be negative.

<p>As a practical example: imagine a DirectionalLight (light rays are parallel) that has a location. Now MinDistance and MaxDistance give ranges of depth where the Box is, as seen from the light source.

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>When used with an empty box.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointDistance"></a><code>function <b>PointDistance</b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>): Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Shortest distance between the box and a point. Always zero when the point is inside the box.

<p></p>
<h6 class="description_section">Exceptions raised</h6>
<dl class="exceptions_raised">
<dt><a class="normal" href="CastleBoxes.EBox3DEmpty.html">EBox3DEmpty</a></dt>
<dd>When used with an empty box.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PointMaxDistance"></a><code>function <b>PointMaxDistance</b>(const Point: <a  href="CastleVectors.html#TVector3Single">TVector3Single</a>; const EmptyBoxDistance: Single): Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
Maximum distance between the box and a point. Returns EmptyBoxDistance when box is empty.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Equal"></a><code>function <b>Equal</b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Equal"></a><code>function <b>Equal</b>(const Box2: <a  href="CastleBoxes.TBox3D.html">TBox3D</a>; const EqualityEpsilon: Single): boolean;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Diagonal"></a><code>function <b>Diagonal</b>: Single;</code></td>
</tr>
<tr><td colspan="2">
<p>
<code>Diagonal</code> of the box, zero if empty.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:08</em>
</span>
</td></tr></table></body></html>