-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCore3D.pas
executable file
·1902 lines (1476 loc) · 78.5 KB
/
Core3D.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 Core3D;
interface
uses windows;
const
DOPENGL=0;
DDIRECT3D9=1;
Rad:Single=0.017453292519; // Pi/180
Deg:Single=57.29577951308; // 180/Pi
const
MF_WIREFRAME = $1;
MF_POINTCLOUD = $2;
MF_GOURAUD_SHADING = $4;
MF_LIGHTING = $8;
MF_ZBUFFER = $10;
MF_ZWRITE_ENABLE = $20;
MF_BACK_FACE_CULLING = $40;
MF_FRONT_FACE_CULLING = $80;
MF_BILINEAR_FILTER = $100;
MF_TRILINEAR_FILTER = $200;
MF_ANISOTROPIC_FILTER = $400;
MF_FOG_ENABLE = $800;
MF_NORMALIZE_NORMALS = $1000;
MF_TEXTURE_WRAP = $2000;
MF_ANTI_ALIASING = $4000;
MF_COLOR_MASK = $8000;
MF_COLOR_MATERIAL = $10000;
MF_USE_MIP_MAPS = $20000;
MF_BLEND_OPERATION = $40000;
MF_POLYGON_OFFSET = $80000 ;
BLEND_SCREEN = 0;
BLEND_ADD = 1;
BLEND_SUBTRACT = 2;
BLEND_MULTIPLY = 3;
BLEND_DIVIDE = 4;
TOP_EDGE =0;
BOTTOM_EDGE =1;
LEFT_EDGE =2;
RIGHT_EDGE =3;
type
ITEXTURE=pointer;
IMOtion=pointer;
IFONT=pointer;
INODE=pointer;
ICAMERA=INODE;
IMesh=pointer;
IMaterial=pointer;
ITerrainLOD=INODE;
ILAndscape=INODE;
IAnimator=Pointer;
ISurface=pointer;
ILIGHT=INODE;
IImage=pointer;
ISPRITE=INODE;
ISteer=pointer;
IObstacle=Pointer;
ItseerPath=Pointer;
IPARTICLE=INODE;
ISHADER=pointer;
IEMITTER=pointer;
ITriangleSelector=pointer;
ITriangleList=ITriangleSelector;
IQuadLand=pointer;
Void=pointer;
IZone=pointer;
ILODNOD=pointer;
ISERVICE=pointer;
IDevice=pointer;
TShaderCallBack=procedure(service:IService;userdata:integer);stdcall;
E_CULLING_TYPE=(
EAC_OFF = 0,
EAC_BOX = 1,
EAC_FRUSTUM_BOX = 2,
EAC_FRUSTUM_SPHERE = 4,
EAC_OCC_QUERY = 8
);
EMD2_ANIMATION_TYPE=(
EMAT_STAND = 0,
EMAT_RUN,
EMAT_ATTACK,
EMAT_PAIN_A,
EMAT_PAIN_B,
EMAT_PAIN_C,
EMAT_JUMP,
EMAT_FLIP,
EMAT_SALUTE,
EMAT_FALLBACK,
EMAT_WAVE,
EMAT_POINT,
EMAT_CROUCH_STAND,
EMAT_CROUCH_WALK,
EMAT_CROUCH_ATTACK,
EMAT_CROUCH_PAIN,
EMAT_CROUCH_DEATH,
EMAT_DEATH_FALLBACK,
EMAT_DEATH_FALLFORWARD,
EMAT_DEATH_FALLBACKSLOW,
EMAT_BOOM,
//! Not an animation, but amount of animation types.
EMAT_COUNT
);
TMeshTYPE=(
ESNT_CUBE=0,
ESNT_SPHERE=1,
ESNT_TEXT=2,
ESNT_WATER_SURFACE=3,
ESNT_TERRAIN=4,
ESNT_SKY_BOX=5,
ESNT_SKY_DOME=6,
ESNT_OCTREE=7,
ESNT_MESH=8,
ESNT_LIGHT=9,
ESNT_EMPTY=10,
ESNT_DUMMY_TRANSFORMATION=11,
ESNT_CAMERA=12,
ESNT_BILLBOARD=13,
ESNT_ANIMATED_MESH=14,
ESNT_PARTICLE_SYSTEM=15,
ESNT_UNKNOWN=16);
TPRIMITIVETYPE=(
TPOINTS=0,
TLINE_STRIP,
TLINE_LOOP,
TLINES,
TTRIANGLE_STRIP,
TTRIANGLE_FAN,
TTRIANGLES,
TQUAD_STRIP,
TQUADS,
TPOLYGON,
TPOINT_SPRITES);
TMATERIALTYPE=(
EMT_SOLID = 0,
EMT_SOLID_2_LAYER,
EMT_LIGHTMAP,
EMT_LIGHTMAP_ADD,
EMT_LIGHTMAP_M2,
EMT_LIGHTMAP_M4,
EMT_LIGHTMAP_LIGHTING,
EMT_LIGHTMAP_LIGHTING_M2,
EMT_LIGHTMAP_LIGHTING_M4,
EMT_DETAIL_MAP,
EMT_SPHERE_MAP,
EMT_REFLECTION_2_LAYER,
EMT_TRANSPARENT_ADD_COLOR,
EMT_TRANSPARENT_ALPHA_CHANNEL,
EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
EMT_TRANSPARENT_VERTEX_ALPHA,
EMT_TRANSPARENT_REFLECTION_2_LAYER,
EMT_NORMAL_MAP_SOLID,
EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR,
EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA,
EMT_PARALLAX_MAP_SOLID,
EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR,
EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA,
EMT_ONETEXTURE_BLEND,
EMT_FOUR_DETAIL_MAP,
EMT_TRANSPARENT_ADD_ALPHA_CHANNEL_REF,
EMT_TRANSPARENT_ADD_ALPHA_CHANNEL,
EMT_FORCE_32BIT = $7fffffff
);
TLIGHTTYPE=(
LPOINT = 0,
LSPOT,
LDIRECTIONAL);
ITERRAINLODPATCHSIZE=(
ETPS_9 = 9,
ETPS_17 = 17,
ETPS_33 = 33 ,
ETPS_65 = 65,
ETPS_129 = 129);
IVERTEX_SHADER_TYPE=(
EVST_VS_1_1 = 0,
EVST_VS_2_0,
EVST_VS_2_a,
EVST_VS_3_0,
EVST_VS_4_0,
EVST_VS_4_1,
EVST_VS_5_0,
EVST_COUNT);
IPIXEL_SHADER_TYPE=(
EPST_PS_1_1 = 0,
EPST_PS_1_2,
EPST_PS_1_3,
EPST_PS_1_4,
EPST_PS_2_0,
EPST_PS_2_a,
EPST_PS_2_b,
EPST_PS_3_0,
EPST_PS_4_0,
EPST_PS_4_1,
EPST_PS_5_0,
EPST_COUNT);
IKEYCODE = (
KEY_LBUTTON = $01,
// Left mouse button
KEY_RBUTTON = $02,
// Right mouse button
KEY_CANCEL = $03,
// Control-break processing
KEY_MBUTTON = $04,
// Middle mouse button (three-button mouse)
KEY_XBUTTON1 = $05,
// Windows 2000/XP: X1 mouse button
KEY_XBUTTON2 = $06,
// Windows 2000/XP: X2 mouse button
KEY_BACK = $08,
// BACKSPACE key
KEY_TAB = $09,
// TAB key
KEY_CLEAR = $0C,
// CLEAR key
KEY_RETURN = $0D,
// ENTER key
KEY_SHIFT = $10,
// SHIFT key
KEY_CONTROL = $11,
// CTRL key
KEY_MENU = $12,
// ALT key
KEY_PAUSE = $13,
// PAUSE key
KEY_CAPITAL = $14,
// CAPS LOCK key
KEY_KANA = $15,
// IME Kana mode
KEY_HANGUEL = $15,
// IME Hanguel mode (maintained for compatibility use KEY_HANGUL)
KEY_HANGUL = $15,
// IME Hangul mode
KEY_JUNJA = $17,
// IME Junja mode
KEY_FINAL = $18,
// IME final mode
KEY_HANJA = $19,
// IME Hanja mode
KEY_KANJI = $19,
// IME Kanji mode
KEY_ESCAPE = $1B,
// ESC key
KEY_CONVERT = $1C,
// IME convert
KEY_NONCONVERT = $1D,
// IME nonconvert
KEY_ACCEPT = $1E,
// IME accept
KEY_MODECHANGE = $1F,
// IME mode change request
KEY_SPACE = $20,
// SPACEBAR
KEY_PRIOR = $21,
// PAGE UP key
KEY_NEXT = $22,
// PAGE DOWN key
KEY_END = $23,
// END key
KEY_HOME = $24,
// HOME key
KEY_LEFT = $25,
// LEFT ARROW key
KEY_UP = $26,
// UP ARROW key
KEY_RIGHT = $27,
// RIGHT ARROW key
KEY_DOWN = $28,
// DOWN ARROW key
KEY_SELECT = $29,
// SELECT key
KEY_PRINT = $2A,
// PRINT key
KEY_EXECUT = $2B,
// EXECUTE key
KEY_SNAPSHOT = $2C,
// PRINT SCREEN key
KEY_INSERT = $2D,
// INS key
KEY_DELETE = $2E,
// DEL key
KEY_HELP = $2F,
// HELP key
KEY_0 = $30,
// 0 key
KEY_1 = $31,
// 1 key
KEY_2 = $32,
// 2 key
KEY_3 = $33,
// 3 key
KEY_4 = $34,
// 4 key
KEY_5 = $35,
// 5 key
KEY_6 = $36,
// 6 key
KEY_7 = $37,
// 7 key
KEY_8 = $38,
// 8 key
KEY_9 = $39,
// 9 key
KEY_A = $41,
// A key
KEY_B = $42,
// B key
KEY_C = $43,
// C key
KEY_D = $44,
// D key
KEY_E = $45,
// E key
KEY_F = $46,
// F key
KEY_G = $47,
// G key
KEY_H = $48,
// H key
KEY_I = $49,
// I key
KEY_J = $4A,
// J key
KEY_K = $4B,
// K key
KEY_L = $4C,
// L key
KEY_M = $4D,
// M key
KEY_N = $4E,
// N key
KEY_O = $4F,
// O key
KEY_P = $50,
// P key
KEY_Q = $51,
// Q key
KEY_R = $52,
// R key
KEY_S = $53,
// S key
KEY_T = $54,
// T key
KEY_U = $55,
// U key
KEY_V = $56,
// V key
KEY_W = $57,
// W key
KEY_X = $58,
// X key
KEY_Y = $59,
// Y key
KEY_Z = $5A,
// Z key
KEY_LWIN = $5B,
// Left Windows key (Microsoft® Natural® keyboard)
KEY_RWIN = $5C,
// Right Windows key (Natural keyboard)
KEY_APPS = $5D,
// Applications key (Natural keyboard)
KEY_SLEEP = $5F,
// Computer Sleep key
KEY_NUMPAD0 = $60,
// Numeric keypad 0 key
KEY_NUMPAD1 = $61,
// Numeric keypad 1 key
KEY_NUMPAD2 = $62,
// Numeric keypad 2 key
KEY_NUMPAD3 = $63,
// Numeric keypad 3 key
KEY_NUMPAD4 = $64,
// Numeric keypad 4 key
KEY_NUMPAD5 = $65,
// Numeric keypad 5 key
KEY_NUMPAD6 = $66,
// Numeric keypad 6 key
KEY_NUMPAD7 = $67,
// Numeric keypad 7 key
KEY_NUMPAD8 = $68,
// Numeric keypad 8 key
KEY_NUMPAD9 = $69,
// Numeric keypad 9 key
KEY_MULTIPLY = $6A,
// Multiply key
KEY_ADD = $6B,
// Add key
KEY_SEPARATOR = $6C,
// Separator key
KEY_SUBTRACT = $6D,
// Subtract key
KEY_DECIMAL = $6E,
// Decimal key
KEY_DIVIDE = $6F,
// Divide key
KEY_F1 = $70,
// F1 key
KEY_F2 = $71,
// F2 key
KEY_F3 = $72,
// F3 key
KEY_F4 = $73,
// F4 key
KEY_F5 = $74,
// F5 key
KEY_F6 = $75,
// F6 key
KEY_F7 = $76,
// F7 key
KEY_F8 = $77,
// F8 key
KEY_F9 = $78,
// F9 key
KEY_F10 = $79,
// F10 key
KEY_F11 = $7A,
// F11 key
KEY_F12 = $7B,
// F12 key
KEY_F13 = $7C,
// F13 key
KEY_F14 = $7D,
// F14 key
KEY_F15 = $7E,
// F15 key
KEY_F16 = $7F,
// F16 key
KEY_F17 = $80,
// F17 key
KEY_F18 = $81,
// F18 key
KEY_F19 = $82,
// F19 key
KEY_F20 = $83,
// F20 key
KEY_F21 = $84,
// F21 key
KEY_F22 = $85,
// F22 key
KEY_F23 = $86,
// F23 key
KEY_F24 = $87,
// F24 key
KEY_NUMLOCK = $90,
// NUM LOCK key
KEY_SCROLL = $91,
// SCROLL LOCK key
KEY_LSHIFT = $A0,
// Left SHIFT key
KEY_RSHIFT = $A1,
// Right SHIFT key
KEY_LCONTROL = $A2,
// Left CONTROL key
KEY_RCONTROL = $A3,
// Right CONTROL key
KEY_LMENU = $A4,
// Left MENU key
KEY_RMENU = $A5,
// Right MENU key
KEY_PLUS = $BB,
// Plus Key (+)
KEY_COMMA = $BC,
// Comma Key (,)
KEY_MINUS = $BD,
// Minus Key (-)
KEY_PERIOD = $BE,
// Period Key (.)
KEY_ATTN = $F6,
// Attn key
KEY_CRSEL = $F7,
// CrSel key
KEY_EXSEL = $F8,
// ExSel key
KEY_EREOF = $F9,
// Erase EOF key
KEY_PLAY = $FA,
// Play key
KEY_ZOOM = $FB,
// Zoom key
KEY_PA1 = $FD,
// PA1 key
KEY_OEM_CLEAR = $FE,
// Clear key
KEY_CODES_COUNT = $FF
// this is not a key, but the amount of keycodes there are.
);
size2f=record
w,h:single;
end;
vector2d=record
x,y:single
end;
vector3d=record
x,y,z:single
end;
box3d=record
boxmin,boxmax:vector3d;
end;
triangle3d=record
a,b,c:vector3d;
end;
Ray3D=record
raybegin,rayend:vector3d;
end;
S3DVertex=record
Pos, Normal:vector3d;
Color:integer;
TCoords:vector2d;
end;
PMatrix4 = ^Matrix4;
Matrix4 = packed record
case integer of
0 : (_11, _12, _13, _14: Single;
_21, _22, _23, _24: Single;
_31, _32, _33, _34: Single;
_41, _42, _43, _44: Single);
1 : (m : array [0..3, 0..3] of Single);
end;
PParticle=^TParticle;
TParticle=record
pos,dir,acc:vector3d;
r,g,b,alpha:single;
userdata:integer;
size:size2f;
time:integer;
life:integer;
dead:boolean;
end;
const
DEBUGOFF =0;// No Debug Data ( Default )<br>
DEBUGBBOX =1;// Show Bounding Boxes of SceneNode<br>
DEBUGNORMALS =2;// Show Vertex Normals<br>
DEBUGSKELETON=3;// Shows Skeleton/Tags<br>
DEBUGMESH_WIRE_OVERLAY=4;// Overlays Mesh Wireframe<br>
DEBUGHALF_TRANSPARENCY=5;// Temporary use transparency Material Type<br>
DEBUGBBOX_BUFFERS=6; // Show Bounding Boxes of all MeshBuffers<br>
DEBUGBBOX_ALL = DEBUGBBOX or DEBUGBBOX_BUFFERS;
DEBUGFULL=7; // Show all debug infos.
//SYSTEM
function getDevice:IDevice;Cdecl external 'Core3D.dll';
procedure AppTitle(const t:pchar);Cdecl external 'Core3D.dll';
Function SupportGLSL:boolean;Cdecl external 'Core3D.dll';
Function SupportHardwareTL:boolean;Cdecl external 'Core3D.dll';
Function SupportStencilBuffer:boolean;Cdecl external 'Core3D.dll';
Function SupportMultiTexture:boolean;Cdecl external 'Core3D.dll';
Function SupportARB:boolean;Cdecl external 'Core3D.dll';
Function AvailableMemory:integer;Cdecl external 'Core3D.dll';
Function TotalMemory:integer;Cdecl external 'Core3D.dll';
Function VideoModeCount:integer;Cdecl external 'Core3D.dll';
Function VideoModeDepth:integer;Cdecl external 'Core3D.dll';
Function VideoModeResolutionWidth:integer;Cdecl external 'Core3D.dll';
Function VideoModeResolutionHeight :integer;Cdecl external 'Core3D.dll';
Function ProcessorSpeed:integer;Cdecl external 'Core3D.dll';
procedure BackGroundColor(r,g,b:integer);Cdecl external 'Core3D.dll';
procedure AmbientLight (r,g,b:integer);Cdecl external 'Core3D.dll';
procedure ShadowColor (r,g,b,a:integer);Cdecl external 'Core3D.dll';
procedure ScreenShot;Cdecl external 'Core3D.dll';
procedure TakeScreenShotEx(const filename:pchar);Cdecl external 'Core3D.dll';
procedure TakeScreenShot(const Path:pchar);Cdecl external 'Core3D.dll';
procedure InitEngine ( driver,w,h,bpp: Integer;vsync, Fullscreen :boolean);Cdecl external 'Core3D.dll';
procedure InitEngineEx(driver,handle:integer;w,h,bpp: Integer;vsync, Fullscreen :boolean);Cdecl external 'Core3D.dll';
//function EngineGlHDc:HDC;Cdecl external 'Core3D.dll';
Function EngineRun(var timedelta:single):boolean;Cdecl external 'Core3D.dll';
procedure UpdateEngine;Cdecl;external 'Core3D.dll';
procedure CloseEngine;Cdecl external 'Core3D.dll';
procedure EndEngine;Cdecl external 'Core3D.dll';
procedure FrameRateLimit(limit:integer);Cdecl external 'Core3D.dll';
procedure setFog(r,g,b:integer;Density:single);Cdecl external 'Core3D.dll';
procedure EnableAntialias;Cdecl external 'Core3D.dll';
procedure BeginScene;Cdecl external 'Core3D.dll';
procedure EndScene;Cdecl external 'Core3D.dll';
Function GetFps:single;Cdecl external 'Core3D.dll';
Function GetTrisRendered:integer;Cdecl external 'Core3D.dll';
Function LightCount:integer;Cdecl external 'Core3D.dll';
///****************OCCLISUION
procedure AddNodeToOcclusion(ent:INode);Cdecl external 'Core3D.dll';
procedure RunOcclusionQueries(visible:boolean=false);Cdecl external 'Core3D.dll';
procedure UpdateOcclusionQueries(block:boolean=true);Cdecl external 'Core3D.dll';
function GetOcclusionQuerieResult(ent:INode):dword;Cdecl external 'Core3D.dll';
procedure RemoveFromOcclusionQuerie(ent:INode);Cdecl external 'Core3D.dll';
procedure RemoveAllOcclusionQueries;Cdecl external 'Core3D.dll';
procedure Draw3DLine(linebegin,lineend:vector3d;color:integer);Cdecl external 'Core3D.dll';
procedure Draw3DBox(box:box3d;color:dword);Cdecl external 'Core3D.dll';
procedure Draw3DTriangle(triangle:triangle3d;color:dword;wire:boolean=true);Cdecl external 'Core3D.dll';
procedure Draw3DGrid(countx, county, Size:integer);Cdecl external 'Core3D.dll';
procedure Draw3DRect(Position:vector3d; Width, Deph:single);Cdecl external 'Core3D.dll';
procedure Draw3DCube(x,y,z,w,h,d:single; clr:dword);Cdecl external 'Core3D.dll';
PROCEDURE Draw3DSphere( radius ,x,y,z:single;clr:dword);Cdecl external 'Core3D.dll';
procedure DrawRayQuad(tex:ITexture; flScale:single;vStart,vEnd,vUp:vector3d; beamColor:integer;MaterialType:TMATERIALTYPE);Cdecl external 'Core3D.dll';
procedure Draw3DBillBoard(texture:ITexture;pos:vector3d; color:integer; Width,Height:single;MaterialType:TMATERIALTYPE);Cdecl external 'Core3D.dll';
//SCENE
procedure BuilSceneNodeList;Cdecl external 'Core3D.dll';
function GetSceneNodeTotal:integer;Cdecl external 'Core3D.dll';
function GetSceneNodeFromIndex(index:integer):INODE;Cdecl external 'Core3D.dll';
function GetSceneNodeFromName( name:pchar ):INODE;Cdecl external 'Core3D.dll';
function GetSceneNodeFromId(id:integer):INODE;Cdecl external 'Core3D.dll';
procedure ChangeDirectory(const directory:pchar);Cdecl external 'Core3D.dll';
function ExistFile(const ffile:pchar):boolean;Cdecl external 'Core3D.dll';
procedure LoadZip(const ffile:pchar);Cdecl external 'Core3D.dll';
procedure LoadScene( const ffile:pchar );Cdecl external 'Core3D.dll';
procedure SaveScene( const ffile:pchar );Cdecl external 'Core3D.dll';
//BOLT
function CreateBolt(texture:pchar; startx, starty, startz,
endx, endy, endz:single;
updateTime, height, parts, bolts:dword;
steddyend:boolean;thick:single;col:dword):INode;Cdecl external 'Core3D.dll';
procedure BoltRay( bolt:INode; startx, starty, startz,
endx, endy, endz:single;thick:single);Cdecl external 'Core3D.dll';
procedure BoltRayEx( bolt:INode; startx, starty, startz,
endx, endy, endz:single;
updateTime, height, parts, bolts:dword;
steddyend:boolean;thick:single;col:dword);Cdecl external 'Core3D.dll';
//BEAM
function CreateBeam( szBeam , szBeamFront:pchar;startx, starty, startz,endx, endy, endz:single;thick:single):INode;Cdecl external 'Core3D.dll';
procedure BeamRay(Beam:INode; bolt:INode; startx, starty, startz,
endx, endy, endz:single;thick:single);Cdecl external 'Core3D.dll';
//RIBBONTRAIL
function CreateTrail(maxquads:integer=10; maxdist:Single=3):INode;Cdecl external 'Core3D.dll';
procedure TrailColor(trail:INode;r,g,b,a:single);Cdecl external 'Core3D.dll';
procedure TrailPoint1(trail:INode;x,y,z:single);Cdecl external 'Core3D.dll';
procedure TrailRay(trail:INode;x,y,z,dx,dy,dz:single);Cdecl external 'Core3D.dll';
procedure TrailPoint2(trail:INode;x,y,z:single);Cdecl external 'Core3D.dll';
procedure TrailMaxDistance(trail:INode;value:single);Cdecl external 'Core3D.dll';
procedure TrailAlphaBegin(trail:INode;value:single);Cdecl external 'Core3D.dll';
//DECAL
function CreateDecalNode(tri:triangle3d;intersection:vector3d):INode;Cdecl external 'Core3D.dll';
function CreateDecalNodeEx(trinormal,intersection:vector3d):INode;Cdecl external 'Core3D.dll';
//SKYDOMECOLORS
function CreateSkyDomeColor (texture_file:ITexture;horiRes,vertRes:integer;texturePercentage,spherePercentage,domeRadius :single):INode;Cdecl external 'Core3D.dll';
procedure SkyDomeColor (dome:INode;HorizonColor,ZenithColor:dword);Cdecl external 'Core3D.dll';
procedure SkyDomeColorBand (dome:INode;color:dword;position:integer;fade:single;addative:boolean);Cdecl external 'Core3D.dll';
procedure SkyDomeColorPoint(dome:INode;color:dword;positionX, positionY, positionZ,radius, fade:single;addative:boolean);Cdecl external 'Core3D.dll';
//GRAPHICS
procedure SetZWriteTrasparentScene(bol:boolean);Cdecl external 'Core3D.dll';
procedure Transparency(Level :integer);Cdecl external 'Core3D.dll';
procedure Colors (Red , Green ,Blue :Integer);Cdecl external 'Core3D.dll';
procedure Line2D (x1,y1,x2,y2:integer);Cdecl external 'Core3D.dll';
procedure Line3D (x1,y1,z1,x2,y2,z2,hickness :single; Alpha,Red, Green,Blue:Integer);Cdecl external 'Core3D.dll';
procedure Rect2D (x,y:integer; widht ,height : Integer);Cdecl external 'Core3D.dll';
procedure Pixel (x,y:integer);Cdecl external 'Core3D.dll';
procedure Image (texture:ITEXTURE;x,y:integer);Cdecl external 'Core3D.dll';
procedure Oval (x,y:integer;Radius :single);Cdecl external 'Core3D.dll';
procedure ImageSprites2D (texture:ITEXTURE;x,y,tx,ty, BX,BY :Integer);Cdecl external 'Core3D.dll';
procedure ImageClip(text:ITexture;dest_sx, dest_sy, dest_ex, dest_ey,
src_sx, src_sy, src_ex, src_ey:integer;
color:dword=$FFFFFFFF;useAlphaChannelOfTexture:boolean=true );Cdecl external 'Core3D.dll';
procedure ImageSrc(text:ITexture;dest_sx, dest_sy,
src_sx, src_sy, src_ex, src_ey:integer;
color:dword=$FFFFFFFF; useAlphaChannelOfTexture:boolean=true );Cdecl external 'Core3D.dll';
procedure BlendTextures(texturedest,texturesrc:ITexture; xoffset,yoffset, operation:integer);Cdecl external 'Core3D.dll';
//INPUT
Function KeyDown(keystate : IKEYCODE):boolean;Cdecl external 'Core3D.dll';
Function KeyHit(keystate : IKEYCODE):boolean;Cdecl external 'Core3D.dll';
Function MouseHit(keystate : Integer):boolean;Cdecl external 'Core3D.dll';
Function MouseDown(keystate : Integer):boolean;Cdecl external 'Core3D.dll';
procedure MoveMouse(var x,y:integer);Cdecl external 'Core3D.dll';
Function MouseWheel:integer;Cdecl external 'Core3D.dll';
Function MouseX:integer;Cdecl external 'Core3D.dll';
Function MouseY:integer;Cdecl external 'Core3D.dll';
procedure ShowMouse;Cdecl external 'Core3D.dll';
procedure HideMouse;Cdecl external 'Core3D.dll';
//********************************************************************
// OIS INPUT
//********************************************************************
function InputUpdate:boolean;cdecl ;external'Core3D.dll';
function InputKeyDown(key:integer):boolean;cdecl ;external'Core3D.dll';
function InputMouseDown(but:integer):boolean;cdecl ;external'Core3D.dll';
function InputMouseX:integer;cdecl ;external'Core3D.dll';
function InputMouseY:integer;cdecl ;external'Core3D.dll';
function InputMouseZ:integer;cdecl ;external'Core3D.dll';
function InputMouseXAbs:integer;cdecl ;external'Core3D.dll';
function InputMouseYAbs:integer;cdecl ;external'Core3D.dll';
function InputMouseZAbs:integer;cdecl ;external'Core3D.dll';
//TEXT
Function LoadFont(filename:pchar):IFONT;Cdecl external 'Core3D.dll';
function FontSystem:IFONT;Cdecl external 'Core3D.dll';
procedure Font( Font:IFONT);Cdecl external 'Core3D.dll';
procedure Text(x, y:integer;txt:pchar;cenx :Integer = 0;ceny :Integer = 0);Cdecl external 'Core3D.dll';
//CAMERA
Function CreateCamera:ICAMERA;Cdecl external 'Core3D.dll';
Function CreateCameraFPS(rotspeed,movespeed:single):ICAMERA;Cdecl external 'Core3D.dll';
Function CreateCameraMaya(rots ,zoos ,movs :single):ICAMERA;Cdecl external 'Core3D.dll';
Function CreateCameraIsometric(Width ,height,fnear,ffar : Single):ICAMERA;Cdecl external 'Core3D.dll';
procedure ActiveCamera ( camera :ICAMERA);Cdecl external 'Core3D.dll';
procedure CameraFOV ( camera :ICAMERA; ratio :Single);Cdecl external 'Core3D.dll';
procedure CameraRange( camera :ICAMERA; fnear ,ffar :Single);Cdecl external 'Core3D.dll';
procedure CameraTarget( camera :ICAMERA;tx,ty,tz:single);Cdecl external 'Core3D.dll';
function GetCameraTarget( camera :ICAMERA):vector3d;Cdecl external 'Core3D.dll';
procedure CameraViewPort( width,height :integer);Cdecl external 'Core3D.dll';
procedure SetCameraViewPort( x,y,width,height :integer);Cdecl external 'Core3D.dll';
procedure CameraAspectRatio( camera:ICAMERA; aspect:single);Cdecl external 'Core3D.dll';
Function TargetX ( camera :ICAMERA): single;Cdecl external 'Core3D.dll';
Function TargetY ( camera :ICAMERA): Single;Cdecl external 'Core3D.dll';
Function TargetZ ( camera :ICAMERA): single;Cdecl external 'Core3D.dll';
Function ViewPortWidth:integer;Cdecl external 'Core3D.dll';
Function ViewPortHeight:integer;Cdecl external 'Core3D.dll';
procedure MoveCamera (camera:ICamera;yaw, pitch, roll,drive, strafe, elevate:single);Cdecl external 'Core3D.dll';
procedure CameraYaw(Camera:ICamera;value:single);Cdecl external 'Core3D.dll';
procedure PitchCamera(Camera:ICamera;value:single);Cdecl external 'Core3D.dll';
procedure AdvanceCamera(Camera:ICamera;value:single);Cdecl external 'Core3D.dll';
procedure UpCamera(Camera:ICamera;value:single);Cdecl external 'Core3D.dll';
procedure StrafeCamera(Camera:ICamera;value:single);Cdecl external 'Core3D.dll';
procedure CameraUpAtRightAngle (Camera:ICamera);Cdecl external 'Core3D.dll';
procedure CameraOrientation(camera:ICamera;vUp,vForward,vRight:vector3d);Cdecl external 'Core3D.dll';
procedure TargetAndRotationCamera(camera:ICamera;flag:boolean);Cdecl external 'Core3D.dll';
procedure CameraPitchYawRoll(Node : INode;pitch, yaw, roll:single);Cdecl external 'Core3D.dll';
procedure CameraAddPitchYawRoll(Node : INode;pitch, yaw, roll:single);Cdecl external 'Core3D.dll';
procedure SetCamera(cam:ICamera;pos,lookAt:vector3d);Cdecl external 'Core3D.dll';
procedure SetCameraEx(cam:ICamera; x,y, z,lx,ly,lz:single);Cdecl external 'Core3D.dll';
procedure CameraCockpitFollowing(camera:ICamera; Target:INode;offset:vector3d);Cdecl external 'Core3D.dll';
procedure CameraAbsCockpitFollowing(camera:ICamera; Target:INode;offset:vector3d);Cdecl external 'Core3D.dll';
procedure CameraFollowing(Camera:ICamera;Target:INode;speed, Distance, AltitudeCamera, pitch,yaw:single);Cdecl external 'Core3D.dll';
procedure SetThirdPersonCam(Camera:ICamera;Target:INode; mouseWheelDiff, cameraZoomSpeed, deltaTime:single);Cdecl external 'Core3D.dll';
//'Fader
procedure FadeIn( time:Integer);Cdecl external 'Core3D.dll';
procedure FadeOut( time:Integer);Cdecl external 'Core3D.dll';
procedure FaderColor(r,g,b:Integer);Cdecl external 'Core3D.dll';
Function FadeIsReady:boolean;Cdecl external 'Core3D.dll';
//directparticles
function CreateEmitter:IEmitter;Cdecl external 'Core3D.dll';
procedure ClearEmitter(mit:IEmitter);Cdecl external 'Core3D.dll';
function CountEmitterParticles(mit:IEmitter):integer;Cdecl external 'Core3D.dll';
function GetEmitterParticle(mit:IEmitter;index:integer):TParticle;Cdecl external 'Core3D.dll';
procedure GetEmitterParticleEx(mit:IEmitter;index:integer;par:PParticle);Cdecl external 'Core3D.dll';
procedure SetEmitterParticle(mit:IEmitter;index:integer;p:TParticle);Cdecl external 'Core3D.dll';
procedure AddParticlesToEmitter(mit:IEmitter;count:integer);Cdecl external 'Core3D.dll';
function AddParticleToEmitter(mit:IEmitter;par:TParticle):integer;Cdecl external 'Core3D.dll';
procedure AddEmitterParticlesBuffer(mit:IEmitter;par:PParticle;count:integer);Cdecl external 'Core3D.dll';
function GetEmitterParticleDirection(mit:IEmitter;index:integer):vector3d;Cdecl external 'Core3D.dll';
procedure SetEmitterParticleDirection(mit:IEmitter;index:integer;v:vector3d);Cdecl external 'Core3D.dll';
function GetEmitterParticlePosition(mit:IEmitter;index:integer):vector3d;Cdecl external 'Core3D.dll';
procedure SetEmitterParticlePosition(mit:IEmitter;index:integer;v:vector3d);Cdecl external 'Core3D.dll';
function GetEmitterParticleAcceleration(mit:IEmitter;index:integer):vector3d;Cdecl external 'Core3D.dll';
procedure SetEmitterParticleAcceleration(mit:IEmitter;index:integer;v:vector3d);Cdecl external 'Core3D.dll';
procedure SetEmitterParticleSize(mit:IEmitter;index:integer;w,h:single);Cdecl external 'Core3D.dll';
function GetEmitterParticleSize(mit:IEmitter;index:integer):size2f;Cdecl external 'Core3D.dll';
procedure SetEmitterParticleColor(mit:IEmitter;index:integer; r,g,b:single);Cdecl external 'Core3D.dll';
procedure SetEmitterParticleAlpha(mit:IEmitter;index:integer;alplha:single);Cdecl external 'Core3D.dll';
function GetEmitterParticleRed(mit:IEmitter;index:integer):single;Cdecl external 'Core3D.dll';
function GetEmitterParticleGreen(mit:IEmitter;index:integer):single;Cdecl external 'Core3D.dll';
function GetEmitterParticleBlue(mit:IEmitter;index:integer):single;Cdecl external 'Core3D.dll';
function GetEmitterParticleAlpha(mit:IEmitter;index:integer):single;Cdecl external 'Core3D.dll';
procedure SetEmitterParticleLife(mit:IEmitter;index:integer;life:single);Cdecl external 'Core3D.dll';
function GetEmitterParticleLife(mit:IEmitter;index:integer):single;Cdecl external 'Core3D.dll';
//mesh
Function CreatePivot:INode;Cdecl external 'Core3D.dll';
Function CreateMeshCube:INode;Cdecl external 'Core3D.dll';
Function CreateMeshSphere(polycount:integer):INode;Cdecl external 'Core3D.dll';
Function CreateMeshCylinder(polycount :Integer):INode;Cdecl external 'Core3D.dll';
Function CreateMeshCone(polycount :Integer):INode;Cdecl external 'Core3D.dll';
Function CreateMeshPlane( size:Single; tileCount :integer):INode;Cdecl external 'Core3D.dll';
function CreateMeshPlaneHill( w, h:single;tileCount:integer; u, v:single):INode;Cdecl external 'Core3D.dll';
Function CreateMeshWater(height,speed, length :single):INode;Cdecl external 'Core3D.dll';
function CreateMeshWaterEx( w,h:single; tileCount:integer; u, v, Height, Speed, Length:single):INode;Cdecl external 'Core3D.dll';
function GetMesh(filename:pchar):Imesh;Cdecl external 'Core3D.dll';
function StripMesh(mesh:Imesh;index:integer):INode;Cdecl external 'Core3D.dll';
Function LoadMesh (filename:pchar; toTangents :boolean=false):INode;Cdecl external 'Core3D.dll';
function DrawNodeTriangles( Node:Inode;MeshBuffer:integer;color:integer;wire:boolean):boolean;Cdecl external 'Core3D.dll';
procedure NodeCastShadow (mesh:INode);Cdecl external 'Core3D.dll';
procedure OutlineMesh( mesh:INode;thickness :single;r,g,b:integer);Cdecl external 'Core3D.dll';
Function MeshesCollide ( mesh1,esh2 :INode):boolean;Cdecl external 'Core3D.dll';
Function VertexCount ( mesh :INode):integer;Cdecl external 'Core3D.dll';
Function CurrentFrame ( mesh :INode):integer;Cdecl external 'Core3D.dll';
procedure AnimateLoop(mesh:INode;looped:boolean);Cdecl external 'Core3D.dll';
procedure AnimateSpeed(mesh:INode;speed:single);Cdecl external 'Core3D.dll';
function CurrentFrameSpeed( mesh :INode):single;Cdecl external 'Core3D.dll';
procedure AnimateTransitionTime(mesh:INode;time:single);Cdecl external 'Core3D.dll';
procedure AnimateFrameLoop(mesh:INode;framebegin,frameend:integer);Cdecl external 'Core3D.dll';
procedure AnimateFrame(mesh:INode;frame:single);Cdecl external 'Core3D.dll';
procedure AnimateNode(mesh:INode; speed:single;framebegin,frameend:integer; loop:boolean=false);Cdecl external 'Core3D.dll';
procedure SetMd2Animation(mesh:INode; name:pchar);Cdecl external 'Core3D.dll';
procedure SetMd2AnimationIndex(mesh:INode; layer:integer);Cdecl external 'Core3D.dll';
//BUFERS
function GetNodeAllIndicesCount (mesh:INode):integer;Cdecl external 'Core3D.dll';
function GetNodeAllVertexCount (mesh:INode):integer;Cdecl external 'Core3D.dll';
function GetAllNodeVertices(mesh:INode;vertex:pointer):boolean;Cdecl external 'Core3D.dll';
function GetAllNodeIndices(mesh:INode;indices:pointer):boolean;Cdecl external 'Core3D.dll';
function GetNodeBufferCount(mesh:INode;frame:integer):integer;Cdecl external 'Core3D.dll';
function GetNodeIndices (mesh:INode;Frame:integer;indicies:pointer;MeshBuffer:integer):boolean;Cdecl external 'Core3D.dll';
function GetNodeIndicesCount(mesh:INode;Frame,MeshBuffer:integer ):integer;Cdecl external 'Core3D.dll';
function GetNodeVertexCount(mesh:INode;Frame,MeshBuffer:integer ):integer;Cdecl external 'Core3D.dll';
function GetNodeVertices(mesh:INode;Frame:integer;vertices:pointer;MeshBuffer:integer):boolean;Cdecl external 'Core3D.dll';
//TRASFORMBUFFERS
procedure PlanarTextureMappingNodeSurfaces(Node:INode; v:single);Cdecl external 'Core3D.dll';
//SURFACE
function CreateSurface:ISurface;Cdecl external 'Core3D.dll';
procedure SurfaceDrop (surface:ISurface);Cdecl external 'Core3D.dll';
procedure PaintSurface (surface:ISurface;brush:IMaterial);Cdecl external 'Core3D.dll';
function AddVertex (surface:ISurface;x,y,z:single; u:single=0.0;v:single=0.0):integer;Cdecl external 'Core3D.dll';
function AddTriangle (surface:ISurface;v1,v2,v3:integer):integer;Cdecl external 'Core3D.dll';
procedure VertexCoords(surface:ISurface;index:integer;x,y,z:single);Cdecl external 'Core3D.dll';
procedure VertexNormal(surface:ISurface;index:integer;x,y,z:single);Cdecl external 'Core3D.dll';
procedure VertexColor (surface:ISurface;index:integer;r,g,b,a:integer);Cdecl external 'Core3D.dll';
procedure VertexTexCoords (surface:ISurface;index:integer;u,v:single;coord_set:integer=0);Cdecl external 'Core3D.dll';
procedure VertexTexCoords2 (surface:ISurface; index:integer;u,v,u2,v2:single);Cdecl external 'Core3D.dll';
//BRUSHMATERIAL
function CreateBrush (r,g,b,a:integer):IMaterial;Cdecl external 'Core3D.dll';
procedure BrushDrop (brush:IMaterial);Cdecl external 'Core3D.dll';
function LoadBrush (layer:integer;const filename:pchar):IMaterial;Cdecl external 'Core3D.dll';
procedure BrushType (brush:IMaterial;newType:TMATERIALTYPE);Cdecl external 'Core3D.dll';
procedure BrushAlphaRef (brush:IMaterial; value:single);Cdecl external 'Core3D.dll';
procedure BrushFlag (brush:IMaterial;flag:integer; value:boolean);Cdecl external 'Core3D.dll';
procedure BrushTexture (brush:IMaterial; layer:integer;tex:ITexture);Cdecl external 'Core3D.dll';
//MESHBUFFER
function LoadMeshBuffer(fname:pchar;withTangents:boolean):Imesh;Cdecl external 'Core3D.dll';
function LoadStaticMeshBuffer(fname:pchar;withTangents:boolean):Imesh;Cdecl external 'Core3D.dll';
function CreateNodeFromAnimatedMesh(IAnimatedMesh:IMesh):INode;Cdecl external 'Core3D.dll';
function CreateNodeFromStaticMesh(IMesh:IMesh):INode;Cdecl external 'Core3D.dll';
procedure RotateMeshSurfaces(mesh:IMesh;pitch, yaw, roll:single);Cdecl external 'Core3D.dll';
procedure ScaleMeshSurfaces(mesh:IMesh;x,y,z:single);Cdecl external 'Core3D.dll';
//MESH
function MeshType(mesh:INode):TMeshTYPE;Cdecl external 'Core3D.dll';
function CreateMesh:Imesh;Cdecl external 'Core3D.dll';
procedure FreeMesh(Mesh:IMesh);Cdecl external 'Core3D.dll';
procedure AddSurfaceToMesh(Mesh:Imesh;surface:ISurface);Cdecl external 'Core3D.dll';
function CreateNodeFromMesh(Mesh:Imesh):INode;Cdecl external 'Core3D.dll';
//BSP MAP
function LoadQuakeMap(var OutMesh:Imesh;mapname:pchar;minimalPolysPerNode:integer=128):INode;Cdecl external 'Core3D.dll';
function LoadQuakeMesh(mapname:pchar):Imesh;Cdecl external 'Core3D.dll';
//DIRECTDRAW
procedure SetDefaultTransform( pos,rot,scale:vector3d);Cdecl external 'Core3D.dll';
procedure MaterialRenderDefaults(ligth:boolean;ZWriteEnable:boolean;BackfaceCulling:boolean;FogEnable:boolean);Cdecl external 'Core3D.dll';
procedure MaterialRenderTexture(tex:ITexture; value:integer);Cdecl external 'Core3D.dll';
procedure MaterialRenderFlag(flag:integer; value:boolean);Cdecl external 'Core3D.dll';
procedure MaterialRenderType(MaterialType:TMATERIALTYPE);Cdecl external 'Core3D.dll';
procedure SetMaterialToRender;Cdecl external 'Core3D.dll';
procedure DrawIndexedTriangleList(vertices:pointer; vertexCount:integer; indexList:pointer;triangleCount:integer);Cdecl external 'Core3D.dll';
procedure Draw2DVertexPrimitiveList(vertices:pointer; vertexCount:integer; indexList:pointer;primitiveCount:integer;pType:TPRIMITIVETYPE);Cdecl external 'Core3D.dll';
procedure DrawVertexPrimitiveList(vertices:pointer; vertexCount:integer; indexList:pointer;primitiveCount:integer;pType:TPRIMITIVETYPE);Cdecl external 'Core3D.dll';
function makeVextex(x,y,z:single;nx,ny,nz:single;u,v:single;color:dword):S3DVertex;