dark-hammer / src / engine / luabind / luaengine_wrap.cxx

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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.9
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGLUA
#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
#define SWIG_LUA_MODULE_GLOBAL


#ifdef __cplusplus
/* SwigValueWrapper is described in swig.swg */
template<typename T> class SwigValueWrapper {
  struct SwigMovePointer {
    T *ptr;
    SwigMovePointer(T *p) : ptr(p) { }
    ~SwigMovePointer() { delete ptr; }
    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
  } pointer;
  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
public:
  SwigValueWrapper() : pointer(0) { }
  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
  operator T&() const { return *pointer.ptr; }
  T *operator&() { return pointer.ptr; }
};

template <typename T> T SwigValueInit() {
  return T();
}
#endif

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__)) 
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__)) 
# else
#   define SWIGUNUSED 
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif 
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif 
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif


/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  
  But only do this if strictly necessary, ie, if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/* 
   Flags/methods for returning states.
   
   The SWIG conversion methods, as ConvertPtr, return an integer 
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).
   
   Use the following macros/flags to set or process the returning
   states.
   
   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }
    
   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {         
        if (<obj is ok>) {			       
          if (<need new object>) {		       
            *ptr = <ptr to new allocated object>; 
            return SWIG_NEWOBJ;		       
          } else {				       
            *ptr = <ptr to old object>;	       
            return SWIG_OLDOBJ;		       
          } 				       
        } else {				       
          return SWIG_BADOBJ;		       
        }					       
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call
 
      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0) 
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
}
#else /* no cast-rank mode */
#  define SWIG_AddCast
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/* 
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/* 
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/* 
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/* 
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;
  
  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }    
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}
  
/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, 
                            swig_module_info *end, 
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1; 
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register int compare = strcmp(name, iname);
	  if (compare == 0) {	    
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start, 
                     swig_module_info *end, 
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      register size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }
  
  /* neither found a match */
  return 0;
}

/* 
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/* 
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    else 
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/* 
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * luarun.swg
 *
 * This file contains the runtime support for Lua modules
 * and includes code for managing global variables and pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

#include "lua.h"
#include "lauxlib.h"
#include <stdlib.h>  /* for malloc */
#include <assert.h>  /* for a few sanity tests */

/* -----------------------------------------------------------------------------
 * Lua flavors
 * ----------------------------------------------------------------------------- */

#define SWIG_LUA_FLAVOR_LUA 1
#define SWIG_LUA_FLAVOR_ELUA 2
#define SWIG_LUA_FLAVOR_ELUAC 3

#if !defined(SWIG_LUA_TARGET)
# error SWIG_LUA_TARGET not defined
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
#  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
#else /* SWIG_LUA_FLAVOR_LUA */
#  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
#  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
#  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
#  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
#endif

#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
#  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
#  define LSTRVAL LRO_STRVAL
#endif

/* -----------------------------------------------------------------------------
 * compatibility defines
 * ----------------------------------------------------------------------------- */

/* History of Lua C API length functions:  In Lua 5.0 (and before?)
   there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
   but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
   this function was again renamed, to "lua_rawlen" (to emphasize that
   it doesn't call the "__len" metamethod), and the compatibility
   define of lua_strlen was removed.  All SWIG uses have been updated
   to "lua_rawlen", and we add our own defines of that here for older
   versions of Lua.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
# define lua_rawlen lua_strlen
#elif LUA_VERSION_NUM == 501
# define lua_rawlen lua_objlen
#endif


/* lua_pushglobaltable is the recommended "future-proof" way to get
   the global table for Lua 5.2 and later.  Here we define
   lua_pushglobaltable ourselves for Lua versions before 5.2.  */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
#endif


/* -----------------------------------------------------------------------------
 * global swig types
 * ----------------------------------------------------------------------------- */
/* Constant table */
#define SWIG_LUA_INT     1
#define SWIG_LUA_FLOAT   2
#define SWIG_LUA_STRING  3
#define SWIG_LUA_POINTER 4
#define SWIG_LUA_BINARY  5
#define SWIG_LUA_CHAR    6

/* Structure for variable linking table */
typedef struct {
  const char *name;
  lua_CFunction get;
  lua_CFunction set;
} swig_lua_var_info;

/* Constant information structure */
typedef struct {
    int type;
    char *name;
    long lvalue;
    double dvalue;
    void   *pvalue;
    swig_type_info **ptype;
} swig_lua_const_info;

typedef struct {
  const char     *name;
  lua_CFunction   method;
} swig_lua_method;

typedef struct {
  const char     *name;
  lua_CFunction   getmethod;
  lua_CFunction   setmethod;
} swig_lua_attribute;

typedef struct swig_lua_class {
  const char    *name;
  swig_type_info   **type;
  lua_CFunction  constructor;
  void    (*destructor)(void *);
  swig_lua_method   *methods;
  swig_lua_attribute     *attributes;
  struct swig_lua_class **bases;
  const char **base_names;
} swig_lua_class;

/* this is the struct for wrapping all pointers in SwigLua
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  void        *ptr;
} swig_lua_userdata;

/* this is the struct for wrapping arbitrary packed binary data
(currently it is only used for member function pointers)
the data ordering is similar to swig_lua_userdata, but it is currently not possible
to tell the two structures apart within SWIG, other than by looking at the type
*/
typedef struct {
  swig_type_info   *type;
  int     own;  /* 1 if owned & must be destroyed */
  char data[1];       /* arbitary amount of data */    
} swig_lua_rawdata;

/* Common SWIG API */
#define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
#define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
#define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)

/* Runtime API */
#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*

/* Contract support */
#define SWIG_contract_assert(expr, msg)  \
  if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else

/* helper #defines */
#define SWIG_fail {goto fail;}
#define SWIG_fail_arg(func_name,argnum,type) \
  {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
  func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
  goto fail;}
#define SWIG_fail_ptr(func_name,argnum,type) \
  SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
#define SWIG_check_num_args(func_name,a,b) \
  if (lua_gettop(L)<a || lua_gettop(L)>b) \
  {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
  goto fail;}


#define SWIG_Lua_get_table(L,n) \
  (lua_pushstring(L, n), lua_rawget(L,-2))

#define SWIG_Lua_add_function(L,n,f) \
  (lua_pushstring(L, n), \
      lua_pushcfunction(L, f), \
      lua_rawset(L,-3))

/* special helper for allowing 'nil' for usertypes */
#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))

#ifdef __cplusplus
/* Special helper for member function pointers 
it gets the address, casts it, then dereferences it */
//#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a)))
#endif

/* storing/access of swig_module_info */
SWIGRUNTIME swig_module_info *
SWIG_Lua_GetModule(lua_State* L) {
  swig_module_info *ret = 0;
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_rawget(L,LUA_REGISTRYINDEX);
  if (lua_islightuserdata(L,-1))
    ret=(swig_module_info*)lua_touserdata(L,-1);
  lua_pop(L,1);  /* tidy */
  return ret;
}

SWIGRUNTIME void
SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
  /* add this all into the Lua registry: */
  lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
  lua_pushlightuserdata(L,(void*)module);
  lua_rawset(L,LUA_REGISTRYINDEX);
}

/* -----------------------------------------------------------------------------
 * global variable support code: modules
 * ----------------------------------------------------------------------------- */

/* this function is called when trying to set an immutable.
default action is to print an error.
This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
{
/*  there should be 1 param passed in: the new value */
#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
  lua_pop(L,1);  /* remove it */
  lua_pushstring(L,"This variable is immutable");
  lua_error(L);
#endif
    return 0;   /* should not return anything */
}

/* the module.get method used for getting linked data */
SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  printf("SWIG_Lua_module_get %p(%s) '%s'\n",
   lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
   lua_tostring(L,2));
*/
  /* get the metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  assert(lua_isrotable(L,1)); /* just in case */
#else
  assert(lua_istable(L,1)); /* default Lua action */
#endif
  lua_getmetatable(L,1);  /* get the metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  assert(lua_isrotable(L,-1));  /* just in case */
#else
  assert(lua_istable(L,-1));
#endif
  SWIG_Lua_get_table(L,".get");  /* get the .get table */
  lua_remove(L,3);  /* remove metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  if (lua_isrotable(L,-1))
#else
  if (lua_istable(L,-1))
#endif
  {
    /* look for the key in the .get table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,3);  /* remove .get */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_call(L,0,1);
      return 1;
    }
    lua_pop(L,1);  /* remove the top */
  }
  lua_pop(L,1);  /* remove the .get */
  lua_pushnil(L);  /* return a nil */
  return 1;
}

/* the module.set method used for setting linked data */
SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
*/
  /* get the metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  assert(lua_isrotable(L,1));  /* just in case */
#else
  assert(lua_istable(L,1)); /* default Lua action */
#endif
  lua_getmetatable(L,1);  /* get the metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  assert(lua_isrotable(L,-1));  /* just in case */
#else
  assert(lua_istable(L,-1));
#endif
  SWIG_Lua_get_table(L,".set");  /* get the .set table */
  lua_remove(L,4);  /* remove metatable */
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
  if (lua_isrotable(L,-1))
#else
  if (lua_istable(L,-1))
#endif
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    lua_remove(L,4);  /* remove .set */
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,1,0);
      return 0;
    }
#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) 
    else {
      return 0; // Exits stoically if an invalid key is initialized.
    }
#endif
  }
  lua_settop(L,3);  /* reset back to start */
  /* we now have the table, key & new value, so just set directly */
  lua_rawset(L,1);  /* add direct */
  return 0;
}

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
/* registering a module in lua. Pushes the module table on the stack. */
SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushstring(L,name);
  lua_newtable(L);   /* the table */
  /* add meta table */
  lua_newtable(L);    /* the meta table */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
  lua_pushstring(L,".get");
  lua_newtable(L);    /* the .get table */
  lua_rawset(L,-3);  /* add .get into metatable */
  lua_pushstring(L,".set");
  lua_newtable(L);    /* the .set table */
  lua_rawset(L,-3);  /* add .set into metatable */
  lua_setmetatable(L,-2);  /* sets meta table in module */
#ifdef SWIG_LUA_MODULE_GLOBAL
  /* If requested, install the module directly into the global namespace. */
  lua_rawset(L,-3);        /* add module into parent */
  SWIG_Lua_get_table(L,name);   /* get the table back out */
#else
  /* Do not install the module table as global name. The stack top has
     the module table with the name below. We pop the top and replace
     the name with it. */
  lua_replace(L,-2);
#endif
}

/* ending the register */
SWIGINTERN void  SWIG_Lua_module_end(lua_State* L)
{
  lua_pop(L,1);       /* tidy stack (remove module) */
}

/* adding a linked variable to the module */
SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  lua_getmetatable(L,-1);  /* get the metatable */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* should be a table: */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)  /* if there is a set fn */
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* should be a table: */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
  lua_pop(L,1);       /* tidy stack (remove meta) */
}
#endif

/* adding a function module */
SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
{
  SWIG_Lua_add_function(L,name,fn);
}

/* -----------------------------------------------------------------------------
 * global variable support code: classes
 * ----------------------------------------------------------------------------- */

/* the class.get method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_get(lua_State* L)
{
/*  there should be 2 params passed in
  (1) userdata (not the meta table)
  (2) string name of the attribute
*/
  assert(lua_isuserdata(L,-2));  /* just in case */
  lua_getmetatable(L,-2);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  /* look for the key in the .get table */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);
  lua_remove(L,-2); /* stack tidy, remove .get table */
  if (lua_iscfunction(L,-1))
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* ok, so try the .fn table */
  SWIG_Lua_get_table(L,".fn"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  lua_pushvalue(L,2);  /* key */
  lua_rawget(L,-2);  /* look for the fn */
  lua_remove(L,-2); /* stack tidy, remove .fn table */
  if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
  {  /* found it so return the fn & let lua call it */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  lua_pop(L,1);  /* remove whatever was there */
  /* NEW: looks for the __getitem() fn
  this is a user provided get fn */
  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;  /* sorry not known */
}

/* the class.set method, performs the lookup of class attributes */
SWIGINTERN int  SWIG_Lua_class_set(lua_State* L)
{
/*  there should be 3 params passed in
  (1) table (not the meta table)
  (2) string name of the attribute
  (3) any for the new value
printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
      lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
      lua_tostring(L,2),
      lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/

  assert(lua_isuserdata(L,1));  /* just in case */
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */

  SWIG_Lua_get_table(L,".set"); /* find the .set table */
  if (lua_istable(L,-1))
  {
    /* look for the key in the .set table */
    lua_pushvalue(L,2);  /* key */
    lua_rawget(L,-2);
    if (lua_iscfunction(L,-1))
    {  /* found it so call the fn & return its value */
      lua_pushvalue(L,1);  /* userdata */
      lua_pushvalue(L,3);  /* value */
      lua_call(L,2,0);
      return 0;
    }
    lua_pop(L,1);  /* remove the value */
  }
  lua_pop(L,1);  /* remove the value .set table */
  /* NEW: looks for the __setitem() fn
  this is a user provided set fn */
  SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
  if (lua_iscfunction(L,-1))  /* if its there */
  {  /* found it so call the fn & return its value */
    lua_pushvalue(L,1);  /* the userdata */
    lua_pushvalue(L,2);  /* the parameter */
    lua_pushvalue(L,3);  /* the value */
    lua_call(L,3,0);  /* 3 values in ,0 out */
    lua_remove(L,-2); /* stack tidy, remove metatable */
    return 1;
  }
  return 0;
}

/* the class.destruct method called by the interpreter */
SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata* usr;
  swig_lua_class* clss;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  /* if must be destroyed & has a destructor */
  if (usr->own) /* if must be destroyed */
  {
    clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
    if (clss && clss->destructor)  /* there is a destroy fn */
    {
      clss->destructor(usr->ptr);  /* bye bye */
    }
  }
  return 0;
}

/* the class.__tostring method called by the interpreter and print */
SWIGINTERN int  SWIG_Lua_class_tostring(lua_State* L)
{
/*  there should be 1 param passed in
  (1) userdata (not the metatable) */
  assert(lua_isuserdata(L,1));  /* just in case */
  unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
  lua_getmetatable(L,1);    /* get the meta table */
  assert(lua_istable(L,-1));  /* just in case */
  
  lua_getfield(L, -1, ".type");
  const char* className = lua_tostring(L, -1);
  
  char output[256];
  sprintf(output, "<%s userdata: %lX>", className, userData);
  
  lua_pushstring(L, (const char*)output);
  return 1;
}

/* to manually disown some userdata */
SWIGINTERN int  SWIG_Lua_class_disown(lua_State* L)
{
/*  there should be 1 params passed in
  (1) userdata (not the meta table) */
  swig_lua_userdata* usr;
  assert(lua_isuserdata(L,-1));  /* just in case */
  usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
  
  usr->own = 0; /* clear our ownership */
  return 0;
}

/* gets the swig class registry (or creates it) */
SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
{
  /* add this all into the swig registry: */
  lua_pushstring(L,"SWIG");
  lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
  if (!lua_istable(L,-1))  /* not there */
  {  /* must be first time, so add it */
    lua_pop(L,1);  /* remove the result */
    lua_pushstring(L,"SWIG");
    lua_newtable(L);
    lua_rawset(L,LUA_REGISTRYINDEX);
    /* then get it */
    lua_pushstring(L,"SWIG");
    lua_rawget(L,LUA_REGISTRYINDEX);
  }
}

/* helper fn to get the classes metatable from the register */
SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
{
  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,cname);  /* get the name */
  lua_rawget(L,-2);    /* get it */
  lua_remove(L,-2);    /* tidy up (remove registry) */
}

/* helper add a variable to a registered class */
SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
{
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_get_table(L,".get"); /* find the .get table */
  assert(lua_istable(L,-1));  /* just in case */
  SWIG_Lua_add_function(L,name,getFn);
  lua_pop(L,1);       /* tidy stack (remove table) */
  if (setFn)
  {
    SWIG_Lua_get_table(L,".set"); /* find the .set table */
    assert(lua_istable(L,-1));  /* just in case */
    SWIG_Lua_add_function(L,name,setFn);
    lua_pop(L,1);       /* tidy stack (remove table) */
  }
}

/* helper to recursively add class details (attributes & operations) */
SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
{
  int i;
  /* call all the base classes first: we can then override these later: */
  for(i=0;clss->bases[i];i++)
  {
    SWIG_Lua_add_class_details(L,clss->bases[i]);
  }
  /* add fns */
  for(i=0;clss->attributes[i].name;i++){
    SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
  }
  /* add methods to the metatable */
  SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
  assert(lua_istable(L,-1));  /* just in case */
  for(i=0;clss->methods[i].name;i++){
    SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
  }
  lua_pop(L,1);       /* tidy stack (remove table) */
  /*   add operator overloads
    these look ANY method which start with "__" and assume they
    are operator overloads & add them to the metatable
    (this might mess up is someone defines a method __gc (the destructor)*/
  for(i=0;clss->methods[i].name;i++){
    if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
      SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
    }
  }
}

/* set up the base classes pointers.
Each class structure has a list of pointers to the base class structures.
This function fills them.
It cannot be done at compile time, as this will not work with hireachies
spread over more than one swig file. 
Therefore it must be done at runtime, querying the SWIG type system.
*/
SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
{
  int i=0;
  swig_module_info* module=SWIG_GetModule(L);
  for(i=0;clss->base_names[i];i++)
  {
    if (clss->bases[i]==0) /* not found yet */
    {
      /* lookup and cache the base class */
      swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
      if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
    }
  }
}

/* performs the entire class registration process */
SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
{
  /*  add its constructor to module with the name of the class
  so you can do MyClass(...) as well as new_MyClass(...)
  BUT only if a constructor is defined
  (this overcomes the problem of pure virtual classes without constructors)*/
  if (clss->constructor)
    SWIG_Lua_add_function(L,clss->name,clss->constructor);

  SWIG_Lua_get_class_registry(L);  /* get the registry */
  lua_pushstring(L,clss->name);  /* get the name */
  lua_newtable(L);    /* create the metatable */
  /* add string of class name called ".type" */
  lua_pushstring(L,".type");
  lua_pushstring(L,clss->name);
  lua_rawset(L,-3);
  /* add a table called ".get" */
  lua_pushstring(L,".get");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".set" */
  lua_pushstring(L,".set");
  lua_newtable(L);
  lua_rawset(L,-3);
  /* add a table called ".fn" */
  lua_pushstring(L,".fn");
  lua_newtable(L);
  /* add manual disown method */
  SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
  lua_rawset(L,-3);
  /* add accessor fns for using the .get,.set&.fn */
  SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
  SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
  SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
  /* add tostring method for better output */
  SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
  /* add it */
  lua_rawset(L,-3);  /* metatable into registry */
  lua_pop(L,1);      /* tidy stack (remove registry) */

  SWIG_Lua_get_class_metatable(L,clss->name);
  SWIG_Lua_add_class_details(L,clss);  /* recursive adding of details (atts & ops) */
  lua_pop(L,1);      /* tidy stack (remove class metatable) */
}

/* -----------------------------------------------------------------------------
 * Class/structure conversion fns
 * ----------------------------------------------------------------------------- */

/* helper to add metatable to new lua object */
SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
{
  if (type->clientdata)  /* there is clientdata: so add the metatable */
  {
    SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
    if (lua_istable(L,-1))
    {
      lua_setmetatable(L,-2);
    }
    else
    {
      lua_pop(L,1);
    }
  }
}

/* pushes a new object into the lua stack */
SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
{
  swig_lua_userdata* usr;
  if (!ptr){
    lua_pushnil(L);
    return;
  }
  usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
  usr->ptr=ptr;  /* set the ptr */
  usr->type=type;
  usr->own=own;
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
#endif
}

/* takes a object from the lua stack & converts it into an object of the correct type
 (if possible) */
SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
{
  swig_lua_userdata* usr;
  swig_cast_info *cast;
  if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}    /* special case: lua nil => NULL pointer */
  usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
  if (usr)
  {
    if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
    {
        usr->own=0;
    }
    if (!type)            /* special cast void*, no casting fn */
    {
      *ptr=usr->ptr;
      return SWIG_OK; /* ok */
    }
    cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
    if (cast)
    {
      int newmemory = 0;
      *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
      assert(!newmemory); /* newmemory handling not yet implemented */
      return SWIG_OK;  /* ok */
    }
  }
  return SWIG_ERROR;  /* error */
}

SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
       int argnum,const char* func_name){
  void* result;
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
    lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
      func_name,(type && type->str)?type->str:"void*",argnum);
    lua_error(L);
  }
  return result;
}

/* pushes a packed userdata. user for member fn pointers only */
SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  assert(ptr); /* not acceptable to pass in a NULL value */
  raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
  raw->type=type;
  raw->own=0;
  memcpy(raw->data,ptr,size); /* copy the data */
  _SWIG_Lua_AddMetatable(L,type); /* add metatable */
}
    
/* converts a packed userdata. user for member fn pointers only */
SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
{
  swig_lua_rawdata* raw;
  raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
  if (!raw) return SWIG_ERROR;  /* error */
  if (type==0 || type==raw->type) /* void* or identical type */
  {
    memcpy(ptr,raw->data,size); /* copy it */
    return SWIG_OK; /* ok */
  }
  return SWIG_ERROR;  /* error */
}

/* a function to get the typestring of a piece of data */
SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
{
  swig_lua_userdata* usr;
  if (lua_isuserdata(L,tp))
  {
    usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
    if (usr && usr->type && usr->type->str)
      return usr->type->str;
    return "userdata (unknown type)";
  }
  return lua_typename(L,lua_type(L,tp));
}

/* lua callable function to get the userdata's type */
SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
{
  lua_pushstring(L,SWIG_Lua_typename(L,1));
  return 1;
}

/* lua callable function to compare userdata's value
the issue is that two userdata may point to the same thing
but to lua, they are different objects */
SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
{
  int result;
  swig_lua_userdata *usr1,*usr2;
  if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
    return 0;  /* nil reply */
  usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
  usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
  /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
  result=(usr1->ptr==usr2->ptr);
   lua_pushboolean(L,result);
  return 1;
}

/* -----------------------------------------------------------------------------
 * global variable support code: class/struct typemap functions
 * ----------------------------------------------------------------------------- */

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
/* Install Constants */
SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
  int i;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_LUA_INT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_FLOAT:
      lua_pushstring(L,constants[i].name);
      lua_pushnumber(L,(lua_Number)constants[i].dvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_CHAR:
      lua_pushstring(L,constants[i].name);
      lua_pushfstring(L,"%c",(char)constants[i].lvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_STRING:
      lua_pushstring(L,constants[i].name);
      lua_pushstring(L,(char *) constants[i].pvalue);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_POINTER:
      lua_pushstring(L,constants[i].name);
      SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
      lua_rawset(L,-3);
      break;
    case SWIG_LUA_BINARY:
      lua_pushstring(L,constants[i].name);
      SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
      lua_rawset(L,-3);
      break;
    default:
      break;
    }
  }
}
#endif

/* -----------------------------------------------------------------------------
 * executing lua code from within the wrapper
 * ----------------------------------------------------------------------------- */

#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
#endif
/* Executes a C string in Lua which is a really simple way of calling lua from C
Unfortunately lua keeps changing its APIs, so we need a conditional compile
In lua 5.0.X its lua_dostring()
In lua 5.1.X its luaL_dostring()
*/
SWIGINTERN int 
SWIG_Lua_dostring(lua_State *L, const char* str) {
  int ok,top;
  if (str==0 || str[0]==0) return 0; /* nothing to do */
  top=lua_gettop(L); /* save stack */
#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
  ok=luaL_dostring(L,str);	/* looks like this is lua 5.1.X or later, good */
#else
  ok=lua_dostring(L,str);	/* might be lua 5.0.x, using lua_dostring */
#endif
  if (ok!=0) {
    SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
  }
  lua_settop(L,top); /* restore the stack */
  return ok;
}    

#ifdef __cplusplus
}
#endif

/* ------------------------------ end luarun.swg  ------------------------------ */


/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_base_alloc swig_types[0]
#define SWIGTYPE_p_char swig_types[1]
#define SWIGTYPE_p_double swig_types[2]
#define SWIGTYPE_p_float swig_types[3]
#define SWIGTYPE_p_int swig_types[4]
#define SWIGTYPE_p_long_long swig_types[5]
#define SWIGTYPE_p_object swig_types[6]
#define SWIGTYPE_p_quat swig_types[7]
#define SWIGTYPE_p_scene swig_types[8]
#define SWIGTYPE_p_short swig_types[9]
#define SWIGTYPE_p_unsigned_char swig_types[10]
#define SWIGTYPE_p_unsigned_int swig_types[11]
#define SWIGTYPE_p_unsigned_long_long swig_types[12]
#define SWIGTYPE_p_unsigned_short swig_types[13]
#define SWIGTYPE_p_var swig_types[14]
#define SWIGTYPE_p_vec3 swig_types[15]
#define SWIGTYPE_p_wchar_t swig_types[16]
static swig_type_info *swig_types[18];
static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

#define SWIG_name      "eng"
#define SWIG_init      luaopen_eng
#define SWIG_init_user luaopen_eng_user

#define SWIG_LUACODE   luaopen_eng_luacode

namespace swig {
typedef struct{} LANGUAGE_OBJ;
}


#include "core/core.h"
#include "luabind/script-lua-common.h"
#include "luaengine.i"


SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
  int ret = lua_isstring(L, idx);
  if (!ret)
   ret = lua_isnil(L, idx);
  return ret;
}

#ifdef __cplusplus
extern "C" {
#endif
static int _wrap_new_object__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *result = 0 ;
  
  SWIG_check_num_args("object::object",0,0)
  result = (object *)new object();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_object,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_object__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = 0 ;
  object *result = 0 ;
  
  SWIG_check_num_args("object::object",1,1)
  if(!lua_isuserdata(L,1)) SWIG_fail_arg("object::object",1,"object const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("new_object",1,SWIGTYPE_p_object);
  }
  
  result = (object *)new object((object const &)*arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_object,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_object(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_object__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      void *ptr;
      if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      return _wrap_new_object__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_object'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::object()\n"
    "    object::object(object const &)\n");
  lua_error(L);return 0;
}


static int _wrap_object___tostring(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("object::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::__str__",1,"object *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object___tostring",1,SWIGTYPE_p_object);
  }
  
  result = (char *)(arg1)->__str__();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_sets(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  
  SWIG_check_num_args("object::sets",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::sets",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::sets",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::sets",3,"char const *");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("object::sets",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_sets",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  (arg1)->sets((char const *)arg2,(char const *)arg3,(char const *)arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_seti(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  int32 arg4 ;
  
  SWIG_check_num_args("object::seti",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::seti",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::seti",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::seti",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::seti",4,"int32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_seti",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (int32)lua_tonumber(L, 4);
  (arg1)->seti((char const *)arg2,(char const *)arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_setf(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("object::setf",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::setf",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::setf",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::setf",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::setf",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_setf",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->setf((char const *)arg2,(char const *)arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_set3f(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  fl32 arg4 ;
  fl32 arg5 ;
  fl32 arg6 ;
  
  SWIG_check_num_args("object::set3f",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::set3f",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::set3f",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::set3f",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::set3f",4,"fl32");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("object::set3f",5,"fl32");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("object::set3f",6,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_set3f",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  arg5 = (fl32)lua_tonumber(L, 5);
  arg6 = (fl32)lua_tonumber(L, 6);
  (arg1)->set3f((char const *)arg2,(char const *)arg3,arg4,arg5,arg6);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_set4f(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  fl32 arg4 ;
  fl32 arg5 ;
  fl32 arg6 ;
  fl32 arg7 ;
  
  SWIG_check_num_args("object::set4f",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::set4f",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::set4f",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::set4f",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::set4f",4,"fl32");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("object::set4f",5,"fl32");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("object::set4f",6,"fl32");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("object::set4f",7,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_set4f",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  arg5 = (fl32)lua_tonumber(L, 5);
  arg6 = (fl32)lua_tonumber(L, 6);
  arg7 = (fl32)lua_tonumber(L, 7);
  (arg1)->set4f((char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_setb(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  bool_t arg4 ;
  
  SWIG_check_num_args("object::setb",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::setb",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::setb",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::setb",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::setb",4,"bool_t");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_setb",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  SWIG_contract_assert((lua_tonumber(L,4)>=0),"number must not be negative")
  arg4 = (bool_t)lua_tonumber(L, 4);
  (arg1)->setb((char const *)arg2,(char const *)arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_setcolor__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  fl32 arg4 ;
  fl32 arg5 ;
  fl32 arg6 ;
  fl32 arg7 ;
  
  SWIG_check_num_args("object::setcolor",7,7)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::setcolor",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::setcolor",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::setcolor",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::setcolor",4,"fl32");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("object::setcolor",5,"fl32");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("object::setcolor",6,"fl32");
  if(!lua_isnumber(L,7)) SWIG_fail_arg("object::setcolor",7,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_setcolor",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  arg5 = (fl32)lua_tonumber(L, 5);
  arg6 = (fl32)lua_tonumber(L, 6);
  arg7 = (fl32)lua_tonumber(L, 7);
  (arg1)->setcolor((char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_setcolor__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  fl32 arg4 ;
  fl32 arg5 ;
  fl32 arg6 ;
  
  SWIG_check_num_args("object::setcolor",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::setcolor",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::setcolor",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::setcolor",3,"char const *");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::setcolor",4,"fl32");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("object::setcolor",5,"fl32");
  if(!lua_isnumber(L,6)) SWIG_fail_arg("object::setcolor",6,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_setcolor",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  arg5 = (fl32)lua_tonumber(L, 5);
  arg6 = (fl32)lua_tonumber(L, 6);
  (arg1)->setcolor((char const *)arg2,(char const *)arg3,arg4,arg5,arg6);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_setcolor(lua_State* L) {
  int argc;
  int argv[8]={
    1,2,3,4,5,6,7,8
  };
  
  argc = lua_gettop(L);
  if (argc == 6) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isnumber(L,argv[5]);
              }
              if (_v) {
                return _wrap_object_setcolor__SWIG_1(L);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            {
              _v = lua_isnumber(L,argv[4]);
            }
            if (_v) {
              {
                _v = lua_isnumber(L,argv[5]);
              }
              if (_v) {
                {
                  _v = lua_isnumber(L,argv[6]);
                }
                if (_v) {
                  return _wrap_object_setcolor__SWIG_0(L);
                }
              }
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_setcolor'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::setcolor(char const *,char const *,fl32,fl32,fl32,fl32)\n"
    "    object::setcolor(char const *,char const *,fl32,fl32,fl32)\n");
  lua_error(L);return 0;
}


static int _wrap_object_move__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("object::move",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::move",1,"object *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("object::move",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("object::move",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::move",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_move",1,SWIGTYPE_p_object);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->move(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_move__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  vec3 *arg2 = 0 ;
  
  SWIG_check_num_args("object::move",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::move",1,"object *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("object::move",2,"vec3 const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_move",1,SWIGTYPE_p_object);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_vec3,0))){
    SWIG_fail_ptr("object_move",2,SWIGTYPE_p_vec3);
  }
  
  (arg1)->move((vec3 const &)*arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_move(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_vec3, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_object_move__SWIG_1(L);
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_object_move__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_move'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::move(fl32,fl32,fl32)\n"
    "    object::move(vec3 const &)\n");
  lua_error(L);return 0;
}


static int _wrap_object_rotate__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("object::rotate",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::rotate",1,"object *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("object::rotate",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("object::rotate",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::rotate",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_rotate",1,SWIGTYPE_p_object);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->rotate(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_rotate__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  quat *arg2 = 0 ;
  
  SWIG_check_num_args("object::rotate",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::rotate",1,"object *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("object::rotate",2,"quat const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_rotate",1,SWIGTYPE_p_object);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_quat,0))){
    SWIG_fail_ptr("object_rotate",2,SWIGTYPE_p_quat);
  }
  
  (arg1)->rotate((quat const &)*arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_rotate(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_quat, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_object_rotate__SWIG_1(L);
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_object_rotate__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_rotate'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::rotate(fl32,fl32,fl32)\n"
    "    object::rotate(quat const &)\n");
  lua_error(L);return 0;
}


static int _wrap_object_debug(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("object::debug",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::debug",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::debug",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_debug",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  (arg1)->debug((char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_undebug(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("object::undebug",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::undebug",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::undebug",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_undebug",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  (arg1)->undebug((char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addRigidBody(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("object::addRigidBody",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addRigidBody",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::addRigidBody",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addRigidBody",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  (arg1)->addRigidBody((char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_removeRigidBody(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  
  SWIG_check_num_args("object::removeRigidBody",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::removeRigidBody",1,"object *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_removeRigidBody",1,SWIGTYPE_p_object);
  }
  
  (arg1)->removeRigidBody();
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addAttachDock__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  char *arg5 = (char *) 0 ;
  
  SWIG_check_num_args("object::addAttachDock",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addAttachDock",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::addAttachDock",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::addAttachDock",3,"char const *");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("object::addAttachDock",4,"char const *");
  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("object::addAttachDock",5,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addAttachDock",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  arg5 = (char *)lua_tostring(L, 5);
  (arg1)->addAttachDock((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addAttachDock__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  
  SWIG_check_num_args("object::addAttachDock",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addAttachDock",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::addAttachDock",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::addAttachDock",3,"char const *");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("object::addAttachDock",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addAttachDock",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  (arg1)->addAttachDock((char const *)arg2,(char const *)arg3,(char const *)arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addAttachDock__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  
  SWIG_check_num_args("object::addAttachDock",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addAttachDock",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::addAttachDock",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::addAttachDock",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addAttachDock",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  (arg1)->addAttachDock((char const *)arg2,(char const *)arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addAttachDock__SWIG_3(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *arg2 = (char *) 0 ;
  
  SWIG_check_num_args("object::addAttachDock",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addAttachDock",1,"object *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("object::addAttachDock",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addAttachDock",1,SWIGTYPE_p_object);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  (arg1)->addAttachDock((char const *)arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addAttachDock(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        return _wrap_object_addAttachDock__SWIG_3(L);
      }
    }
  }
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_object_addAttachDock__SWIG_2(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = SWIG_lua_isnilstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_object_addAttachDock__SWIG_1(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = SWIG_lua_isnilstring(L,argv[3]);
          }
          if (_v) {
            {
              _v = SWIG_lua_isnilstring(L,argv[4]);
            }
            if (_v) {
              return _wrap_object_addAttachDock__SWIG_0(L);
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_addAttachDock'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::addAttachDock(char const *,char const *,char const *,char const *)\n"
    "    object::addAttachDock(char const *,char const *,char const *)\n"
    "    object::addAttachDock(char const *,char const *)\n"
    "    object::addAttachDock(char const *)\n");
  lua_error(L);return 0;
}


static int _wrap_object_attach(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  object *arg2 = 0 ;
  char *arg3 = (char *) 0 ;
  
  SWIG_check_num_args("object::attach",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::attach",1,"object *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("object::attach",2,"object const &");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("object::attach",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_attach",1,SWIGTYPE_p_object);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_attach",2,SWIGTYPE_p_object);
  }
  
  arg3 = (char *)lua_tostring(L, 3);
  (arg1)->attach((object const &)*arg2,(char const *)arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_detach(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  
  SWIG_check_num_args("object::detach",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::detach",1,"object *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_detach",1,SWIGTYPE_p_object);
  }
  
  (arg1)->detach();
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addForce__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  vec3 *arg2 = 0 ;
  
  SWIG_check_num_args("object::addForce",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addForce",1,"object *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("object::addForce",2,"vec3 const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addForce",1,SWIGTYPE_p_object);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_vec3,0))){
    SWIG_fail_ptr("object_addForce",2,SWIGTYPE_p_vec3);
  }
  
  (arg1)->addForce((vec3 const &)*arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addForce__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("object::addForce",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addForce",1,"object *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("object::addForce",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("object::addForce",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::addForce",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addForce",1,SWIGTYPE_p_object);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->addForce(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addForce(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_vec3, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_object_addForce__SWIG_0(L);
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_object_addForce__SWIG_1(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_addForce'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::addForce(vec3 const &)\n"
    "    object::addForce(fl32,fl32,fl32)\n");
  lua_error(L);return 0;
}


static int _wrap_object_addTorque__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  vec3 *arg2 = 0 ;
  
  SWIG_check_num_args("object::addTorque",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addTorque",1,"object *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("object::addTorque",2,"vec3 const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addTorque",1,SWIGTYPE_p_object);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_vec3,0))){
    SWIG_fail_ptr("object_addTorque",2,SWIGTYPE_p_vec3);
  }
  
  (arg1)->addTorque((vec3 const &)*arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addTorque__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("object::addTorque",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::addTorque",1,"object *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("object::addTorque",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("object::addTorque",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("object::addTorque",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_addTorque",1,SWIGTYPE_p_object);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->addTorque(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_object_addTorque(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_vec3, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_object_addTorque__SWIG_0(L);
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_object, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_object_addTorque__SWIG_1(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'object_addTorque'\n"
    "  Possible C/C++ prototypes are:\n"
    "    object::addTorque(vec3 const &)\n"
    "    object::addTorque(fl32,fl32,fl32)\n");
  lua_error(L);return 0;
}


static int _wrap_object_name(lua_State* L) {
  int SWIG_arg = 0;
  object *arg1 = (object *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("object::name",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("object::name",1,"object const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_object,0))){
    SWIG_fail_ptr("object_name",1,SWIGTYPE_p_object);
  }
  
  result = (char *)((object const *)arg1)->name();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_object(void *obj) {
object *arg1 = (object *) obj;
delete arg1;
}
static swig_lua_method swig_object_methods[] = {
    {"__tostring", _wrap_object___tostring}, 
    {"sets", _wrap_object_sets}, 
    {"seti", _wrap_object_seti}, 
    {"setf", _wrap_object_setf}, 
    {"set3f", _wrap_object_set3f}, 
    {"set4f", _wrap_object_set4f}, 
    {"setb", _wrap_object_setb}, 
    {"setcolor", _wrap_object_setcolor}, 
    {"move", _wrap_object_move}, 
    {"rotate", _wrap_object_rotate}, 
    {"debug", _wrap_object_debug}, 
    {"undebug", _wrap_object_undebug}, 
    {"addRigidBody", _wrap_object_addRigidBody}, 
    {"removeRigidBody", _wrap_object_removeRigidBody}, 
    {"addAttachDock", _wrap_object_addAttachDock}, 
    {"attach", _wrap_object_attach}, 
    {"detach", _wrap_object_detach}, 
    {"addForce", _wrap_object_addForce}, 
    {"addTorque", _wrap_object_addTorque}, 
    {"name", _wrap_object_name}, 
    {0,0}
};
static swig_lua_attribute swig_object_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_object_bases[] = {0,0};
static const char *swig_object_base_names[] = {"base_alloc *",0};
static swig_lua_class _wrap_class_object = { "object", &SWIGTYPE_p_object,_wrap_new_object, swig_delete_object, swig_object_methods, swig_object_attributes, swig_object_bases, swig_object_base_names };

static int _wrap_new_scene__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  scene *result = 0 ;
  
  SWIG_check_num_args("scene::scene",0,0)
  result = (scene *)new scene();
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_scene,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_scene__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  char *arg1 = (char *) 0 ;
  scene *result = 0 ;
  
  SWIG_check_num_args("scene::scene",1,1)
  if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("scene::scene",1,"char const *");
  arg1 = (char *)lua_tostring(L, 1);
  result = (scene *)new scene((char const *)arg1);
  SWIG_NewPointerObj(L,result,SWIGTYPE_p_scene,1); SWIG_arg++; 
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_new_scene(lua_State* L) {
  int argc;
  int argv[2]={
    1,2
  };
  
  argc = lua_gettop(L);
  if (argc == 0) {
    return _wrap_new_scene__SWIG_0(L);
  }
  if (argc == 1) {
    int _v;
    {
      _v = SWIG_lua_isnilstring(L,argv[0]);
    }
    if (_v) {
      return _wrap_new_scene__SWIG_1(L);
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'new_scene'\n"
    "  Possible C/C++ prototypes are:\n"
    "    scene::scene()\n"
    "    scene::scene(char const *)\n");
  lua_error(L);return 0;
}


static int _wrap_scene___tostring(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *result = 0 ;
  
  SWIG_check_num_args("scene::__str__",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::__str__",1,"scene *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene___tostring",1,SWIGTYPE_p_scene);
  }
  
  result = (char *)(arg1)->__str__();
  lua_pushstring(L,(const char *)result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_clear(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  
  SWIG_check_num_args("scene::clear",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::clear",1,"scene *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_clear",1,SWIGTYPE_p_scene);
  }
  
  (arg1)->clear();
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_find(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::find",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::find",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::find",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_find",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (arg1)->find((char const *)arg2);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_getObject(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  uint32 arg2 ;
  object result;
  
  SWIG_check_num_args("scene::getObject",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::getObject",1,"scene *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("scene::getObject",2,"uint32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_getObject",1,SWIGTYPE_p_scene);
  }
  
  SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
  arg2 = (uint32)lua_tonumber(L, 2);
  result = (arg1)->getObject(arg2);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createModelLod__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  char *arg5 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createModelLod",5,5)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createModelLod",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createModelLod",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("scene::createModelLod",3,"char const *");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("scene::createModelLod",4,"char const *");
  if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("scene::createModelLod",5,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createModelLod",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  arg5 = (char *)lua_tostring(L, 5);
  result = (arg1)->createModelLod((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createModelLod__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char *arg4 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createModelLod",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createModelLod",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createModelLod",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("scene::createModelLod",3,"char const *");
  if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("scene::createModelLod",4,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createModelLod",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  arg4 = (char *)lua_tostring(L, 4);
  result = (arg1)->createModelLod((char const *)arg2,(char const *)arg3,(char const *)arg4);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createModelLod__SWIG_2(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createModelLod",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createModelLod",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createModelLod",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("scene::createModelLod",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createModelLod",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  result = (arg1)->createModelLod((char const *)arg2,(char const *)arg3);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createModelLod(lua_State* L) {
  int argc;
  int argv[6]={
    1,2,3,4,5,6
  };
  
  argc = lua_gettop(L);
  if (argc == 3) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_scene, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          return _wrap_scene_createModelLod__SWIG_2(L);
        }
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_scene, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = SWIG_lua_isnilstring(L,argv[3]);
          }
          if (_v) {
            return _wrap_scene_createModelLod__SWIG_1(L);
          }
        }
      }
    }
  }
  if (argc == 5) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_scene, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = SWIG_lua_isnilstring(L,argv[1]);
      }
      if (_v) {
        {
          _v = SWIG_lua_isnilstring(L,argv[2]);
        }
        if (_v) {
          {
            _v = SWIG_lua_isnilstring(L,argv[3]);
          }
          if (_v) {
            {
              _v = SWIG_lua_isnilstring(L,argv[4]);
            }
            if (_v) {
              return _wrap_scene_createModelLod__SWIG_0(L);
            }
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'scene_createModelLod'\n"
    "  Possible C/C++ prototypes are:\n"
    "    scene::createModelLod(char const *,char const *,char const *,char const *)\n"
    "    scene::createModelLod(char const *,char const *,char const *)\n"
    "    scene::createModelLod(char const *,char const *)\n");
  lua_error(L);return 0;
}


static int _wrap_scene_createModel(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createModel",3,3)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createModel",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createModel",2,"char const *");
  if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("scene::createModel",3,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createModel",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (char *)lua_tostring(L, 3);
  result = (arg1)->createModel((char const *)arg2,(char const *)arg3);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createPointLight(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createPointLight",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createPointLight",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createPointLight",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createPointLight",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (arg1)->createPointLight((char const *)arg2);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createSpotLight(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createSpotLight",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createSpotLight",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createSpotLight",2,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createSpotLight",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  result = (arg1)->createSpotLight((char const *)arg2);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_createTrigger(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  char *arg2 = (char *) 0 ;
  fl32 arg3 ;
  fl32 arg4 ;
  fl32 arg5 ;
  char *arg6 = (char *) 0 ;
  object result;
  
  SWIG_check_num_args("scene::createTrigger",6,6)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createTrigger",1,"scene *");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("scene::createTrigger",2,"char const *");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("scene::createTrigger",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("scene::createTrigger",4,"fl32");
  if(!lua_isnumber(L,5)) SWIG_fail_arg("scene::createTrigger",5,"fl32");
  if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("scene::createTrigger",6,"char const *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createTrigger",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (char *)lua_tostring(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  arg5 = (fl32)lua_tonumber(L, 5);
  arg6 = (char *)lua_tostring(L, 6);
  result = (arg1)->createTrigger((char const *)arg2,arg3,arg4,arg5,(char const *)arg6);
  {
    object * resultptr = new object((const object &) result);
    SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_object,1); SWIG_arg++;
  }
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_setMax(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("scene::setMax",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::setMax",1,"scene *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("scene::setMax",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("scene::setMax",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("scene::setMax",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_setMax",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->setMax(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_setMin(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("scene::setMin",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::setMin",1,"scene *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("scene::setMin",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("scene::setMin",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("scene::setMin",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_setMin",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->setMin(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_setGravity__SWIG_0(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  fl32 arg2 ;
  fl32 arg3 ;
  fl32 arg4 ;
  
  SWIG_check_num_args("scene::setGravity",4,4)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::setGravity",1,"scene *");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("scene::setGravity",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("scene::setGravity",3,"fl32");
  if(!lua_isnumber(L,4)) SWIG_fail_arg("scene::setGravity",4,"fl32");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_setGravity",1,SWIGTYPE_p_scene);
  }
  
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  arg4 = (fl32)lua_tonumber(L, 4);
  (arg1)->setGravity(arg2,arg3,arg4);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_setGravity__SWIG_1(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  vec3 *arg2 = 0 ;
  
  SWIG_check_num_args("scene::setGravity",2,2)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::setGravity",1,"scene *");
  if(!lua_isuserdata(L,2)) SWIG_fail_arg("scene::setGravity",2,"vec3 const &");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_setGravity",1,SWIGTYPE_p_scene);
  }
  
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_vec3,0))){
    SWIG_fail_ptr("scene_setGravity",2,SWIGTYPE_p_vec3);
  }
  
  (arg1)->setGravity((vec3 const &)*arg2);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_scene_setGravity(lua_State* L) {
  int argc;
  int argv[5]={
    1,2,3,4,5
  };
  
  argc = lua_gettop(L);
  if (argc == 2) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_scene, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        void *ptr;
        if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_vec3, 0)) {
          _v = 0;
        } else {
          _v = 1;
        }
      }
      if (_v) {
        return _wrap_scene_setGravity__SWIG_1(L);
      }
    }
  }
  if (argc == 4) {
    int _v;
    {
      void *ptr;
      if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_scene, 0)) {
        _v = 0;
      } else {
        _v = 1;
      }
    }
    if (_v) {
      {
        _v = lua_isnumber(L,argv[1]);
      }
      if (_v) {
        {
          _v = lua_isnumber(L,argv[2]);
        }
        if (_v) {
          {
            _v = lua_isnumber(L,argv[3]);
          }
          if (_v) {
            return _wrap_scene_setGravity__SWIG_0(L);
          }
        }
      }
    }
  }
  
  lua_pushstring(L,"Wrong arguments for overloaded function 'scene_setGravity'\n"
    "  Possible C/C++ prototypes are:\n"
    "    scene::setGravity(fl32,fl32,fl32)\n"
    "    scene::setGravity(vec3 const &)\n");
  lua_error(L);return 0;
}


static int _wrap_scene_createPhysicsPlane(lua_State* L) {
  int SWIG_arg = 0;
  scene *arg1 = (scene *) 0 ;
  
  SWIG_check_num_args("scene::createPhysicsPlane",1,1)
  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("scene::createPhysicsPlane",1,"scene *");
  
  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_scene,0))){
    SWIG_fail_ptr("scene_createPhysicsPlane",1,SWIGTYPE_p_scene);
  }
  
  (arg1)->createPhysicsPlane();
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static void swig_delete_scene(void *obj) {
scene *arg1 = (scene *) obj;
delete arg1;
}
static swig_lua_method swig_scene_methods[] = {
    {"__tostring", _wrap_scene___tostring}, 
    {"clear", _wrap_scene_clear}, 
    {"find", _wrap_scene_find}, 
    {"getObject", _wrap_scene_getObject}, 
    {"createModelLod", _wrap_scene_createModelLod}, 
    {"createModel", _wrap_scene_createModel}, 
    {"createPointLight", _wrap_scene_createPointLight}, 
    {"createSpotLight", _wrap_scene_createSpotLight}, 
    {"createTrigger", _wrap_scene_createTrigger}, 
    {"setMax", _wrap_scene_setMax}, 
    {"setMin", _wrap_scene_setMin}, 
    {"setGravity", _wrap_scene_setGravity}, 
    {"createPhysicsPlane", _wrap_scene_createPhysicsPlane}, 
    {0,0}
};
static swig_lua_attribute swig_scene_attributes[] = {
    {0,0,0}
};
static swig_lua_class *swig_scene_bases[] = {0,0};
static const char *swig_scene_base_names[] = {"base_alloc *",0};
static swig_lua_class _wrap_class_scene = { "scene", &SWIGTYPE_p_scene,_wrap_new_scene, swig_delete_scene, swig_scene_methods, swig_scene_attributes, swig_scene_bases, swig_scene_base_names };

static int _wrap_setSunDir(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  fl32 arg2 ;
  fl32 arg3 ;
  
  SWIG_check_num_args("setSunDir",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setSunDir",1,"fl32");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setSunDir",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setSunDir",3,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  setSunDir(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setSunColor(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  fl32 arg2 ;
  fl32 arg3 ;
  
  SWIG_check_num_args("setSunColor",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setSunColor",1,"fl32");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setSunColor",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setSunColor",3,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  setSunColor(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setSunIntensity(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  
  SWIG_check_num_args("setSunIntensity",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setSunIntensity",1,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  setSunIntensity(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setAmbientIntensity(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  
  SWIG_check_num_args("setAmbientIntensity",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setAmbientIntensity",1,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  setAmbientIntensity(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setAmbientSky(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  fl32 arg2 ;
  fl32 arg3 ;
  
  SWIG_check_num_args("setAmbientSky",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setAmbientSky",1,"fl32");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setAmbientSky",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setAmbientSky",3,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  setAmbientSky(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setAmbientGround(lua_State* L) {
  int SWIG_arg = 0;
  fl32 arg1 ;
  fl32 arg2 ;
  fl32 arg3 ;
  
  SWIG_check_num_args("setAmbientGround",3,3)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setAmbientGround",1,"fl32");
  if(!lua_isnumber(L,2)) SWIG_fail_arg("setAmbientGround",2,"fl32");
  if(!lua_isnumber(L,3)) SWIG_fail_arg("setAmbientGround",3,"fl32");
  arg1 = (fl32)lua_tonumber(L, 1);
  arg2 = (fl32)lua_tonumber(L, 2);
  arg3 = (fl32)lua_tonumber(L, 3);
  setAmbientGround(arg1,arg2,arg3);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_addTimer(lua_State* L) {
  int SWIG_arg = 0;
  uint32 arg1 ;
  char *arg2 = (char *) 0 ;
  uint32 result;
  
  SWIG_check_num_args("addTimer",2,2)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("addTimer",1,"uint32");
  if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("addTimer",2,"char const *");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (uint32)lua_tonumber(L, 1);
  arg2 = (char *)lua_tostring(L, 2);
  result = (uint32)addTimer(arg1,(char const *)arg2);
  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_removeTimer(lua_State* L) {
  int SWIG_arg = 0;
  uint32 arg1 ;
  
  SWIG_check_num_args("removeTimer",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("removeTimer",1,"uint32");
  SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
  arg1 = (uint32)lua_tonumber(L, 1);
  removeTimer(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


static int _wrap_setMemThreshold(lua_State* L) {
  int SWIG_arg = 0;
  int32 arg1 ;
  
  SWIG_check_num_args("setMemThreshold",1,1)
  if(!lua_isnumber(L,1)) SWIG_fail_arg("setMemThreshold",1,"int32");
  arg1 = (int32)lua_tonumber(L, 1);
  setMemThreshold(arg1);
  
  return SWIG_arg;
  
  if(0) SWIG_fail;
  
fail:
  lua_error(L);
  return SWIG_arg;
}


#ifdef __cplusplus
}
#endif

static const struct luaL_Reg swig_commands[] = {
    { "setSunDir", _wrap_setSunDir},
    { "setSunColor", _wrap_setSunColor},
    { "setSunIntensity", _wrap_setSunIntensity},
    { "setAmbientIntensity", _wrap_setAmbientIntensity},
    { "setAmbientSky", _wrap_setAmbientSky},
    { "setAmbientGround", _wrap_setAmbientGround},
    { "addTimer", _wrap_addTimer},
    { "removeTimer", _wrap_removeTimer},
    { "setMemThreshold", _wrap_setMemThreshold},
    {0,0}
};

static swig_lua_var_info swig_variables[] = {
    {0,0,0}
};

static swig_lua_const_info swig_constants[] = {
    {SWIG_LUA_CONSTTAB_INT("TRIGGER_UNKNOWN", TRIGGER_UNKNOWN)},
    {SWIG_LUA_CONSTTAB_INT("TRIGGER_IN", TRIGGER_IN)},
    {SWIG_LUA_CONSTTAB_INT("TRIGGER_OUT", TRIGGER_OUT)},
    {SWIG_LUA_CONSTTAB_INT("LIGHT_POINT", LIGHT_POINT)},
    {SWIG_LUA_CONSTTAB_INT("LIGHT_SPOT", LIGHT_SPOT)},
    {0,0,0,0,0,0}
};

/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static void *_p_sceneTo_p_base_alloc(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((base_alloc *)  ((scene *) x));
}
static void *_p_varTo_p_base_alloc(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((base_alloc *)  ((var *) x));
}
static void *_p_vec3To_p_base_alloc(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((base_alloc *)  ((vec3 *) x));
}
static void *_p_quatTo_p_base_alloc(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((base_alloc *)  ((quat *) x));
}
static void *_p_objectTo_p_base_alloc(void *x, int *SWIGUNUSEDPARM(newmemory)) {
    return (void *)((base_alloc *)  ((object *) x));
}
static swig_type_info _swigt__p_base_alloc = {"_p_base_alloc", "base_alloc *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_var = {"_p_var", 0, 0, 0, 0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *|int8 *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "fl64 *|double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_float = {"_p_float", "float *|fl32 *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *|int32 *|result_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_long_long = {"_p_long_long", "int64 *|long long *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_object = {"_p_object", "object *", 0, 0, (void*)&_wrap_class_object, 0};
static swig_type_info _swigt__p_quat = {"_p_quat", "quat *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_scene = {"_p_scene", "scene *", 0, 0, (void*)&_wrap_class_scene, 0};
static swig_type_info _swigt__p_short = {"_p_short", "int16 *|short *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint8 *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uptr_t *|bool_t *|uint32 *|unsigned int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint64 *|reshandle_t *|unsigned long long *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "uint16 *|unsigned short *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_vec3 = {"_p_vec3", "vec3 *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "wchar *|wchar_t *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_base_alloc,
  &_swigt__p_char,
  &_swigt__p_double,
  &_swigt__p_float,
  &_swigt__p_int,
  &_swigt__p_long_long,
  &_swigt__p_object,
  &_swigt__p_quat,
  &_swigt__p_scene,
  &_swigt__p_short,
  &_swigt__p_unsigned_char,
  &_swigt__p_unsigned_int,
  &_swigt__p_unsigned_long_long,
  &_swigt__p_unsigned_short,
  &_swigt__p_var,
  &_swigt__p_vec3,
  &_swigt__p_wchar_t,
};

static swig_cast_info _swigc__p_var[] = {{&_swigt__p_var, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_base_alloc[] = {  {&_swigt__p_base_alloc, 0, 0, 0},  {&_swigt__p_vec3, _p_vec3To_p_base_alloc, 0, 0},  {&_swigt__p_quat, _p_quatTo_p_base_alloc, 0, 0},  {&_swigt__p_object, _p_objectTo_p_base_alloc, 0, 0},  {&_swigt__p_scene, _p_sceneTo_p_base_alloc, 0, 0},  {&_swigt__p_var, _p_varTo_p_base_alloc, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_object[] = {  {&_swigt__p_object, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_quat[] = {  {&_swigt__p_quat, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_scene[] = {  {&_swigt__p_scene, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_short[] = {  {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_vec3[] = {  {&_swigt__p_vec3, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wchar_t[] = {  {&_swigt__p_wchar_t, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_base_alloc,
  _swigc__p_char,
  _swigc__p_double,
  _swigc__p_float,
  _swigc__p_int,
  _swigc__p_long_long,
  _swigc__p_object,
  _swigc__p_quat,
  _swigc__p_scene,
  _swigc__p_short,
  _swigc__p_unsigned_char,
  _swigc__p_unsigned_int,
  _swigc__p_unsigned_long_long,
  _swigc__p_unsigned_short,
  _swigc__p_var,
  _swigc__p_vec3,
  _swigc__p_wchar_t,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic 
 * memory is used. Also, since swig_type_info structures store pointers to 
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization. 
 * The idea is that swig generates all the structures that are needed. 
 * The runtime then collects these partially filled structures. 
 * The SWIG_InitializeModule function takes these initial arrays out of 
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned staticly to an initial 
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it 
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded. 
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the 
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int found, init;

  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
    module_head = &swig_module;
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    found=0;
    iter=module_head;
    do {
      if (iter==&swig_module) {
        found=1;
        break;
      }
      iter=iter->next;
    } while (iter!= module_head);

    /* if the is found in the list, then all is done and we may leave */
    if (found) return;
    /* otherwise we must add out module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }

  /* When multiple interpeters are used, a module could have already been initialized in
     a different interpreter, but not yet have a pointer in this interpreter.
     In this case, we do not want to continue adding types... everything should be
     set up already */
  if (init == 0) return;

  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;
  
#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif

    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
	type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }

    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
    
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
	if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
	  cast->type = ret;
	  ret = 0;
	} else {
	  /* Check for casting already in the list */
	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
	  if (!ocast) ret = 0;
	}
      }

      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;

#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
  printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;

  if (init_run) return;
  init_run = 1;

  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{ /* c-mode */
#endif
}
#endif



/* Forward declaration of where the user's %init{} gets inserted */
void SWIG_init_user(lua_State* L );
    
#ifdef __cplusplus
extern "C" {
#endif
/* this is the initialization function
  added at the very end of the code
  the function is always called SWIG_init, but an earlier #define will rename it
*/
#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
LUALIB_API int SWIG_init(lua_State* L)
#else
SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
#endif
{
#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
  int i;
  /* start with global table */
  lua_pushglobaltable (L);
  /* SWIG's internal initalisation */
  SWIG_InitializeModule((void*)L);
  SWIG_PropagateClientData();
#endif

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  /* add a global fn */
  SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
  SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
  /* begin the module (its a table with the same name as the module) */
  SWIG_Lua_module_begin(L,SWIG_name);
  /* add commands/functions */
  for (i = 0; swig_commands[i].name; i++){
    SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
  }
  /* add variables */
  for (i = 0; swig_variables[i].name; i++){
    SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
  }
#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* set up base class pointers (the hierarchy) */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
  /* additional registration structs & classes in lua */
  for (i = 0; swig_types[i]; i++){
    if (swig_types[i]->clientdata){
      SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
    }
  }
#endif

#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
  /* constants */
  SWIG_Lua_InstallConstants(L,swig_constants);
#endif

#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
  /* invoke user-specific initialization */
  SWIG_init_user(L);
  /* end module */
  /* Note: We do not clean up the stack here (Lua will do this for us). At this
     point, we have the globals table and out module table on the stack. Returning
     one value makes the module table the result of the require command. */
  return 1;
#else
  return 0;
#endif
}

#ifdef __cplusplus
}
#endif


const char* SWIG_LUACODE=
  "";

void SWIG_init_user(lua_State* L)
{
  /* exec Lua code if applicable */
  SWIG_Lua_dostring(L,SWIG_LUACODE);
}

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.