This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raylib.cpp
6256 lines (5590 loc) · 241 KB
/
raylib.cpp
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
#include <phpcpp.h>
#include <raylib.h>
#include <raymath.h>
#define PHYSAC_IMPLEMENTATION
#define PHYSAC_NO_THREADS
#include <physac.h>
#define RLIGHTS_IMPLEMENTATION
#include "./rlights.h"
using namespace std;
namespace rl {
template <typename T>
class ScalarArray : public Php::Base,
public Php::ArrayAccess,
public Php::Countable {
public:
T *data;
int item_count;
ScalarArray(T *_data) {
data = _data;
item_count = -1;
}
ScalarArray(T *_data, int _count) {
data = _data;
item_count = _count;
}
Php::Value getArray() {
std::vector<Php::Value> result;
for (int i = 0; i < item_count; i++) {
result.push_back(Php::Value(data[i]));
}
return result;
}
virtual bool offsetExists(const Php::Value &key) override {
return key.isNumeric() &&
(item_count == -1 || item_count > key.isNumeric());
}
virtual void offsetSet(const Php::Value &key,
const Php::Value &value) override {
data[key.numericValue()] = (T)(value.floatValue());
}
virtual Php::Value offsetGet(const Php::Value &key) override {
return (T)data[key.numericValue()];
}
virtual void offsetUnset(const Php::Value &key) override { return; }
virtual long count() override { return item_count; }
};
template <typename T, typename U>
class StructArray : public Php::Base,
public Php::ArrayAccess,
public Php::Countable {
public:
T *data;
int item_count;
string name;
StructArray(string _name, T *_data) {
name = _name;
data = _data;
item_count = -1;
}
StructArray(string _name, T *_data, int _count) {
name = _name;
data = _data;
item_count = _count;
}
Php::Value getArray() {
std::vector<Php::Value> result;
for (int i = 0; i < item_count; i++) {
result.push_back(Php::Object(name.c_str(), new U(data[i])));
}
return result;
}
virtual bool offsetExists(const Php::Value &key) override {
return key.isNumeric() &&
(item_count == -1 || item_count > key.isNumeric());
}
virtual void offsetSet(const Php::Value &key,
const Php::Value &value) override {
data[key.numericValue()] = ((U *)value.implementation())->data;
}
virtual Php::Value offsetGet(const Php::Value &key) override {
return Php::Object(name.c_str(), new U(data[key]));
}
virtual void offsetUnset(const Php::Value &key) override { return; }
virtual long count() override { return item_count; }
};
class Vector2 : public Php::Base {
public:
::Vector2 data;
void __destruct() const {}
Vector2(::Vector2 x) { data = x; }
Php::Value getx() {
double result = data.x;
return result;
}
Php::Value gety() {
double result = data.y;
return result;
}
void setx(const Php::Value &v) { data.x = (double)v; }
void sety(const Php::Value &v) { data.y = (double)v; }
};
class Vector3 : public Php::Base {
public:
::Vector3 data;
void __destruct() const {}
Vector3(::Vector3 x) { data = x; }
Php::Value getx() {
double result = data.x;
return result;
}
Php::Value gety() {
double result = data.y;
return result;
}
Php::Value getz() {
double result = data.z;
return result;
}
void setx(const Php::Value &v) { data.x = (double)v; }
void sety(const Php::Value &v) { data.y = (double)v; }
void setz(const Php::Value &v) { data.z = (double)v; }
};
class Vector4 : public Php::Base {
public:
::Vector4 data;
void __destruct() const {}
Vector4(::Vector4 x) { data = x; }
Php::Value getx() {
double result = data.x;
return result;
}
Php::Value gety() {
double result = data.y;
return result;
}
Php::Value getz() {
double result = data.z;
return result;
}
Php::Value getw() {
double result = data.w;
return result;
}
void setx(const Php::Value &v) { data.x = (double)v; }
void sety(const Php::Value &v) { data.y = (double)v; }
void setz(const Php::Value &v) { data.z = (double)v; }
void setw(const Php::Value &v) { data.w = (double)v; }
};
class Matrix : public Php::Base {
public:
::Matrix data;
void __destruct() const {}
Matrix(::Matrix x) { data = x; }
Php::Value getm0() {
double result = data.m0;
return result;
}
Php::Value getm4() {
double result = data.m4;
return result;
}
Php::Value getm8() {
double result = data.m8;
return result;
}
Php::Value getm12() {
double result = data.m12;
return result;
}
Php::Value getm1() {
double result = data.m1;
return result;
}
Php::Value getm5() {
double result = data.m5;
return result;
}
Php::Value getm9() {
double result = data.m9;
return result;
}
Php::Value getm13() {
double result = data.m13;
return result;
}
Php::Value getm2() {
double result = data.m2;
return result;
}
Php::Value getm6() {
double result = data.m6;
return result;
}
Php::Value getm10() {
double result = data.m10;
return result;
}
Php::Value getm14() {
double result = data.m14;
return result;
}
Php::Value getm3() {
double result = data.m3;
return result;
}
Php::Value getm7() {
double result = data.m7;
return result;
}
Php::Value getm11() {
double result = data.m11;
return result;
}
Php::Value getm15() {
double result = data.m15;
return result;
}
void setm0(const Php::Value &v) { data.m0 = (double)v; }
void setm4(const Php::Value &v) { data.m4 = (double)v; }
void setm8(const Php::Value &v) { data.m8 = (double)v; }
void setm12(const Php::Value &v) { data.m12 = (double)v; }
void setm1(const Php::Value &v) { data.m1 = (double)v; }
void setm5(const Php::Value &v) { data.m5 = (double)v; }
void setm9(const Php::Value &v) { data.m9 = (double)v; }
void setm13(const Php::Value &v) { data.m13 = (double)v; }
void setm2(const Php::Value &v) { data.m2 = (double)v; }
void setm6(const Php::Value &v) { data.m6 = (double)v; }
void setm10(const Php::Value &v) { data.m10 = (double)v; }
void setm14(const Php::Value &v) { data.m14 = (double)v; }
void setm3(const Php::Value &v) { data.m3 = (double)v; }
void setm7(const Php::Value &v) { data.m7 = (double)v; }
void setm11(const Php::Value &v) { data.m11 = (double)v; }
void setm15(const Php::Value &v) { data.m15 = (double)v; }
};
class Color : public Php::Base {
public:
::Color data;
void __destruct() const {}
Color(::Color x) { data = x; }
Php::Value getr() {
int result = data.r;
return result;
}
Php::Value getg() {
int result = data.g;
return result;
}
Php::Value getb() {
int result = data.b;
return result;
}
Php::Value geta() {
int result = data.a;
return result;
}
void setr(const Php::Value &v) { data.r = (int)v; }
void setg(const Php::Value &v) { data.g = (int)v; }
void setb(const Php::Value &v) { data.b = (int)v; }
void seta(const Php::Value &v) { data.a = (int)v; }
};
class Rectangle : public Php::Base {
public:
::Rectangle data;
void __destruct() const {}
Rectangle(::Rectangle x) { data = x; }
Php::Value getx() {
double result = data.x;
return result;
}
Php::Value gety() {
double result = data.y;
return result;
}
Php::Value getwidth() {
double result = data.width;
return result;
}
Php::Value getheight() {
double result = data.height;
return result;
}
void setx(const Php::Value &v) { data.x = (double)v; }
void sety(const Php::Value &v) { data.y = (double)v; }
void setwidth(const Php::Value &v) { data.width = (double)v; }
void setheight(const Php::Value &v) { data.height = (double)v; }
};
class Image : public Php::Base {
public:
::Image data;
void __destruct() const {}
Image(::Image x) { data = x; }
Php::Value getdata() {
void *result = data.data;
return static_cast<std::string *>(result);
}
Php::Value getwidth() {
int result = data.width;
return result;
}
Php::Value getheight() {
int result = data.height;
return result;
}
Php::Value getmipmaps() {
int result = data.mipmaps;
return result;
}
Php::Value getformat() {
int result = data.format;
return result;
}
void setwidth(const Php::Value &v) { data.width = (int)v; }
void setheight(const Php::Value &v) { data.height = (int)v; }
void setmipmaps(const Php::Value &v) { data.mipmaps = (int)v; }
void setformat(const Php::Value &v) { data.format = (int)v; }
void setdata(const Php::Value &v) {
data.data = (void *)v.stringValue().data();
}
};
class Texture2D : public Php::Base {
public:
::Texture2D data;
void __destruct() const {}
Texture2D(::Texture2D x) { data = x; }
Php::Value getid() {
long result = data.id;
return result;
}
Php::Value getwidth() {
int result = data.width;
return result;
}
Php::Value getheight() {
int result = data.height;
return result;
}
Php::Value getmipmaps() {
int result = data.mipmaps;
return result;
}
Php::Value getformat() {
int result = data.format;
return result;
}
void setid(const Php::Value &v) { data.id = (long)v; }
void setwidth(const Php::Value &v) { data.width = (int)v; }
void setheight(const Php::Value &v) { data.height = (int)v; }
void setmipmaps(const Php::Value &v) { data.mipmaps = (int)v; }
void setformat(const Php::Value &v) { data.format = (int)v; }
};
class RenderTexture2D : public Php::Base {
public:
::RenderTexture2D data;
void __destruct() const {}
RenderTexture2D(::RenderTexture2D x) { data = x; }
Php::Value getid() {
long result = data.id;
return result;
}
Php::Value gettexture() {
Php::Value result =
Php::Object("RayLib\\Texture2D", new Texture2D(data.texture));
return result;
}
Php::Value getdepth() {
Php::Value result =
Php::Object("RayLib\\Texture2D", new Texture2D(data.depth));
return result;
}
void setid(const Php::Value &v) { data.id = (long)v; }
void settexture(const Php::Value &v) {
data.texture = ((Texture2D *)(v.implementation()))->data;
}
void setdepth(const Php::Value &v) {
data.depth = ((Texture2D *)(v.implementation()))->data;
}
};
class NPatchInfo : public Php::Base {
public:
::NPatchInfo data;
void __destruct() const {}
NPatchInfo(::NPatchInfo x) { data = x; }
Php::Value getleft() {
int result = data.left;
return result;
}
Php::Value gettop() {
int result = data.top;
return result;
}
Php::Value getright() {
int result = data.right;
return result;
}
Php::Value getbottom() {
int result = data.bottom;
return result;
}
Php::Value gettype() {
int result = data.type;
return result;
}
void setleft(const Php::Value &v) { data.left = (int)v; }
void settop(const Php::Value &v) { data.top = (int)v; }
void setright(const Php::Value &v) { data.right = (int)v; }
void setbottom(const Php::Value &v) { data.bottom = (int)v; }
void settype(const Php::Value &v) { data.type = (int)v; }
};
class CharInfo : public Php::Base {
public:
::CharInfo data;
void __destruct() const {}
CharInfo(::CharInfo x) { data = x; }
Php::Value getvalue() {
int result = data.value;
return result;
}
Php::Value getoffsetX() {
int result = data.offsetX;
return result;
}
Php::Value getoffsetY() {
int result = data.offsetY;
return result;
}
Php::Value getadvanceX() {
int result = data.advanceX;
return result;
}
Php::Value getimage() {
Php::Value result = Php::Object("RayLib\\Image", new Image(data.image));
return result;
}
void setvalue(const Php::Value &v) { data.value = (int)v; }
void setoffsetX(const Php::Value &v) { data.offsetX = (int)v; }
void setoffsetY(const Php::Value &v) { data.offsetY = (int)v; }
void setadvanceX(const Php::Value &v) { data.advanceX = (int)v; }
void setimage(const Php::Value &v) {
data.image = ((Image *)(v.implementation()))->data;
}
};
class Font : public Php::Base {
public:
::Font data;
void __destruct() const {}
Font(::Font x) { data = x; }
Php::Value getbaseSize() {
int result = data.baseSize;
return result;
}
Php::Value getcharsCount() {
int result = data.charsCount;
return result;
}
Php::Value gettexture() {
Php::Value result =
Php::Object("RayLib\\Texture2D", new Texture2D(data.texture));
return result;
}
void setbaseSize(const Php::Value &v) { data.baseSize = (int)v; }
void setcharsCount(const Php::Value &v) { data.charsCount = (int)v; }
void settexture(const Php::Value &v) {
data.texture = ((Texture2D *)(v.implementation()))->data;
}
};
class Camera3D : public Php::Base {
public:
::Camera3D data;
void __destruct() const {}
Camera3D(::Camera3D x) { data = x; }
Php::Value getposition() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.position));
return result;
}
Php::Value gettarget() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.target));
return result;
}
Php::Value getup() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.up));
return result;
}
Php::Value getfovy() {
double result = data.fovy;
return result;
}
Php::Value gettype() {
int result = data.type;
return result;
}
void setposition(const Php::Value &v) {
data.position = ((Vector3 *)(v.implementation()))->data;
}
void settarget(const Php::Value &v) {
data.target = ((Vector3 *)(v.implementation()))->data;
}
void setup(const Php::Value &v) {
data.up = ((Vector3 *)(v.implementation()))->data;
}
void setfovy(const Php::Value &v) { data.fovy = (double)v; }
void settype(const Php::Value &v) { data.type = (int)v; }
};
class Camera2D : public Php::Base {
public:
::Camera2D data;
void __destruct() const {}
Camera2D(::Camera2D x) { data = x; }
Php::Value getoffset() {
Php::Value result =
Php::Object("RayLib\\Vector2", new Vector2(data.offset));
return result;
}
Php::Value gettarget() {
Php::Value result =
Php::Object("RayLib\\Vector2", new Vector2(data.target));
return result;
}
Php::Value getrotation() {
double result = data.rotation;
return result;
}
Php::Value getzoom() {
double result = data.zoom;
return result;
}
void setoffset(const Php::Value &v) {
data.offset = ((Vector2 *)(v.implementation()))->data;
}
void settarget(const Php::Value &v) {
data.target = ((Vector2 *)(v.implementation()))->data;
}
void setrotation(const Php::Value &v) { data.rotation = (double)v; }
void setzoom(const Php::Value &v) { data.zoom = (double)v; }
};
class Mesh : public Php::Base {
public:
::Mesh data;
void __destruct() const {}
Mesh(::Mesh x) { data = x; }
Php::Value getvertexCount() {
int result = data.vertexCount;
return result;
}
Php::Value gettriangleCount() {
int result = data.triangleCount;
return result;
}
Php::Value getvaoId() {
long result = data.vaoId;
return result;
}
Php::Value getvertices() { throw Php::Exception("Not implemented"); }
Php::Value gettexcoords() { throw Php::Exception("Not implemented"); }
Php::Value gettexcoords2() { throw Php::Exception("Not implemented"); }
Php::Value getnormals() { throw Php::Exception("Not implemented"); }
Php::Value gettangents() { throw Php::Exception("Not implemented"); }
Php::Value getcolors() { throw Php::Exception("Not implemented"); }
Php::Value getindices() { throw Php::Exception("Not implemented"); }
Php::Value getanimVertices() { throw Php::Exception("Not implemented"); }
Php::Value getanimNormals() { throw Php::Exception("Not implemented"); }
Php::Value getboneIds() { throw Php::Exception("Not implemented"); }
Php::Value getboneWeights() { throw Php::Exception("Not implemented"); }
Php::Value getvboId() { throw Php::Exception("Not implemented"); }
void setvertexCount(const Php::Value &v) { data.vertexCount = (int)v; }
void settriangleCount(const Php::Value &v) { data.triangleCount = (int)v; }
void setvaoId(const Php::Value &v) { data.vaoId = (long)v; }
void setvertices(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void settexcoords(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void settexcoords2(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setnormals(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void settangents(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setcolors(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setindices(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setanimVertices(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setanimNormals(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setboneIds(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setboneWeights(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setvboId(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
};
class Shader : public Php::Base {
public:
::Shader data;
void __destruct() const {}
Shader(::Shader x) { data = x; }
Php::Value getid() {
long result = data.id;
return result;
}
Php::Value getlocs() {
std::vector<int> result;
for (int i = 0; i < 32; i++) {
result.push_back(data.locs[i]);
}
return result;
}
void setid(const Php::Value &v) { data.id = (long)v; }
void setlocs(const Php::Value &v) {
auto arr = v.vectorValue<int>();
for (size_t i = 0; i < arr.size(); ++i) {
data.locs[i] = arr[i];
}
}
};
class MaterialMap : public Php::Base {
public:
::MaterialMap data;
void __destruct() const {}
MaterialMap(::MaterialMap x) { data = x; }
Php::Value gettexture() {
Php::Value result =
Php::Object("RayLib\\Texture2D", new Texture2D(data.texture));
return result;
}
Php::Value getcolor() {
Php::Value result = Php::Object("RayLib\\Color", new Color(data.color));
return result;
}
Php::Value getvalue() {
double result = data.value;
return result;
}
void settexture(const Php::Value &v) {
data.texture = ((Texture2D *)(v.implementation()))->data;
}
void setcolor(const Php::Value &v) {
data.color = ((Color *)(v.implementation()))->data;
}
void setvalue(const Php::Value &v) { data.value = (double)v; }
};
class Material : public Php::Base {
public:
::Material data;
void __destruct() const {}
Material(::Material x) { data = x; }
Php::Value getshader() {
Php::Value result =
Php::Object("RayLib\\Shader", new Shader(data.shader));
return result;
}
Php::Value getmaps() {
std::vector<Php::Value> result;
for (int i = 0; i < 12; i++) {
result.push_back(Php::Object("RayLib\\MaterialMap",
new MaterialMap(data.maps[i])));
}
return result;
}
Php::Value getparams() { throw Php::Exception("Not implemented"); }
void setshader(const Php::Value &v) {
data.shader = ((Shader *)(v.implementation()))->data;
}
void setmaps(const Php::Value &v) {
auto arr = v.vectorValue<Php::Value>();
for (size_t i = 0; i < arr.size(); ++i) {
data.maps[i] = ((MaterialMap *)(arr[i].implementation()))->data;
}
}
void setparams(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
};
class Transform : public Php::Base {
public:
::Transform data;
void __destruct() const {}
Transform(::Transform x) { data = x; }
Php::Value gettranslation() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.translation));
return result;
}
Php::Value getrotation() {
Php::Value result =
Php::Object("RayLib\\Vector4", new Vector4(data.rotation));
return result;
}
Php::Value getscale() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.scale));
return result;
}
void settranslation(const Php::Value &v) {
data.translation = ((Vector3 *)(v.implementation()))->data;
}
void setrotation(const Php::Value &v) {
data.rotation = ((Vector4 *)(v.implementation()))->data;
}
void setscale(const Php::Value &v) {
data.scale = ((Vector3 *)(v.implementation()))->data;
}
};
class BoneInfo : public Php::Base {
public:
::BoneInfo data;
void __destruct() const {}
BoneInfo(::BoneInfo x) { data = x; }
Php::Value getname() {
string result(data.name, 32);
return result;
}
Php::Value getparent() {
int result = data.parent;
return result;
}
void setname(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setparent(const Php::Value &v) { data.parent = (int)v; }
};
class Model : public Php::Base {
public:
::Model data;
void __destruct() const {}
Model(::Model x) { data = x; }
Php::Value gettransform() {
Php::Value result =
Php::Object("RayLib\\Matrix", new Matrix(data.transform));
return result;
}
Php::Value getmeshCount() {
int result = data.meshCount;
return result;
}
Php::Value getmeshes() {
std::vector<Php::Value> result;
for (int i = 0; i < data.meshCount; i++) {
result.push_back(
Php::Object("RayLib\\Mesh", new Mesh(data.meshes[i])));
}
return result;
}
Php::Value getmaterials() {
std::vector<Php::Value> result;
for (int i = 0; i < data.materialCount; i++) {
result.push_back(Php::Object("RayLib\\Material",
new Material(data.materials[i])));
}
return result;
}
Php::Value getmeshMaterial() { throw Php::Exception("Not implemented"); }
Php::Value getmaterialCount() {
int result = data.materialCount;
return result;
}
Php::Value getboneCount() {
int result = data.boneCount;
return result;
}
void settransform(const Php::Value &v) {
data.transform = ((Matrix *)(v.implementation()))->data;
}
void setmeshCount(const Php::Value &v) { data.meshCount = (int)v; }
void setmeshes(const Php::Value &v) {
auto arr = v.vectorValue<Php::Value>();
for (size_t i = 0; i < arr.size(); ++i) {
data.meshes[i] = ((Mesh *)(arr[i].implementation()))->data;
}
}
void setmaterialCount(const Php::Value &v) { data.materialCount = (int)v; }
void setmaterials(const Php::Value &v) {
auto arr = v.vectorValue<Php::Value>();
for (size_t i = 0; i < arr.size(); ++i) {
data.materials[i] = ((Material *)(arr[i].implementation()))->data;
}
}
void setmeshMaterial(const Php::Value &v) {
throw Php::Exception("Not implemented");
}
void setboneCount(const Php::Value &v) { data.boneCount = (int)v; }
};
class ModelAnimation : public Php::Base {
public:
::ModelAnimation data;
void __destruct() const {}
ModelAnimation(::ModelAnimation x) { data = x; }
Php::Value getboneCount() {
int result = data.boneCount;
return result;
}
Php::Value getframeCount() {
int result = data.frameCount;
return result;
}
void setboneCount(const Php::Value &v) { data.boneCount = (int)v; }
void setframeCount(const Php::Value &v) { data.frameCount = (int)v; }
};
class Ray : public Php::Base {
public:
::Ray data;
void __destruct() const {}
Ray(::Ray x) { data = x; }
Php::Value getposition() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.position));
return result;
}
Php::Value getdirection() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.direction));
return result;
}
void setposition(const Php::Value &v) {
data.position = ((Vector3 *)(v.implementation()))->data;
}
void setdirection(const Php::Value &v) {
data.direction = ((Vector3 *)(v.implementation()))->data;
}
};
class RayHitInfo : public Php::Base {
public:
::RayHitInfo data;
void __destruct() const {}
RayHitInfo(::RayHitInfo x) { data = x; }
};
class BoundingBox : public Php::Base {
public:
::BoundingBox data;
void __destruct() const {}
BoundingBox(::BoundingBox x) { data = x; }
Php::Value getmin() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.min));
return result;
}
Php::Value getmax() {
Php::Value result =
Php::Object("RayLib\\Vector3", new Vector3(data.max));
return result;
}
void setmin(const Php::Value &v) {
data.min = ((Vector3 *)(v.implementation()))->data;
}
void setmax(const Php::Value &v) {
data.max = ((Vector3 *)(v.implementation()))->data;
}
};
class Wave : public Php::Base {
public:
::Wave data;
void __destruct() const {}
Wave(::Wave x) { data = x; }
Php::Value getsampleCount() {
long result = data.sampleCount;
return result;
}
Php::Value getsampleRate() {
long result = data.sampleRate;
return result;
}
Php::Value getsampleSize() {
long result = data.sampleSize;
return result;
}
Php::Value getchannels() {
long result = data.channels;
return result;
}
void setsampleCount(const Php::Value &v) { data.sampleCount = (long)v; }
void setsampleRate(const Php::Value &v) { data.sampleRate = (long)v; }
void setsampleSize(const Php::Value &v) { data.sampleSize = (long)v; }
void setchannels(const Php::Value &v) { data.channels = (long)v; }
};
class rAudioBuffer : public Php::Base {
public:
void *data; // rAudioBuffer
rAudioBuffer(void *x) { data = x; }
};
class AudioStream : public Php::Base {
public:
::AudioStream data;
void __destruct() const {}
AudioStream(::AudioStream x) { data = x; }
Php::Value getsampleRate() {
long result = data.sampleRate;
return result;
}
Php::Value getsampleSize() {
long result = data.sampleSize;
return result;
}
Php::Value getchannels() {
long result = data.channels;
return result;
}
void setsampleRate(const Php::Value &v) { data.sampleRate = (long)v; }
void setsampleSize(const Php::Value &v) { data.sampleSize = (long)v; }
void setchannels(const Php::Value &v) { data.channels = (long)v; }
};
class Sound : public Php::Base {
public:
::Sound data;
void __destruct() const {}
Sound(::Sound x) { data = x; }
Php::Value getsampleCount() {
long result = data.sampleCount;
return result;
}
Php::Value getstream() {
Php::Value result =
Php::Object("RayLib\\AudioStream", new AudioStream(data.stream));
return result;
}
void setsampleCount(const Php::Value &v) { data.sampleCount = (long)v; }
void setstream(const Php::Value &v) {
data.stream = ((AudioStream *)(v.implementation()))->data;
}
};
class Music : public Php::Base {
public:
::Music data;
void __destruct() const {}
Music(::Music x) { data = x; }
Php::Value getctxType() {
int result = data.ctxType;
return result;
}
Php::Value getsampleCount() {
long result = data.sampleCount;
return result;
}
Php::Value getstream() {
Php::Value result =
Php::Object("RayLib\\AudioStream", new AudioStream(data.stream));
return result;
}
void setctxType(const Php::Value &v) { data.ctxType = (int)v; }
void setsampleCount(const Php::Value &v) { data.sampleCount = (long)v; }