-
Notifications
You must be signed in to change notification settings - Fork 4
/
LUX.D3.pas
3450 lines (2917 loc) · 93.8 KB
/
LUX.D3.pas
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
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
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
unit LUX.D3;
interface //#################################################################### ■
uses System.Math, System.Math.Vectors,
LUX, LUX.D1, LUX.D2;
type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% T1Bit3D
T1Bit3D = record
private
///// アクセス
function Gets( const X_:Byte ) :Byte;
procedure Sets( const X_:Byte; const o_:Byte );
function GetX :Byte;
procedure SetX( const X_:Byte );
function GetY :Byte;
procedure SetY( const Y_:Byte );
function GetZ :Byte;
procedure SetZ( const Z_:Byte );
public
o :Byte;
constructor Create( const V_:Byte ); overload;
constructor Create( const X_,Y_,Z_:Byte ); overload;
///// プロパティ
property _s[ const I_:Byte ] :Byte read Gets write Sets;
property X :Byte read GetX write SetX;
property Y :Byte read GetY write SetY;
property Z :Byte read GetZ write SetZ;
property _1 :Byte read GetX write SetX;
property _2 :Byte read GetY write SetY;
property _3 :Byte read GetZ write SetZ;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TByte3D
TByte3D = record
private
public
constructor Create( const V_:Byte ); overload;
constructor Create( const X_,Y_,Z_:Byte ); overload;
case Byte of
0:( _Xs :array [ 1..3 ] of Byte; );
1:( X :Byte;
Y :Byte;
Z :Byte; );
2:( _1 :Byte;
_2 :Byte;
_3 :Byte; );
end;
TInt08u3D = TByte3D; TInt8u3D = TInt08u3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TShortint3D
TShortint3D = record
private
public
constructor Create( const V_:Shortint ); overload;
constructor Create( const X_,Y_,Z_:Shortint ); overload;
case Byte of
0:( _Xs :array [ 1..3 ] of Shortint; );
1:( X :Shortint;
Y :Shortint;
Z :Shortint; );
2:( _1 :Shortint;
_2 :Shortint;
_3 :Shortint; );
end;
TInt08s3D = TShortint3D; TInt8s3D = TInt08s3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TWord3D
TWord3D = record
private
public
constructor Create( const V_:Word ); overload;
constructor Create( const X_,Y_,Z_:Word ); overload;
case Byte of
0:( _Xs :array [ 1..3 ] of Word; );
1:( X :Word;
Y :Word;
Z :Word; );
2:( _1 :Word;
_2 :Word;
_3 :Word; );
end;
TInt16u3D = TWord3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSmallint3D
TSmallint3D = record
private
public
constructor Create( const V_:Smallint ); overload;
constructor Create( const X_,Y_,Z_:Smallint ); overload;
case Byte of
0:( _Xs :array [ 1..3 ] of Smallint; );
1:( X :Smallint;
Y :Smallint;
Z :Smallint; );
2:( _1 :Smallint;
_2 :Smallint;
_3 :Smallint; );
end;
TInt16s3D = TSmallint3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCardinal3D
TCardinal3D = record
private
///// アクセス
function GetLSB :T1Bit3D;
function GetMSB :T1Bit3D;
public
constructor Create( const V_:Cardinal ); overload;
constructor Create( const X_,Y_,Z_:Cardinal ); overload;
///// プロパティ
property LSB :T1Bit3D read GetLSB;
property MSB :T1Bit3D read GetMSB;
///// 演算子
class operator Negative( const V_:TCardinal3D ) :TCardinal3D; inline;
class operator Positive( const V_:TCardinal3D ) :TCardinal3D; inline;
class operator Add( const A_,B_:TCardinal3D ) :TCardinal3D; inline;
class operator Subtract( const A_,B_:TCardinal3D ) :TCardinal3D; inline;
class operator Multiply( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
class operator Multiply( const A_:Cardinal; const B_:TCardinal3D ) :TCardinal3D; inline;
class operator IntDivide( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
class operator Modulus( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
class operator LeftShift( const A_:TCardinal3D; const B_:Integer ) :TCardinal3D; inline;
class operator RightShift( const A_:TCardinal3D; const B_:Integer ) :TCardinal3D; inline;
class operator Equal( const A_,B_:TCardinal3D ) :Boolean; inline;
class operator NotEqual( const A_,B_:TCardinal3D ) :Boolean; inline;
class operator BitwiseAnd( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
class operator BitwiseOr( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
class operator BitwiseXor( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D; inline;
///// 型変換
class operator Explicit( const V_:TCardinal3D ) :TByte3D; inline;
class operator Explicit( const V_:TByte3D ) :TCardinal3D; inline;
class operator Explicit( const V_:TCardinal3D ) :TShortint3D; inline;
class operator Explicit( const V_:TShortint3D ) :TCardinal3D; inline;
class operator Explicit( const V_:TCardinal3D ) :TWord3D; inline;
class operator Explicit( const V_:TWord3D ) :TCardinal3D; inline;
class operator Explicit( const V_:TCardinal3D ) :TSmallint3D; inline;
class operator Explicit( const V_:TSmallint3D ) :TCardinal3D; inline;
case Byte of
0:( _Xs :array [ 1..3 ] of Cardinal; );
1:( X :Cardinal;
Y :Cardinal;
Z :Cardinal; );
2:( _1 :Cardinal;
_2 :Cardinal;
_3 :Cardinal; );
end;
TInt32u3D = TCardinal3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TInteger3D
TInteger3D = record
private
///// アクセス
function GetLSB :T1Bit3D;
function GetMSB :T1Bit3D;
public
constructor Create( const V_:Integer ); overload;
constructor Create( const X_,Y_,Z_:Integer ); overload;
///// プロパティ
property LSB :T1Bit3D read GetLSB;
property MSB :T1Bit3D read GetMSB;
///// 演算子
class operator Negative( const V_:TInteger3D ) :TInteger3D; inline;
class operator Positive( const V_:TInteger3D ) :TInteger3D; inline;
class operator Add( const A_,B_:TInteger3D ) :TInteger3D; inline;
class operator Subtract( const A_,B_:TInteger3D ) :TInteger3D; inline;
class operator Multiply( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator Multiply( const A_:Integer; const B_:TInteger3D ) :TInteger3D; inline;
class operator IntDivide( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator Modulus( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator LeftShift( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator RightShift( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator Equal( const A_,B_:TInteger3D ) :Boolean; inline;
class operator NotEqual( const A_,B_:TInteger3D ) :Boolean; inline;
class operator BitwiseAnd( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator BitwiseOr( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
class operator BitwiseXor( const A_:TInteger3D; const B_:Integer ) :TInteger3D; inline;
///// 型変換
class operator Explicit( const V_:TInteger3D ) :TByte3D; inline;
class operator Explicit( const V_:TByte3D ) :TInteger3D; inline;
class operator Explicit( const V_:TInteger3D ) :TShortint3D; inline;
class operator Explicit( const V_:TShortint3D ) :TInteger3D; inline;
class operator Explicit( const V_:TInteger3D ) :TWord3D; inline;
class operator Explicit( const V_:TWord3D ) :TInteger3D; inline;
class operator Explicit( const V_:TInteger3D ) :TSmallint3D; inline;
class operator Explicit( const V_:TSmallint3D ) :TInteger3D; inline;
class operator Implicit( const V_:TInteger3D ) :TPoint3D; inline;
case Byte of
0:( _Xs :array [ 1..3 ] of Integer; );
1:( X :Integer;
Y :Integer;
Z :Integer; );
2:( _1 :Integer;
_2 :Integer;
_3 :Integer; );
end;
TInt32s3D = TInteger3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingle3D
TSingle3D = record
private
///// アクセス
function Gets( const X_:Integer ) :Single; inline;
procedure Sets( const X_:Integer; const V_:Single ); inline;
function GetSiz2 :Single; inline;
procedure SetSiz2( const Siz2_:Single ); inline;
function GetSize :Single; inline;
procedure SetSize( const Size_:Single ); inline;
function GetUnitor :TSingle3D; inline;
procedure SetUnitor( const Unitor_:TSingle3D ); inline;
function GetOrthant :Byte;
function GetProjXY :TSingle2D; inline;
procedure SetProjXY( const ProjXY_:TSingle2D ); inline;
function GetProjYZ :TSingle2D; inline;
procedure SetProjYZ( const ProjYZ_:TSingle2D ); inline;
function GetProjZX :TSingle2D; inline;
procedure SetProjZX( const ProjZX_:TSingle2D ); inline;
public
constructor Create( const V_:Single ); overload;
constructor Create( const X_,Y_,Z_:Single ); overload;
///// プロパティ
property _s[ const X_:Integer ] :Single read Gets write Sets ; default;
property Siz2 :Single read GetSiz2 write SetSiz2 ;
property Size :Single read GetSize write SetSize ;
property Unitor :TSingle3D read GetUnitor write SetUnitor;
property Orthant :Byte read GetOrthant ;
property ProjXY :TSingle2D read GetProjXY write SetProjXY;
property ProjYZ :TSingle2D read GetProjYZ write SetProjYZ;
property ProjZX :TSingle2D read GetProjZX write SetProjZX;
///// 演算子
class operator Negative( const V_:TSingle3D ) :TSingle3D; inline;
class operator Positive( const V_:TSingle3D ) :TSingle3D; inline;
class operator Add( const A_,B_:TSingle3D ) :TSingle3D; inline;
class operator Subtract( const A_,B_:TSingle3D ) :TSingle3D; inline;
class operator Multiply( const A_:TSingle3D; const B_:Single ) :TSingle3D; inline;
class operator Multiply( const A_:Single; const B_:TSingle3D ) :TSingle3D; inline;
class operator Divide( const A_:TSingle3D; const B_:Single ) :TSingle3D; inline;
///// 型変換
class operator Implicit( const V_:TInteger3D ) :TSingle3D; inline;
class operator Implicit( const V_:TSingle2D ) :TSingle3D; inline;
class operator Explicit( const V_:TSingle3D ) :TSingle2D; inline;
class operator Implicit( const V_:TPoint3D ) :TSingle3D; inline;
class operator Implicit( const V_:TSingle3D ) :TPoint3D; inline;
class operator Implicit( const V_:TVector3D ) :TSingle3D; inline;
class operator Implicit( const V_:TSingle3D ) :TVector3D; inline;
///// 定数
class function IdentityX :TSingle3D; inline; static;
class function IdentityY :TSingle3D; inline; static;
class function IdentityZ :TSingle3D; inline; static;
///// メソッド
function VectorTo( const P_:TSingle3D ) :TSingle3D;
function UnitorTo( const P_:TSingle3D ) :TSingle3D;
function DistanTo( const P_:TSingle3D ) :Single;
class function RandG :TSingle3D; static;
class function RandBS1 :TSingle3D; static;
class function RandBS2 :TSingle3D; static;
class function RandBS4 :TSingle3D; static;
case Byte of
0:( _Xs :array [ 1..3 ] of Single; );
1:( X :Single;
Y :Single;
Z :Single; );
2:( _1 :Single;
_2 :Single;
_3 :Single; );
end;
TFlo32s3D = TSingle3D;
TSinglePos3D = TSingle3D;
TSingleVec3D = TSingle3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDouble3D
TDouble3D = record
private
///// アクセス
function Gets( const X_:Integer ) :Double; inline;
procedure Sets( const X_:Integer; const V_:Double ); inline;
function GetSiz2 :Double; inline;
procedure SetSiz2( const Siz2_:Double ); inline;
function GetSize :Double; inline;
procedure SetSize( const Size_:Double ); inline;
function GetUnitor :TDouble3D; inline;
procedure SetUnitor( const Unitor_:TDouble3D ); inline;
function GetOrthant :Byte;
function GetProjXY :TDouble2D; inline;
procedure SetProjXY( const ProjXY_:TDouble2D ); inline;
function GetProjYZ :TDouble2D; inline;
procedure SetProjYZ( const ProjYZ_:TDouble2D ); inline;
function GetProjZX :TDouble2D; inline;
procedure SetProjZX( const ProjZX_:TDouble2D ); inline;
public
constructor Create( const V_:Double ); overload;
constructor Create( const X_,Y_,Z_:Double ); overload;
///// プロパティ
property _s[ const X_:Integer ] :Double read Gets write Sets ; default;
property Siz2 :Double read GetSiz2 write SetSiz2 ;
property Size :Double read GetSize write SetSize ;
property Unitor :TDouble3D read GetUnitor write SetUnitor;
property Orthant :Byte read GetOrthant ;
property ProjXY :TDouble2D read GetProjXY write SetProjXY;
property ProjYZ :TDouble2D read GetProjYZ write SetProjYZ;
property ProjZX :TDouble2D read GetProjZX write SetProjZX;
///// 演算子
class operator Negative( const V_:TDouble3D ) :TDouble3D; inline;
class operator Positive( const V_:TDouble3D ) :TDouble3D; inline;
class operator Add( const A_,B_:TDouble3D ) :TDouble3D; inline;
class operator Subtract( const A_,B_:TDouble3D ) :TDouble3D; inline;
class operator Multiply( const A_:TDouble3D; const B_:Double ) :TDouble3D; inline;
class operator Multiply( const A_:Double; const B_:TDouble3D ) :TDouble3D; inline;
class operator Divide( const A_:TDouble3D; const B_:Double ) :TDouble3D; inline;
///// 型変換
class operator Implicit( const V_:TInteger3D ) :TDouble3D; inline;
class operator Implicit( const V_:TDouble2D ) :TDouble3D; inline;
class operator Explicit( const V_:TDouble3D ) :TDouble2D; inline;
class operator Implicit( const V_:TPoint3D ) :TDouble3D; inline;
class operator Implicit( const V_:TDouble3D ) :TPoint3D; inline;
class operator Implicit( const V_:TVector3D ) :TDouble3D; inline;
class operator Implicit( const V_:TDouble3D ) :TVector3D; inline;
///// 定数
class function IdentityX :TDouble3D; inline; static;
class function IdentityY :TDouble3D; inline; static;
class function IdentityZ :TDouble3D; inline; static;
///// メソッド
function VectorTo( const P_:TDouble3D ) :TDouble3D;
function UnitorTo( const P_:TDouble3D ) :TDouble3D;
function DistanTo( const P_:TDouble3D ) :Double;
class function RandG :TDouble3D; static;
class function RandBS1 :TDouble3D; static;
class function RandBS2 :TDouble3D; static;
class function RandBS4 :TDouble3D; static;
case Byte of
0:( _Xs :array [ 1..3 ] of Double; );
1:( X :Double;
Y :Double;
Z :Double; );
2:( _1 :Double;
_2 :Double;
_3 :Double; );
end;
TFlo64s3D = TDouble3D;
TDoublePos3D = TDouble3D;
TDoubleVec3D = TDouble3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSingle3D
TdSingle3D = record
private
///// アクセス
function Gets( const X_:Integer ) :TdSingle; inline;
procedure Sets( const X_:Integer; const V_:TdSingle ); inline;
function Geto :TSingle3D; inline;
procedure Seto( const o_:TSingle3D ); inline;
function Getd :TSingle3D; inline;
procedure Setd( const d_:TSingle3D ); inline;
function GetSiz2 :TdSingle; inline;
procedure SetSiz2( const Siz2_:TdSingle ); inline;
function GetSize :TdSingle; inline;
procedure SetSize( const Size_:TdSingle ); inline;
function GetUnitor :TdSingle3D; inline;
procedure SetUnitor( const Unitor_:TdSingle3D ); inline;
public
constructor Create( const X_,Y_,Z_:TdSingle );
///// プロパティ
property _s[ const X_:Integer ] :TdSingle read Gets write Sets ; default;
property o :TSingle3D read Geto write Seto ;
property d :TSingle3D read Getd write Setd ;
property Siz2 :TdSingle read GetSiz2 write SetSiz2 ;
property Size :TdSingle read GetSize write SetSize ;
property Unitor :TdSingle3D read GetUnitor write SetUnitor;
///// 演算子
class operator Negative( const V_:TdSingle3D ) :TdSingle3D; inline;
class operator Positive( const V_:TdSingle3D ) :TdSingle3D; inline;
class operator Add( const A_,B_:TdSingle3D ) :TdSingle3D; inline;
class operator Subtract( const A_,B_:TdSingle3D ) :TdSingle3D; inline;
class operator Multiply( const A_:TdSingle3D; const B_:TdSingle ) :TdSingle3D; inline;
class operator Multiply( const A_:TdSingle; const B_:TdSingle3D ) :TdSingle3D; inline;
class operator Divide( const A_:TdSingle3D; const B_:TdSingle ) :TdSingle3D; inline;
///// 型変換
class operator Implicit( const V_:TSingle3D ) :TdSingle3D;
class operator Implicit( const V_:TdSingle3D ) :TSingle3D; inline;
case Byte of
0:( _Xs :array [ 1..3 ] of TdSingle; );
1:( X :TdSingle;
Y :TdSingle;
Z :TdSingle; );
2:( _1 :TdSingle;
_2 :TdSingle;
_3 :TdSingle; );
end;
TdFlo32s3D = TdSingle3D;
TdSinglePos3D = TdSingle3D;
TdSingleVec3D = TdSingle3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdDouble3D
TdDouble3D = record
private
///// アクセス
function Gets( const X_:Integer ) :TdDouble; inline;
procedure Sets( const X_:Integer; const V_:TdDouble ); inline;
function Geto :TDouble3D; inline;
procedure Seto( const o_:TDouble3D ); inline;
function Getd :TDouble3D; inline;
procedure Setd( const d_:TDouble3D ); inline;
function GetSiz2 :TdDouble; inline;
procedure SetSiz2( const Siz2_:TdDouble ); inline;
function GetSize :TdDouble; inline;
procedure SetSize( const Size_:TdDouble ); inline;
function GetUnitor :TdDouble3D; inline;
procedure SetUnitor( const Unitor_:TdDouble3D ); inline;
public
constructor Create( const X_,Y_,Z_:TdDouble );
///// プロパティ
property _s[ const X_:Integer ] :TdDouble read Gets write Sets ; default;
property o :TDouble3D read Geto write Seto ;
property d :TDouble3D read Getd write Setd ;
property Siz2 :TdDouble read GetSiz2 write SetSiz2 ;
property Size :TdDouble read GetSize write SetSize ;
property Unitor :TdDouble3D read GetUnitor write SetUnitor;
///// 演算子
class operator Negative( const V_:TdDouble3D ) :TdDouble3D; inline;
class operator Positive( const V_:TdDouble3D ) :TdDouble3D; inline;
class operator Add( const A_,B_:TdDouble3D ) :TdDouble3D; inline;
class operator Subtract( const A_,B_:TdDouble3D ) :TdDouble3D; inline;
class operator Multiply( const A_:TdDouble3D; const B_:TdDouble ) :TdDouble3D; inline;
class operator Multiply( const A_:TdDouble; const B_:TdDouble3D ) :TdDouble3D; inline;
class operator Divide( const A_:TdDouble3D; const B_:TdDouble ) :TdDouble3D; inline;
///// 型変換
class operator Implicit( const V_:TDouble3D ) :TdDouble3D;
class operator Implicit( const V_:TdDouble3D ) :TDouble3D; inline;
case Byte of
0:( _Xs :array [ 1..3 ] of TdDouble; );
1:( X :TdDouble;
Y :TdDouble;
Z :TdDouble; );
2:( _1 :TdDouble;
_2 :TdDouble;
_3 :TdDouble; );
end;
TdFlo64s3D = TdDouble3D;
TdDoublePos3D = TdDouble3D;
TdDoubleVec3D = TdDouble3D;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleSiz3D
TSingleSiz3D = record
private
public
X :Single;
Y :Single;
Z :Single;
/////
constructor Create( const X_,Y_,Z_:Single );
///// 演算子
class operator Negative( const V_:TSingleSiz3D ) :TSingleSiz3D; inline;
class operator Positive( const V_:TSingleSiz3D ) :TSingleSiz3D; inline;
class operator Add( const A_,B_:TSingleSiz3D ) :TSingleSiz3D; inline;
class operator Subtract( const A_,B_:TSingleSiz3D ) :TSingleSiz3D; inline;
class operator Multiply( const A_:TSingleSiz3D; const B_:Single ) :TSingleSiz3D; inline;
class operator Multiply( const A_:Single; const B_:TSingleSiz3D ) :TSingleSiz3D; inline;
class operator Divide( const A_:TSingleSiz3D; const B_:Single ) :TSingleSiz3D; inline;
///// 型変換
class operator Implicit( const V_:TPoint3D ) :TSingleSiz3D; inline;
class operator Implicit( const V_:TSingleSiz3D ) :TPoint3D; inline;
class operator Implicit( const V_:TVector3D ) :TSingleSiz3D; inline;
class operator Implicit( const V_:TSingleSiz3D ) :TVector3D; inline;
class operator Implicit( const V_:TSingle3D ) :TSingleSiz3D; inline;
class operator Implicit( const V_:TSingleSiz3D ) :TSingle3D; inline;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleSiz3D
TDoubleSiz3D = record
private
public
X :Double;
Y :Double;
Z :Double;
/////
constructor Create( const X_,Y_,Z_:Double );
///// 演算子
class operator Negative( const V_:TDoubleSiz3D ) :TDoubleSiz3D; inline;
class operator Positive( const V_:TDoubleSiz3D ) :TDoubleSiz3D; inline;
class operator Add( const A_,B_:TDoubleSiz3D ) :TDoubleSiz3D; inline;
class operator Subtract( const A_,B_:TDoubleSiz3D ) :TDoubleSiz3D; inline;
class operator Multiply( const A_:TDoubleSiz3D; const B_:Double ) :TDoubleSiz3D; inline;
class operator Multiply( const A_:Double; const B_:TDoubleSiz3D ) :TDoubleSiz3D; inline;
class operator Divide( const A_:TDoubleSiz3D; const B_:Double ) :TDoubleSiz3D; inline;
///// 型変換
class operator Implicit( const V_:TPoint3D ) :TDoubleSiz3D; inline;
class operator Implicit( const V_:TDoubleSiz3D ) :TPoint3D; inline;
class operator Implicit( const V_:TVector3D ) :TDoubleSiz3D; inline;
class operator Implicit( const V_:TDoubleSiz3D ) :TVector3D; inline;
class operator Implicit( const V_:TDouble3D ) :TDoubleSiz3D; inline;
class operator Implicit( const V_:TDoubleSiz3D ) :TDouble3D; inline;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleArea3D
TSingleArea3D = record
private
///// アクセス
function GetPoin( const I_:Integer ) :TSingle3D;
function GetSign :ShortInt;
function GetSizeX :Single;
function GetSizeY :Single;
function GetSizeZ :Single;
function GetProjX :TSingleArea;
procedure SetProjX( const ProjX_:TSingleArea );
function GetProjY :TSingleArea;
procedure SetProjY( const ProjY_:TSingleArea );
function GetProjZ :TSingleArea;
procedure SetProjZ( const ProjZ_:TSingleArea );
function GetCenter :TSingle3D;
function GetProjXY :TSingleArea2D;
function GetProjYZ :TSingleArea2D;
function GetProjZX :TSingleArea2D;
public
Min :TSingle3D;
Max :TSingle3D;
/////
constructor Create( const Min_,Max_:Single ); overload;
constructor Create( const MinX_,MinY_,MinZ_,
MaxX_,MaxY_,MaxZ_:Single ); overload;
constructor Create( const Min_,Max_:TSingle3D ); overload;
///// プロパティ
property Poin[ const I_:Integer ] :TSingle3D read GetPoin ;
property Sign :ShortInt read GetSign ;
property SizeX :Single read GetSizeX ;
property SizeY :Single read GetSizeY ;
property SizeZ :Single read GetSizeZ ;
property ProjX :TSingleArea read GetProjX write SetProjX;
property ProjY :TSingleArea read GetProjY write SetProjY;
property ProjZ :TSingleArea read GetProjZ write SetProjZ;
property Center :TSingle3D read GetCenter ;
property ProjXY :TSingleArea2D read GetProjXY ;
property ProjYZ :TSingleArea2D read GetProjYZ ;
property ProjZX :TSingleArea2D read GetProjZX ;
///// 定数
class function NeInf :TSingleArea3D; static;
class function NeMax :TSingleArea3D; static;
class function Zero :TSingleArea3D; static;
class function PoMax :TSingleArea3D; static;
class function PoInf :TSingleArea3D; static;
///// メソッド
function ProjVec( const Vec_:TSingle3D ) :TSingleArea;
function Collision( const Area_:TSingleArea3D ) :Boolean;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleArea3D
TDoubleArea3D = record
private
///// アクセス
function GetPoin( const I_:Integer ) :TDouble3D;
function GetSign :ShortInt;
function GetSizeX :Double;
function GetSizeY :Double;
function GetSizeZ :Double;
function GetProjX :TDoubleArea;
procedure SetProjX( const ProjX_:TDoubleArea );
function GetProjY :TDoubleArea;
procedure SetProjY( const ProjY_:TDoubleArea );
function GetProjZ :TDoubleArea;
procedure SetProjZ( const ProjZ_:TDoubleArea );
function GetCenter :TDouble3D;
function GetProjXY :TDoubleArea2D;
function GetProjYZ :TDoubleArea2D;
function GetProjZX :TDoubleArea2D;
public
Min :TDouble3D;
Max :TDouble3D;
/////
constructor Create( const Min_,Max_:Double ); overload;
constructor Create( const MinX_,MinY_,MinZ_,
MaxX_,MaxY_,MaxZ_:Double ); overload;
constructor Create( const Min_,Max_:TDouble3D ); overload;
///// プロパティ
property Poin[ const I_:Integer ] :TDouble3D read GetPoin ;
property Sign :ShortInt read GetSign ;
property SizeX :Double read GetSizeX ;
property SizeY :Double read GetSizeY ;
property SizeZ :Double read GetSizeZ ;
property ProjX :TDoubleArea read GetProjX write SetProjX;
property ProjY :TDoubleArea read GetProjY write SetProjY;
property ProjZ :TDoubleArea read GetProjZ write SetProjZ;
property Center :TDouble3D read GetCenter ;
property ProjXY :TDoubleArea2D read GetProjXY ;
property ProjYZ :TDoubleArea2D read GetProjYZ ;
property ProjZX :TDoubleArea2D read GetProjZX ;
///// 定数
class function NeInf :TDoubleArea3D; static;
class function NeMax :TDoubleArea3D; static;
class function Zero :TDoubleArea3D; static;
class function PoMax :TDoubleArea3D; static;
class function PoInf :TDoubleArea3D; static;
///// メソッド
function ProjVec( const Vec_:TDouble3D ) :TDoubleArea;
function Collision( const Area_:TDoubleArea3D ) :Boolean;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleRay3D
TSingleRay3D = record
private
///// アクセス
function GetUnitor :TSingleRay3D; inline;
procedure SetUnitor( const Unitor_:TSingleRay3D ); inline;
public
Pos :TSinglePos3D;
Vec :TSingleVec3D;
///// プロパティ
property Unitor :TSingleRay3D read GetUnitor write SetUnitor;
///// メソッド
function GoPos( const Len_:Single ) :TSingle3D;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleRay3D
TDoubleRay3D = record
private
///// アクセス
function GetUnitor :TDoubleRay3D; inline;
procedure SetUnitor( const Unitor_:TDoubleRay3D ); inline;
public
Pos :TDoublePos3D;
Vec :TDoubleVec3D;
///// プロパティ
property Unitor :TDoubleRay3D read GetUnitor write SetUnitor;
///// メソッド
function GoPos( const Len_:Double ) :TDouble3D;
end;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】
//const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】
//var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】
function DotProduct( const A_,B_:TSingleVec3D ) :Single; inline; overload;
function DotProduct( const A_,B_:TDoubleVec3D ) :Double; inline; overload;
function DotProduct( const A_,B_:TdSingleVec3D ) :TdSingle; inline; overload;
function DotProduct( const A_,B_:TdDoubleVec3D ) :TdDouble; inline; overload;
function CrossProduct( const A_,B_:TSingleVec3D ) :TSingleVec3D; inline; overload;
function CrossProduct( const A_,B_:TDoubleVec3D ) :TDoubleVec3D; inline; overload;
function CrossProduct( const A_,B_:TdSingleVec3D ) :TdSingleVec3D; inline; overload;
function CrossProduct( const A_,B_:TdDoubleVec3D ) :TdDoubleVec3D; inline; overload;
function Distanc2( const A_,B_:TSinglePos3D ) :Single; inline; overload;
function Distanc2( const A_,B_:TDoublePos3D ) :Double; inline; overload;
function Distance( const A_,B_:TSinglePos3D ) :Single; inline; overload;
function Distance( const A_,B_:TDoublePos3D ) :Double; inline; overload;
function Distanc2( const A_,B_:TdSinglePos3D ) :TdSingle; inline; overload;
function Distanc2( const A_,B_:TdDoublePos3D ) :TdDouble; inline; overload;
function Distance( const A_,B_:TdSinglePos3D ) :TdSingle; inline; overload;
function Distance( const A_,B_:TdDoublePos3D ) :TdDouble; inline; overload;
function Ave( const P1_,P2_:TSingle3D ) :TSingle3D; inline; overload;
function Ave( const P1_,P2_:TDouble3D ) :TDouble3D; inline; overload;
function Ave( const P1_,P2_,P3_:TSingle3D ) :TSingle3D; inline; overload;
function Ave( const P1_,P2_,P3_:TDouble3D ) :TDouble3D; inline; overload;
function Ave( const P1_,P2_,P3_,P4_:TSingle3D ) :TSingle3D; inline; overload;
function Ave( const P1_,P2_,P3_,P4_:TDouble3D ) :TDouble3D; inline; overload;
function Ave( const P1_,P2_:TdSingle3D ) :TdSingle3D; inline; overload;
function Ave( const P1_,P2_:TdDouble3D ) :TdDouble3D; inline; overload;
function Ave( const P1_,P2_,P3_:TdSingle3D ) :TdSingle3D; inline; overload;
function Ave( const P1_,P2_,P3_:TdDouble3D ) :TdDouble3D; inline; overload;
function Ave( const P1_,P2_,P3_,P4_:TdSingle3D ) :TdSingle3D; inline; overload;
function Ave( const P1_,P2_,P3_,P4_:TdDouble3D ) :TdDouble3D; inline; overload;
function Nabla( const Func_:TConstFunc<TdSingle3D,TdSingle>; const P_:TSingle3D ) :TSingle3D; inline; overload;
function Nabla( const Func_:TConstFunc<TdDouble3D,TdDouble>; const P_:TDouble3D ) :TDouble3D; inline; overload;
function PolySolveReal( const Ks_:TSingle3D; out Xs_:TSingle2D ) :Byte; overload;
function PolySolveReal( const Ks_:TDouble3D; out Xs_:TDouble2D ) :Byte; overload;
implementation //############################################################### ■
uses System.SysUtils;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% T1Bit3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
/////////////////////////////////////////////////////////////////////// アクセス
function T1Bit3D.Gets( const X_:Byte ) :Byte;
begin
Result := ( o shr X_ ) and $01;
end;
procedure T1Bit3D.Sets( const X_:Byte; const o_:Byte );
begin
o := ( o and ( not ( $01 shl X_ ) ) ) or ( o_ shl X_ );
end;
function T1Bit3D.GetX :Byte;
begin
Result := o and $01;
end;
procedure T1Bit3D.SetX( const X_:Byte );
begin
o := ( o and $06 ) or X_;
end;
function T1Bit3D.GetY :Byte;
begin
Result := ( o shr 1 ) and $01;
end;
procedure T1Bit3D.SetY( const Y_:Byte );
begin
o := ( o and $05 ) or ( Y_ shl 1 );
end;
function T1Bit3D.GetZ :Byte;
begin
Result := ( o shr 2 ) and $01;
end;
procedure T1Bit3D.SetZ( const Z_:Byte );
begin
o := ( o and $03 ) or ( Z_ shl 2 );
end;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor T1Bit3D.Create( const V_:Byte );
begin
Create( V_, V_, V_ );
end;
constructor T1Bit3D.Create( const X_,Y_,Z_:Byte );
begin
o := ( Z_ shl 2 ) or ( Y_ shl 1 ) or X_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TByte3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TByte3D.Create( const V_:Byte );
begin
X := V_;
Y := V_;
Z := V_;
end;
constructor TByte3D.Create( const X_,Y_,Z_:Byte );
begin
X := X_;
Y := Y_;
Z := Z_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TShortint3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TShortint3D.Create( const V_:Shortint );
begin
X := V_;
Y := V_;
Z := V_;
end;
constructor TShortint3D.Create( const X_,Y_,Z_:Shortint );
begin
X := X_;
Y := Y_;
Z := Z_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TWord3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TWord3D.Create( const V_:Word );
begin
X := V_;
Y := V_;
Z := V_;
end;
constructor TWord3D.Create( const X_,Y_,Z_:Word );
begin
X := X_;
Y := Y_;
Z := Z_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSmallint3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TSmallint3D.Create( const V_:Smallint );
begin
X := V_;
Y := V_;
Z := V_;
end;
constructor TSmallint3D.Create( const X_,Y_,Z_:Smallint );
begin
X := X_;
Y := Y_;
Z := Z_;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCardinal3D
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private
/////////////////////////////////////////////////////////////////////// アクセス
function TCardinal3D.GetLSB :T1Bit3D;
begin
Result.X := X and $00000001;
Result.Y := Y and $00000001;
Result.Z := Z and $00000001;
end;
function TCardinal3D.GetMSB :T1Bit3D;
begin
Result.X := X and $80000000;
Result.Y := Y and $80000000;
Result.Z := Z and $80000000;
end;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public
constructor TCardinal3D.Create( const V_:Cardinal );
begin
X := V_;
Y := V_;
Z := V_;
end;
constructor TCardinal3D.Create( const X_,Y_,Z_:Cardinal );
begin
X := X_;
Y := Y_;
Z := Z_;
end;
///////////////////////////////////////////////////////////////////////// 演算子
class operator TCardinal3D.Negative( const V_:TCardinal3D ) :TCardinal3D;
begin
with Result do
begin
X := -V_.X;
Y := -V_.Y;
Z := -V_.Z;
end;
end;
class operator TCardinal3D.Positive( const V_:TCardinal3D ) :TCardinal3D;
begin
with Result do
begin
X := +V_.X;
Y := +V_.Y;
Z := +V_.Z;
end;
end;
class operator TCardinal3D.Add( const A_,B_:TCardinal3D ) :TCardinal3D;
begin
with Result do
begin
X := A_.X + B_.X;
Y := A_.Y + B_.Y;
Z := A_.Z + B_.Z;
end;
end;
class operator TCardinal3D.Subtract( const A_,B_:TCardinal3D ) :TCardinal3D;
begin
with Result do
begin
X := A_.X - B_.X;
Y := A_.Y - B_.Y;
Z := A_.Z - B_.Z;
end;
end;
class operator TCardinal3D.Multiply( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D;
begin
with Result do
begin
X := A_.X * B_;
Y := A_.Y * B_;
Z := A_.Z * B_;
end;
end;
class operator TCardinal3D.Multiply( const A_:Cardinal; const B_:TCardinal3D ) :TCardinal3D;
begin
with Result do
begin
X := A_ * B_.X;
Y := A_ * B_.Y;
Z := A_ * B_.Z;
end;
end;
class operator TCardinal3D.IntDivide( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D;
begin
with Result do
begin
X := A_.X div B_;
Y := A_.Y div B_;
Z := A_.Z div B_;
end;
end;
class operator TCardinal3D.Modulus( const A_:TCardinal3D; const B_:Cardinal ) :TCardinal3D;
begin
with Result do
begin
X := A_.X mod B_;
Y := A_.Y mod B_;
Z := A_.Z mod B_;
end;
end;
class operator TCardinal3D.LeftShift( const A_:TCardinal3D; const B_:Integer ) :TCardinal3D;
begin
with Result do
begin
X := A_.X shl B_;
Y := A_.Y shl B_;
Z := A_.Z shl B_;
end;
end;
class operator TCardinal3D.RightShift( const A_:TCardinal3D; const B_:Integer ) :TCardinal3D;
begin
with Result do
begin
X := A_.X shr B_;
Y := A_.Y shr B_;
Z := A_.Z shr B_;
end;
end;
class operator TCardinal3D.Equal( const A_,B_:TCardinal3D ) :Boolean;
begin
Result := ( A_.X = B_.X ) and ( A_.Y = B_.Y ) and ( A_.Z = B_.Z );