Scene.cpp 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175
  1. // Copyright (C) 2009-2015, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // WARNING: The file is auto generated.
  6. #include "anki/script/LuaBinder.h"
  7. #include "anki/script/ScriptManager.h"
  8. #include "anki/Scene.h"
  9. namespace anki {
  10. //==============================================================================
  11. template<typename T, typename... TArgs>
  12. static T* newSceneNode(SceneGraph* scene, CString name, TArgs... args)
  13. {
  14. T* ptr;
  15. Error err = scene->template newSceneNode<T>(
  16. name, ptr, args...);
  17. if(!err)
  18. {
  19. return ptr;
  20. }
  21. else
  22. {
  23. return nullptr;
  24. }
  25. }
  26. //==============================================================================
  27. static SceneGraph* getSceneGraph(lua_State* l)
  28. {
  29. LuaBinder* binder = static_cast<LuaBinder*>(lua_getuserdata(l));
  30. ScriptManager* scriptManager =
  31. reinterpret_cast<ScriptManager*>(binder->getParent());
  32. return &scriptManager->_getSceneGraph();
  33. }
  34. //==============================================================================
  35. // MoveComponent =
  36. //==============================================================================
  37. //==============================================================================
  38. static const char* classnameMoveComponent = "MoveComponent";
  39. template<>
  40. I64 LuaBinder::getWrappedTypeSignature<MoveComponent>()
  41. {
  42. return 2038493110845313445;
  43. }
  44. template<>
  45. const char* LuaBinder::getWrappedTypeName<MoveComponent>()
  46. {
  47. return classnameMoveComponent;
  48. }
  49. //==============================================================================
  50. /// Pre-wrap method MoveComponent::setLocalOrigin.
  51. static inline int pwrapMoveComponentsetLocalOrigin(lua_State* l)
  52. {
  53. UserData* ud;
  54. (void)ud;
  55. void* voidp;
  56. (void)voidp;
  57. LuaBinder::checkArgsCount(l, 2);
  58. // Get "this" as "self"
  59. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  60. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  61. ANKI_ASSERT(self != nullptr);
  62. // Pop arguments
  63. if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
  64. Vec4* iarg0 = static_cast<Vec4*>(ud->m_data);
  65. const Vec4& arg0(*iarg0);
  66. // Call the method
  67. self->setLocalOrigin(arg0);
  68. return 0;
  69. }
  70. //==============================================================================
  71. /// Wrap method MoveComponent::setLocalOrigin.
  72. static int wrapMoveComponentsetLocalOrigin(lua_State* l)
  73. {
  74. int res = pwrapMoveComponentsetLocalOrigin(l);
  75. if(res >= 0) return res;
  76. lua_error(l);
  77. return 0;
  78. }
  79. //==============================================================================
  80. /// Pre-wrap method MoveComponent::getLocalOrigin.
  81. static inline int pwrapMoveComponentgetLocalOrigin(lua_State* l)
  82. {
  83. UserData* ud;
  84. (void)ud;
  85. void* voidp;
  86. (void)voidp;
  87. LuaBinder::checkArgsCount(l, 1);
  88. // Get "this" as "self"
  89. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  90. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  91. ANKI_ASSERT(self != nullptr);
  92. // Call the method
  93. const Vec4& ret = self->getLocalOrigin();
  94. // Push return value
  95. voidp = lua_newuserdata(l, sizeof(UserData));
  96. ud = static_cast<UserData*>(voidp);
  97. luaL_setmetatable(l, "Vec4");
  98. ud->m_data = const_cast<void*>(static_cast<const void*>(&ret));
  99. ud->m_gc = false;
  100. ud->m_sig = 6804478823655046386;
  101. return 1;
  102. }
  103. //==============================================================================
  104. /// Wrap method MoveComponent::getLocalOrigin.
  105. static int wrapMoveComponentgetLocalOrigin(lua_State* l)
  106. {
  107. int res = pwrapMoveComponentgetLocalOrigin(l);
  108. if(res >= 0) return res;
  109. lua_error(l);
  110. return 0;
  111. }
  112. //==============================================================================
  113. /// Pre-wrap method MoveComponent::setLocalRotation.
  114. static inline int pwrapMoveComponentsetLocalRotation(lua_State* l)
  115. {
  116. UserData* ud;
  117. (void)ud;
  118. void* voidp;
  119. (void)voidp;
  120. LuaBinder::checkArgsCount(l, 2);
  121. // Get "this" as "self"
  122. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  123. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  124. ANKI_ASSERT(self != nullptr);
  125. // Pop arguments
  126. if(LuaBinder::checkUserData(l, 2, "Mat3x4", -2654194732934255869, ud)) return -1;
  127. Mat3x4* iarg0 = static_cast<Mat3x4*>(ud->m_data);
  128. const Mat3x4& arg0(*iarg0);
  129. // Call the method
  130. self->setLocalRotation(arg0);
  131. return 0;
  132. }
  133. //==============================================================================
  134. /// Wrap method MoveComponent::setLocalRotation.
  135. static int wrapMoveComponentsetLocalRotation(lua_State* l)
  136. {
  137. int res = pwrapMoveComponentsetLocalRotation(l);
  138. if(res >= 0) return res;
  139. lua_error(l);
  140. return 0;
  141. }
  142. //==============================================================================
  143. /// Pre-wrap method MoveComponent::getLocalRotation.
  144. static inline int pwrapMoveComponentgetLocalRotation(lua_State* l)
  145. {
  146. UserData* ud;
  147. (void)ud;
  148. void* voidp;
  149. (void)voidp;
  150. LuaBinder::checkArgsCount(l, 1);
  151. // Get "this" as "self"
  152. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  153. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  154. ANKI_ASSERT(self != nullptr);
  155. // Call the method
  156. const Mat3x4& ret = self->getLocalRotation();
  157. // Push return value
  158. voidp = lua_newuserdata(l, sizeof(UserData));
  159. ud = static_cast<UserData*>(voidp);
  160. luaL_setmetatable(l, "Mat3x4");
  161. ud->m_data = const_cast<void*>(static_cast<const void*>(&ret));
  162. ud->m_gc = false;
  163. ud->m_sig = -2654194732934255869;
  164. return 1;
  165. }
  166. //==============================================================================
  167. /// Wrap method MoveComponent::getLocalRotation.
  168. static int wrapMoveComponentgetLocalRotation(lua_State* l)
  169. {
  170. int res = pwrapMoveComponentgetLocalRotation(l);
  171. if(res >= 0) return res;
  172. lua_error(l);
  173. return 0;
  174. }
  175. //==============================================================================
  176. /// Pre-wrap method MoveComponent::setLocalScale.
  177. static inline int pwrapMoveComponentsetLocalScale(lua_State* l)
  178. {
  179. UserData* ud;
  180. (void)ud;
  181. void* voidp;
  182. (void)voidp;
  183. LuaBinder::checkArgsCount(l, 2);
  184. // Get "this" as "self"
  185. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  186. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  187. ANKI_ASSERT(self != nullptr);
  188. // Pop arguments
  189. F32 arg0;
  190. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  191. // Call the method
  192. self->setLocalScale(arg0);
  193. return 0;
  194. }
  195. //==============================================================================
  196. /// Wrap method MoveComponent::setLocalScale.
  197. static int wrapMoveComponentsetLocalScale(lua_State* l)
  198. {
  199. int res = pwrapMoveComponentsetLocalScale(l);
  200. if(res >= 0) return res;
  201. lua_error(l);
  202. return 0;
  203. }
  204. //==============================================================================
  205. /// Pre-wrap method MoveComponent::getLocalScale.
  206. static inline int pwrapMoveComponentgetLocalScale(lua_State* l)
  207. {
  208. UserData* ud;
  209. (void)ud;
  210. void* voidp;
  211. (void)voidp;
  212. LuaBinder::checkArgsCount(l, 1);
  213. // Get "this" as "self"
  214. if(LuaBinder::checkUserData(l, 1, classnameMoveComponent, 2038493110845313445, ud)) return -1;
  215. MoveComponent* self = static_cast<MoveComponent*>(ud->m_data);
  216. ANKI_ASSERT(self != nullptr);
  217. // Call the method
  218. F32 ret = self->getLocalScale();
  219. // Push return value
  220. lua_pushnumber(l, ret);
  221. return 1;
  222. }
  223. //==============================================================================
  224. /// Wrap method MoveComponent::getLocalScale.
  225. static int wrapMoveComponentgetLocalScale(lua_State* l)
  226. {
  227. int res = pwrapMoveComponentgetLocalScale(l);
  228. if(res >= 0) return res;
  229. lua_error(l);
  230. return 0;
  231. }
  232. //==============================================================================
  233. /// Wrap class MoveComponent.
  234. static inline void wrapMoveComponent(lua_State* l)
  235. {
  236. LuaBinder::createClass(l, classnameMoveComponent);
  237. LuaBinder::pushLuaCFuncMethod(l, "setLocalOrigin", wrapMoveComponentsetLocalOrigin);
  238. LuaBinder::pushLuaCFuncMethod(l, "getLocalOrigin", wrapMoveComponentgetLocalOrigin);
  239. LuaBinder::pushLuaCFuncMethod(l, "setLocalRotation", wrapMoveComponentsetLocalRotation);
  240. LuaBinder::pushLuaCFuncMethod(l, "getLocalRotation", wrapMoveComponentgetLocalRotation);
  241. LuaBinder::pushLuaCFuncMethod(l, "setLocalScale", wrapMoveComponentsetLocalScale);
  242. LuaBinder::pushLuaCFuncMethod(l, "getLocalScale", wrapMoveComponentgetLocalScale);
  243. lua_settop(l, 0);
  244. }
  245. //==============================================================================
  246. // LightComponent =
  247. //==============================================================================
  248. //==============================================================================
  249. static const char* classnameLightComponent = "LightComponent";
  250. template<>
  251. I64 LuaBinder::getWrappedTypeSignature<LightComponent>()
  252. {
  253. return 7940823622056993903;
  254. }
  255. template<>
  256. const char* LuaBinder::getWrappedTypeName<LightComponent>()
  257. {
  258. return classnameLightComponent;
  259. }
  260. //==============================================================================
  261. /// Pre-wrap method LightComponent::setDiffuseColor.
  262. static inline int pwrapLightComponentsetDiffuseColor(lua_State* l)
  263. {
  264. UserData* ud;
  265. (void)ud;
  266. void* voidp;
  267. (void)voidp;
  268. LuaBinder::checkArgsCount(l, 2);
  269. // Get "this" as "self"
  270. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  271. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  272. ANKI_ASSERT(self != nullptr);
  273. // Pop arguments
  274. if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
  275. Vec4* iarg0 = static_cast<Vec4*>(ud->m_data);
  276. const Vec4& arg0(*iarg0);
  277. // Call the method
  278. self->setDiffuseColor(arg0);
  279. return 0;
  280. }
  281. //==============================================================================
  282. /// Wrap method LightComponent::setDiffuseColor.
  283. static int wrapLightComponentsetDiffuseColor(lua_State* l)
  284. {
  285. int res = pwrapLightComponentsetDiffuseColor(l);
  286. if(res >= 0) return res;
  287. lua_error(l);
  288. return 0;
  289. }
  290. //==============================================================================
  291. /// Pre-wrap method LightComponent::getDiffuseColor.
  292. static inline int pwrapLightComponentgetDiffuseColor(lua_State* l)
  293. {
  294. UserData* ud;
  295. (void)ud;
  296. void* voidp;
  297. (void)voidp;
  298. LuaBinder::checkArgsCount(l, 1);
  299. // Get "this" as "self"
  300. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  301. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  302. ANKI_ASSERT(self != nullptr);
  303. // Call the method
  304. const Vec4& ret = self->getDiffuseColor();
  305. // Push return value
  306. voidp = lua_newuserdata(l, sizeof(UserData));
  307. ud = static_cast<UserData*>(voidp);
  308. luaL_setmetatable(l, "Vec4");
  309. ud->m_data = const_cast<void*>(static_cast<const void*>(&ret));
  310. ud->m_gc = false;
  311. ud->m_sig = 6804478823655046386;
  312. return 1;
  313. }
  314. //==============================================================================
  315. /// Wrap method LightComponent::getDiffuseColor.
  316. static int wrapLightComponentgetDiffuseColor(lua_State* l)
  317. {
  318. int res = pwrapLightComponentgetDiffuseColor(l);
  319. if(res >= 0) return res;
  320. lua_error(l);
  321. return 0;
  322. }
  323. //==============================================================================
  324. /// Pre-wrap method LightComponent::setSpecularColor.
  325. static inline int pwrapLightComponentsetSpecularColor(lua_State* l)
  326. {
  327. UserData* ud;
  328. (void)ud;
  329. void* voidp;
  330. (void)voidp;
  331. LuaBinder::checkArgsCount(l, 2);
  332. // Get "this" as "self"
  333. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  334. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  335. ANKI_ASSERT(self != nullptr);
  336. // Pop arguments
  337. if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
  338. Vec4* iarg0 = static_cast<Vec4*>(ud->m_data);
  339. const Vec4& arg0(*iarg0);
  340. // Call the method
  341. self->setSpecularColor(arg0);
  342. return 0;
  343. }
  344. //==============================================================================
  345. /// Wrap method LightComponent::setSpecularColor.
  346. static int wrapLightComponentsetSpecularColor(lua_State* l)
  347. {
  348. int res = pwrapLightComponentsetSpecularColor(l);
  349. if(res >= 0) return res;
  350. lua_error(l);
  351. return 0;
  352. }
  353. //==============================================================================
  354. /// Pre-wrap method LightComponent::getSpecularColor.
  355. static inline int pwrapLightComponentgetSpecularColor(lua_State* l)
  356. {
  357. UserData* ud;
  358. (void)ud;
  359. void* voidp;
  360. (void)voidp;
  361. LuaBinder::checkArgsCount(l, 1);
  362. // Get "this" as "self"
  363. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  364. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  365. ANKI_ASSERT(self != nullptr);
  366. // Call the method
  367. const Vec4& ret = self->getSpecularColor();
  368. // Push return value
  369. voidp = lua_newuserdata(l, sizeof(UserData));
  370. ud = static_cast<UserData*>(voidp);
  371. luaL_setmetatable(l, "Vec4");
  372. ud->m_data = const_cast<void*>(static_cast<const void*>(&ret));
  373. ud->m_gc = false;
  374. ud->m_sig = 6804478823655046386;
  375. return 1;
  376. }
  377. //==============================================================================
  378. /// Wrap method LightComponent::getSpecularColor.
  379. static int wrapLightComponentgetSpecularColor(lua_State* l)
  380. {
  381. int res = pwrapLightComponentgetSpecularColor(l);
  382. if(res >= 0) return res;
  383. lua_error(l);
  384. return 0;
  385. }
  386. //==============================================================================
  387. /// Pre-wrap method LightComponent::setRadius.
  388. static inline int pwrapLightComponentsetRadius(lua_State* l)
  389. {
  390. UserData* ud;
  391. (void)ud;
  392. void* voidp;
  393. (void)voidp;
  394. LuaBinder::checkArgsCount(l, 2);
  395. // Get "this" as "self"
  396. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  397. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  398. ANKI_ASSERT(self != nullptr);
  399. // Pop arguments
  400. F32 arg0;
  401. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  402. // Call the method
  403. self->setRadius(arg0);
  404. return 0;
  405. }
  406. //==============================================================================
  407. /// Wrap method LightComponent::setRadius.
  408. static int wrapLightComponentsetRadius(lua_State* l)
  409. {
  410. int res = pwrapLightComponentsetRadius(l);
  411. if(res >= 0) return res;
  412. lua_error(l);
  413. return 0;
  414. }
  415. //==============================================================================
  416. /// Pre-wrap method LightComponent::getRadius.
  417. static inline int pwrapLightComponentgetRadius(lua_State* l)
  418. {
  419. UserData* ud;
  420. (void)ud;
  421. void* voidp;
  422. (void)voidp;
  423. LuaBinder::checkArgsCount(l, 1);
  424. // Get "this" as "self"
  425. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  426. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  427. ANKI_ASSERT(self != nullptr);
  428. // Call the method
  429. F32 ret = self->getRadius();
  430. // Push return value
  431. lua_pushnumber(l, ret);
  432. return 1;
  433. }
  434. //==============================================================================
  435. /// Wrap method LightComponent::getRadius.
  436. static int wrapLightComponentgetRadius(lua_State* l)
  437. {
  438. int res = pwrapLightComponentgetRadius(l);
  439. if(res >= 0) return res;
  440. lua_error(l);
  441. return 0;
  442. }
  443. //==============================================================================
  444. /// Pre-wrap method LightComponent::setDistance.
  445. static inline int pwrapLightComponentsetDistance(lua_State* l)
  446. {
  447. UserData* ud;
  448. (void)ud;
  449. void* voidp;
  450. (void)voidp;
  451. LuaBinder::checkArgsCount(l, 2);
  452. // Get "this" as "self"
  453. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  454. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  455. ANKI_ASSERT(self != nullptr);
  456. // Pop arguments
  457. F32 arg0;
  458. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  459. // Call the method
  460. self->setDistance(arg0);
  461. return 0;
  462. }
  463. //==============================================================================
  464. /// Wrap method LightComponent::setDistance.
  465. static int wrapLightComponentsetDistance(lua_State* l)
  466. {
  467. int res = pwrapLightComponentsetDistance(l);
  468. if(res >= 0) return res;
  469. lua_error(l);
  470. return 0;
  471. }
  472. //==============================================================================
  473. /// Pre-wrap method LightComponent::getDistance.
  474. static inline int pwrapLightComponentgetDistance(lua_State* l)
  475. {
  476. UserData* ud;
  477. (void)ud;
  478. void* voidp;
  479. (void)voidp;
  480. LuaBinder::checkArgsCount(l, 1);
  481. // Get "this" as "self"
  482. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  483. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  484. ANKI_ASSERT(self != nullptr);
  485. // Call the method
  486. F32 ret = self->getDistance();
  487. // Push return value
  488. lua_pushnumber(l, ret);
  489. return 1;
  490. }
  491. //==============================================================================
  492. /// Wrap method LightComponent::getDistance.
  493. static int wrapLightComponentgetDistance(lua_State* l)
  494. {
  495. int res = pwrapLightComponentgetDistance(l);
  496. if(res >= 0) return res;
  497. lua_error(l);
  498. return 0;
  499. }
  500. //==============================================================================
  501. /// Pre-wrap method LightComponent::setInnerAngle.
  502. static inline int pwrapLightComponentsetInnerAngle(lua_State* l)
  503. {
  504. UserData* ud;
  505. (void)ud;
  506. void* voidp;
  507. (void)voidp;
  508. LuaBinder::checkArgsCount(l, 2);
  509. // Get "this" as "self"
  510. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  511. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  512. ANKI_ASSERT(self != nullptr);
  513. // Pop arguments
  514. F32 arg0;
  515. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  516. // Call the method
  517. self->setInnerAngle(arg0);
  518. return 0;
  519. }
  520. //==============================================================================
  521. /// Wrap method LightComponent::setInnerAngle.
  522. static int wrapLightComponentsetInnerAngle(lua_State* l)
  523. {
  524. int res = pwrapLightComponentsetInnerAngle(l);
  525. if(res >= 0) return res;
  526. lua_error(l);
  527. return 0;
  528. }
  529. //==============================================================================
  530. /// Pre-wrap method LightComponent::getInnerAngle.
  531. static inline int pwrapLightComponentgetInnerAngle(lua_State* l)
  532. {
  533. UserData* ud;
  534. (void)ud;
  535. void* voidp;
  536. (void)voidp;
  537. LuaBinder::checkArgsCount(l, 1);
  538. // Get "this" as "self"
  539. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  540. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  541. ANKI_ASSERT(self != nullptr);
  542. // Call the method
  543. F32 ret = self->getInnerAngle();
  544. // Push return value
  545. lua_pushnumber(l, ret);
  546. return 1;
  547. }
  548. //==============================================================================
  549. /// Wrap method LightComponent::getInnerAngle.
  550. static int wrapLightComponentgetInnerAngle(lua_State* l)
  551. {
  552. int res = pwrapLightComponentgetInnerAngle(l);
  553. if(res >= 0) return res;
  554. lua_error(l);
  555. return 0;
  556. }
  557. //==============================================================================
  558. /// Pre-wrap method LightComponent::setOuterAngle.
  559. static inline int pwrapLightComponentsetOuterAngle(lua_State* l)
  560. {
  561. UserData* ud;
  562. (void)ud;
  563. void* voidp;
  564. (void)voidp;
  565. LuaBinder::checkArgsCount(l, 2);
  566. // Get "this" as "self"
  567. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  568. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  569. ANKI_ASSERT(self != nullptr);
  570. // Pop arguments
  571. F32 arg0;
  572. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  573. // Call the method
  574. self->setOuterAngle(arg0);
  575. return 0;
  576. }
  577. //==============================================================================
  578. /// Wrap method LightComponent::setOuterAngle.
  579. static int wrapLightComponentsetOuterAngle(lua_State* l)
  580. {
  581. int res = pwrapLightComponentsetOuterAngle(l);
  582. if(res >= 0) return res;
  583. lua_error(l);
  584. return 0;
  585. }
  586. //==============================================================================
  587. /// Pre-wrap method LightComponent::getOuterAngle.
  588. static inline int pwrapLightComponentgetOuterAngle(lua_State* l)
  589. {
  590. UserData* ud;
  591. (void)ud;
  592. void* voidp;
  593. (void)voidp;
  594. LuaBinder::checkArgsCount(l, 1);
  595. // Get "this" as "self"
  596. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  597. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  598. ANKI_ASSERT(self != nullptr);
  599. // Call the method
  600. F32 ret = self->getOuterAngle();
  601. // Push return value
  602. lua_pushnumber(l, ret);
  603. return 1;
  604. }
  605. //==============================================================================
  606. /// Wrap method LightComponent::getOuterAngle.
  607. static int wrapLightComponentgetOuterAngle(lua_State* l)
  608. {
  609. int res = pwrapLightComponentgetOuterAngle(l);
  610. if(res >= 0) return res;
  611. lua_error(l);
  612. return 0;
  613. }
  614. //==============================================================================
  615. /// Pre-wrap method LightComponent::setShadowEnabled.
  616. static inline int pwrapLightComponentsetShadowEnabled(lua_State* l)
  617. {
  618. UserData* ud;
  619. (void)ud;
  620. void* voidp;
  621. (void)voidp;
  622. LuaBinder::checkArgsCount(l, 2);
  623. // Get "this" as "self"
  624. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  625. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  626. ANKI_ASSERT(self != nullptr);
  627. // Pop arguments
  628. Bool arg0;
  629. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  630. // Call the method
  631. self->setShadowEnabled(arg0);
  632. return 0;
  633. }
  634. //==============================================================================
  635. /// Wrap method LightComponent::setShadowEnabled.
  636. static int wrapLightComponentsetShadowEnabled(lua_State* l)
  637. {
  638. int res = pwrapLightComponentsetShadowEnabled(l);
  639. if(res >= 0) return res;
  640. lua_error(l);
  641. return 0;
  642. }
  643. //==============================================================================
  644. /// Pre-wrap method LightComponent::getShadowEnabled.
  645. static inline int pwrapLightComponentgetShadowEnabled(lua_State* l)
  646. {
  647. UserData* ud;
  648. (void)ud;
  649. void* voidp;
  650. (void)voidp;
  651. LuaBinder::checkArgsCount(l, 1);
  652. // Get "this" as "self"
  653. if(LuaBinder::checkUserData(l, 1, classnameLightComponent, 7940823622056993903, ud)) return -1;
  654. LightComponent* self = static_cast<LightComponent*>(ud->m_data);
  655. ANKI_ASSERT(self != nullptr);
  656. // Call the method
  657. Bool ret = self->getShadowEnabled();
  658. // Push return value
  659. lua_pushboolean(l, ret);
  660. return 1;
  661. }
  662. //==============================================================================
  663. /// Wrap method LightComponent::getShadowEnabled.
  664. static int wrapLightComponentgetShadowEnabled(lua_State* l)
  665. {
  666. int res = pwrapLightComponentgetShadowEnabled(l);
  667. if(res >= 0) return res;
  668. lua_error(l);
  669. return 0;
  670. }
  671. //==============================================================================
  672. /// Wrap class LightComponent.
  673. static inline void wrapLightComponent(lua_State* l)
  674. {
  675. LuaBinder::createClass(l, classnameLightComponent);
  676. LuaBinder::pushLuaCFuncMethod(l, "setDiffuseColor", wrapLightComponentsetDiffuseColor);
  677. LuaBinder::pushLuaCFuncMethod(l, "getDiffuseColor", wrapLightComponentgetDiffuseColor);
  678. LuaBinder::pushLuaCFuncMethod(l, "setSpecularColor", wrapLightComponentsetSpecularColor);
  679. LuaBinder::pushLuaCFuncMethod(l, "getSpecularColor", wrapLightComponentgetSpecularColor);
  680. LuaBinder::pushLuaCFuncMethod(l, "setRadius", wrapLightComponentsetRadius);
  681. LuaBinder::pushLuaCFuncMethod(l, "getRadius", wrapLightComponentgetRadius);
  682. LuaBinder::pushLuaCFuncMethod(l, "setDistance", wrapLightComponentsetDistance);
  683. LuaBinder::pushLuaCFuncMethod(l, "getDistance", wrapLightComponentgetDistance);
  684. LuaBinder::pushLuaCFuncMethod(l, "setInnerAngle", wrapLightComponentsetInnerAngle);
  685. LuaBinder::pushLuaCFuncMethod(l, "getInnerAngle", wrapLightComponentgetInnerAngle);
  686. LuaBinder::pushLuaCFuncMethod(l, "setOuterAngle", wrapLightComponentsetOuterAngle);
  687. LuaBinder::pushLuaCFuncMethod(l, "getOuterAngle", wrapLightComponentgetOuterAngle);
  688. LuaBinder::pushLuaCFuncMethod(l, "setShadowEnabled", wrapLightComponentsetShadowEnabled);
  689. LuaBinder::pushLuaCFuncMethod(l, "getShadowEnabled", wrapLightComponentgetShadowEnabled);
  690. lua_settop(l, 0);
  691. }
  692. //==============================================================================
  693. // LensFlareComponent =
  694. //==============================================================================
  695. //==============================================================================
  696. static const char* classnameLensFlareComponent = "LensFlareComponent";
  697. template<>
  698. I64 LuaBinder::getWrappedTypeSignature<LensFlareComponent>()
  699. {
  700. return -2019248835133422777;
  701. }
  702. template<>
  703. const char* LuaBinder::getWrappedTypeName<LensFlareComponent>()
  704. {
  705. return classnameLensFlareComponent;
  706. }
  707. //==============================================================================
  708. /// Pre-wrap method LensFlareComponent::setFirstFlareSize.
  709. static inline int pwrapLensFlareComponentsetFirstFlareSize(lua_State* l)
  710. {
  711. UserData* ud;
  712. (void)ud;
  713. void* voidp;
  714. (void)voidp;
  715. LuaBinder::checkArgsCount(l, 2);
  716. // Get "this" as "self"
  717. if(LuaBinder::checkUserData(l, 1, classnameLensFlareComponent, -2019248835133422777, ud)) return -1;
  718. LensFlareComponent* self = static_cast<LensFlareComponent*>(ud->m_data);
  719. ANKI_ASSERT(self != nullptr);
  720. // Pop arguments
  721. if(LuaBinder::checkUserData(l, 2, "Vec2", 6804478823655046388, ud)) return -1;
  722. Vec2* iarg0 = static_cast<Vec2*>(ud->m_data);
  723. const Vec2& arg0(*iarg0);
  724. // Call the method
  725. self->setFirstFlareSize(arg0);
  726. return 0;
  727. }
  728. //==============================================================================
  729. /// Wrap method LensFlareComponent::setFirstFlareSize.
  730. static int wrapLensFlareComponentsetFirstFlareSize(lua_State* l)
  731. {
  732. int res = pwrapLensFlareComponentsetFirstFlareSize(l);
  733. if(res >= 0) return res;
  734. lua_error(l);
  735. return 0;
  736. }
  737. //==============================================================================
  738. /// Pre-wrap method LensFlareComponent::setColorMultiplier.
  739. static inline int pwrapLensFlareComponentsetColorMultiplier(lua_State* l)
  740. {
  741. UserData* ud;
  742. (void)ud;
  743. void* voidp;
  744. (void)voidp;
  745. LuaBinder::checkArgsCount(l, 2);
  746. // Get "this" as "self"
  747. if(LuaBinder::checkUserData(l, 1, classnameLensFlareComponent, -2019248835133422777, ud)) return -1;
  748. LensFlareComponent* self = static_cast<LensFlareComponent*>(ud->m_data);
  749. ANKI_ASSERT(self != nullptr);
  750. // Pop arguments
  751. if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud)) return -1;
  752. Vec4* iarg0 = static_cast<Vec4*>(ud->m_data);
  753. const Vec4& arg0(*iarg0);
  754. // Call the method
  755. self->setColorMultiplier(arg0);
  756. return 0;
  757. }
  758. //==============================================================================
  759. /// Wrap method LensFlareComponent::setColorMultiplier.
  760. static int wrapLensFlareComponentsetColorMultiplier(lua_State* l)
  761. {
  762. int res = pwrapLensFlareComponentsetColorMultiplier(l);
  763. if(res >= 0) return res;
  764. lua_error(l);
  765. return 0;
  766. }
  767. //==============================================================================
  768. /// Wrap class LensFlareComponent.
  769. static inline void wrapLensFlareComponent(lua_State* l)
  770. {
  771. LuaBinder::createClass(l, classnameLensFlareComponent);
  772. LuaBinder::pushLuaCFuncMethod(l, "setFirstFlareSize", wrapLensFlareComponentsetFirstFlareSize);
  773. LuaBinder::pushLuaCFuncMethod(l, "setColorMultiplier", wrapLensFlareComponentsetColorMultiplier);
  774. lua_settop(l, 0);
  775. }
  776. //==============================================================================
  777. // SceneNode =
  778. //==============================================================================
  779. //==============================================================================
  780. static const char* classnameSceneNode = "SceneNode";
  781. template<>
  782. I64 LuaBinder::getWrappedTypeSignature<SceneNode>()
  783. {
  784. return -2220074417980276571;
  785. }
  786. template<>
  787. const char* LuaBinder::getWrappedTypeName<SceneNode>()
  788. {
  789. return classnameSceneNode;
  790. }
  791. //==============================================================================
  792. /// Pre-wrap method SceneNode::getName.
  793. static inline int pwrapSceneNodegetName(lua_State* l)
  794. {
  795. UserData* ud;
  796. (void)ud;
  797. void* voidp;
  798. (void)voidp;
  799. LuaBinder::checkArgsCount(l, 1);
  800. // Get "this" as "self"
  801. if(LuaBinder::checkUserData(l, 1, classnameSceneNode, -2220074417980276571, ud)) return -1;
  802. SceneNode* self = static_cast<SceneNode*>(ud->m_data);
  803. ANKI_ASSERT(self != nullptr);
  804. // Call the method
  805. CString ret = self->getName();
  806. // Push return value
  807. lua_pushstring(l, &ret[0]);
  808. return 1;
  809. }
  810. //==============================================================================
  811. /// Wrap method SceneNode::getName.
  812. static int wrapSceneNodegetName(lua_State* l)
  813. {
  814. int res = pwrapSceneNodegetName(l);
  815. if(res >= 0) return res;
  816. lua_error(l);
  817. return 0;
  818. }
  819. //==============================================================================
  820. /// Pre-wrap method SceneNode::addChild.
  821. static inline int pwrapSceneNodeaddChild(lua_State* l)
  822. {
  823. UserData* ud;
  824. (void)ud;
  825. void* voidp;
  826. (void)voidp;
  827. LuaBinder::checkArgsCount(l, 2);
  828. // Get "this" as "self"
  829. if(LuaBinder::checkUserData(l, 1, classnameSceneNode, -2220074417980276571, ud)) return -1;
  830. SceneNode* self = static_cast<SceneNode*>(ud->m_data);
  831. ANKI_ASSERT(self != nullptr);
  832. // Pop arguments
  833. if(LuaBinder::checkUserData(l, 2, "SceneNode", -2220074417980276571, ud)) return -1;
  834. SceneNode* iarg0 = static_cast<SceneNode*>(ud->m_data);
  835. SceneNode* arg0(iarg0);
  836. // Call the method
  837. self->addChild(arg0);
  838. return 0;
  839. }
  840. //==============================================================================
  841. /// Wrap method SceneNode::addChild.
  842. static int wrapSceneNodeaddChild(lua_State* l)
  843. {
  844. int res = pwrapSceneNodeaddChild(l);
  845. if(res >= 0) return res;
  846. lua_error(l);
  847. return 0;
  848. }
  849. //==============================================================================
  850. /// Pre-wrap method SceneNode::tryGetComponent<MoveComponent>.
  851. static inline int pwrapSceneNodegetMoveComponent(lua_State* l)
  852. {
  853. UserData* ud;
  854. (void)ud;
  855. void* voidp;
  856. (void)voidp;
  857. LuaBinder::checkArgsCount(l, 1);
  858. // Get "this" as "self"
  859. if(LuaBinder::checkUserData(l, 1, classnameSceneNode, -2220074417980276571, ud)) return -1;
  860. SceneNode* self = static_cast<SceneNode*>(ud->m_data);
  861. ANKI_ASSERT(self != nullptr);
  862. // Call the method
  863. MoveComponent* ret = self->tryGetComponent<MoveComponent>();
  864. // Push return value
  865. if(ANKI_UNLIKELY(ret == nullptr))
  866. {
  867. lua_pushstring(l, "Glue code returned nullptr");
  868. return -1;
  869. }
  870. voidp = lua_newuserdata(l, sizeof(UserData));
  871. ud = static_cast<UserData*>(voidp);
  872. luaL_setmetatable(l, "MoveComponent");
  873. ud->m_data = static_cast<void*>(ret);
  874. ud->m_gc = false;
  875. ud->m_sig = 2038493110845313445;
  876. return 1;
  877. }
  878. //==============================================================================
  879. /// Wrap method SceneNode::tryGetComponent<MoveComponent>.
  880. static int wrapSceneNodegetMoveComponent(lua_State* l)
  881. {
  882. int res = pwrapSceneNodegetMoveComponent(l);
  883. if(res >= 0) return res;
  884. lua_error(l);
  885. return 0;
  886. }
  887. //==============================================================================
  888. /// Pre-wrap method SceneNode::tryGetComponent<LightComponent>.
  889. static inline int pwrapSceneNodegetLightComponent(lua_State* l)
  890. {
  891. UserData* ud;
  892. (void)ud;
  893. void* voidp;
  894. (void)voidp;
  895. LuaBinder::checkArgsCount(l, 1);
  896. // Get "this" as "self"
  897. if(LuaBinder::checkUserData(l, 1, classnameSceneNode, -2220074417980276571, ud)) return -1;
  898. SceneNode* self = static_cast<SceneNode*>(ud->m_data);
  899. ANKI_ASSERT(self != nullptr);
  900. // Call the method
  901. LightComponent* ret = self->tryGetComponent<LightComponent>();
  902. // Push return value
  903. if(ANKI_UNLIKELY(ret == nullptr))
  904. {
  905. lua_pushstring(l, "Glue code returned nullptr");
  906. return -1;
  907. }
  908. voidp = lua_newuserdata(l, sizeof(UserData));
  909. ud = static_cast<UserData*>(voidp);
  910. luaL_setmetatable(l, "LightComponent");
  911. ud->m_data = static_cast<void*>(ret);
  912. ud->m_gc = false;
  913. ud->m_sig = 7940823622056993903;
  914. return 1;
  915. }
  916. //==============================================================================
  917. /// Wrap method SceneNode::tryGetComponent<LightComponent>.
  918. static int wrapSceneNodegetLightComponent(lua_State* l)
  919. {
  920. int res = pwrapSceneNodegetLightComponent(l);
  921. if(res >= 0) return res;
  922. lua_error(l);
  923. return 0;
  924. }
  925. //==============================================================================
  926. /// Pre-wrap method SceneNode::tryGetComponent<LensFlareComponent>.
  927. static inline int pwrapSceneNodegetLensFlareComponent(lua_State* l)
  928. {
  929. UserData* ud;
  930. (void)ud;
  931. void* voidp;
  932. (void)voidp;
  933. LuaBinder::checkArgsCount(l, 1);
  934. // Get "this" as "self"
  935. if(LuaBinder::checkUserData(l, 1, classnameSceneNode, -2220074417980276571, ud)) return -1;
  936. SceneNode* self = static_cast<SceneNode*>(ud->m_data);
  937. ANKI_ASSERT(self != nullptr);
  938. // Call the method
  939. LensFlareComponent* ret = self->tryGetComponent<LensFlareComponent>();
  940. // Push return value
  941. if(ANKI_UNLIKELY(ret == nullptr))
  942. {
  943. lua_pushstring(l, "Glue code returned nullptr");
  944. return -1;
  945. }
  946. voidp = lua_newuserdata(l, sizeof(UserData));
  947. ud = static_cast<UserData*>(voidp);
  948. luaL_setmetatable(l, "LensFlareComponent");
  949. ud->m_data = static_cast<void*>(ret);
  950. ud->m_gc = false;
  951. ud->m_sig = -2019248835133422777;
  952. return 1;
  953. }
  954. //==============================================================================
  955. /// Wrap method SceneNode::tryGetComponent<LensFlareComponent>.
  956. static int wrapSceneNodegetLensFlareComponent(lua_State* l)
  957. {
  958. int res = pwrapSceneNodegetLensFlareComponent(l);
  959. if(res >= 0) return res;
  960. lua_error(l);
  961. return 0;
  962. }
  963. //==============================================================================
  964. /// Wrap class SceneNode.
  965. static inline void wrapSceneNode(lua_State* l)
  966. {
  967. LuaBinder::createClass(l, classnameSceneNode);
  968. LuaBinder::pushLuaCFuncMethod(l, "getName", wrapSceneNodegetName);
  969. LuaBinder::pushLuaCFuncMethod(l, "addChild", wrapSceneNodeaddChild);
  970. LuaBinder::pushLuaCFuncMethod(l, "getMoveComponent", wrapSceneNodegetMoveComponent);
  971. LuaBinder::pushLuaCFuncMethod(l, "getLightComponent", wrapSceneNodegetLightComponent);
  972. LuaBinder::pushLuaCFuncMethod(l, "getLensFlareComponent", wrapSceneNodegetLensFlareComponent);
  973. lua_settop(l, 0);
  974. }
  975. //==============================================================================
  976. // ModelNode =
  977. //==============================================================================
  978. //==============================================================================
  979. static const char* classnameModelNode = "ModelNode";
  980. template<>
  981. I64 LuaBinder::getWrappedTypeSignature<ModelNode>()
  982. {
  983. return -1856316251880904290;
  984. }
  985. template<>
  986. const char* LuaBinder::getWrappedTypeName<ModelNode>()
  987. {
  988. return classnameModelNode;
  989. }
  990. //==============================================================================
  991. /// Pre-wrap method ModelNode::getSceneNodeBase.
  992. static inline int pwrapModelNodegetSceneNodeBase(lua_State* l)
  993. {
  994. UserData* ud;
  995. (void)ud;
  996. void* voidp;
  997. (void)voidp;
  998. LuaBinder::checkArgsCount(l, 1);
  999. // Get "this" as "self"
  1000. if(LuaBinder::checkUserData(l, 1, classnameModelNode, -1856316251880904290, ud)) return -1;
  1001. ModelNode* self = static_cast<ModelNode*>(ud->m_data);
  1002. ANKI_ASSERT(self != nullptr);
  1003. // Call the method
  1004. SceneNode& ret = *self;
  1005. // Push return value
  1006. voidp = lua_newuserdata(l, sizeof(UserData));
  1007. ud = static_cast<UserData*>(voidp);
  1008. luaL_setmetatable(l, "SceneNode");
  1009. ud->m_data = static_cast<void*>(&ret);
  1010. ud->m_gc = false;
  1011. ud->m_sig = -2220074417980276571;
  1012. return 1;
  1013. }
  1014. //==============================================================================
  1015. /// Wrap method ModelNode::getSceneNodeBase.
  1016. static int wrapModelNodegetSceneNodeBase(lua_State* l)
  1017. {
  1018. int res = pwrapModelNodegetSceneNodeBase(l);
  1019. if(res >= 0) return res;
  1020. lua_error(l);
  1021. return 0;
  1022. }
  1023. //==============================================================================
  1024. /// Wrap class ModelNode.
  1025. static inline void wrapModelNode(lua_State* l)
  1026. {
  1027. LuaBinder::createClass(l, classnameModelNode);
  1028. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapModelNodegetSceneNodeBase);
  1029. lua_settop(l, 0);
  1030. }
  1031. //==============================================================================
  1032. // InstanceNode =
  1033. //==============================================================================
  1034. //==============================================================================
  1035. static const char* classnameInstanceNode = "InstanceNode";
  1036. template<>
  1037. I64 LuaBinder::getWrappedTypeSignature<InstanceNode>()
  1038. {
  1039. return -2063375830923741403;
  1040. }
  1041. template<>
  1042. const char* LuaBinder::getWrappedTypeName<InstanceNode>()
  1043. {
  1044. return classnameInstanceNode;
  1045. }
  1046. //==============================================================================
  1047. /// Pre-wrap method InstanceNode::getSceneNodeBase.
  1048. static inline int pwrapInstanceNodegetSceneNodeBase(lua_State* l)
  1049. {
  1050. UserData* ud;
  1051. (void)ud;
  1052. void* voidp;
  1053. (void)voidp;
  1054. LuaBinder::checkArgsCount(l, 1);
  1055. // Get "this" as "self"
  1056. if(LuaBinder::checkUserData(l, 1, classnameInstanceNode, -2063375830923741403, ud)) return -1;
  1057. InstanceNode* self = static_cast<InstanceNode*>(ud->m_data);
  1058. ANKI_ASSERT(self != nullptr);
  1059. // Call the method
  1060. SceneNode& ret = *self;
  1061. // Push return value
  1062. voidp = lua_newuserdata(l, sizeof(UserData));
  1063. ud = static_cast<UserData*>(voidp);
  1064. luaL_setmetatable(l, "SceneNode");
  1065. ud->m_data = static_cast<void*>(&ret);
  1066. ud->m_gc = false;
  1067. ud->m_sig = -2220074417980276571;
  1068. return 1;
  1069. }
  1070. //==============================================================================
  1071. /// Wrap method InstanceNode::getSceneNodeBase.
  1072. static int wrapInstanceNodegetSceneNodeBase(lua_State* l)
  1073. {
  1074. int res = pwrapInstanceNodegetSceneNodeBase(l);
  1075. if(res >= 0) return res;
  1076. lua_error(l);
  1077. return 0;
  1078. }
  1079. //==============================================================================
  1080. /// Wrap class InstanceNode.
  1081. static inline void wrapInstanceNode(lua_State* l)
  1082. {
  1083. LuaBinder::createClass(l, classnameInstanceNode);
  1084. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapInstanceNodegetSceneNodeBase);
  1085. lua_settop(l, 0);
  1086. }
  1087. //==============================================================================
  1088. // PointLight =
  1089. //==============================================================================
  1090. //==============================================================================
  1091. static const char* classnamePointLight = "PointLight";
  1092. template<>
  1093. I64 LuaBinder::getWrappedTypeSignature<PointLight>()
  1094. {
  1095. return 3561037663389896020;
  1096. }
  1097. template<>
  1098. const char* LuaBinder::getWrappedTypeName<PointLight>()
  1099. {
  1100. return classnamePointLight;
  1101. }
  1102. //==============================================================================
  1103. /// Pre-wrap method PointLight::getSceneNodeBase.
  1104. static inline int pwrapPointLightgetSceneNodeBase(lua_State* l)
  1105. {
  1106. UserData* ud;
  1107. (void)ud;
  1108. void* voidp;
  1109. (void)voidp;
  1110. LuaBinder::checkArgsCount(l, 1);
  1111. // Get "this" as "self"
  1112. if(LuaBinder::checkUserData(l, 1, classnamePointLight, 3561037663389896020, ud)) return -1;
  1113. PointLight* self = static_cast<PointLight*>(ud->m_data);
  1114. ANKI_ASSERT(self != nullptr);
  1115. // Call the method
  1116. SceneNode& ret = *self;
  1117. // Push return value
  1118. voidp = lua_newuserdata(l, sizeof(UserData));
  1119. ud = static_cast<UserData*>(voidp);
  1120. luaL_setmetatable(l, "SceneNode");
  1121. ud->m_data = static_cast<void*>(&ret);
  1122. ud->m_gc = false;
  1123. ud->m_sig = -2220074417980276571;
  1124. return 1;
  1125. }
  1126. //==============================================================================
  1127. /// Wrap method PointLight::getSceneNodeBase.
  1128. static int wrapPointLightgetSceneNodeBase(lua_State* l)
  1129. {
  1130. int res = pwrapPointLightgetSceneNodeBase(l);
  1131. if(res >= 0) return res;
  1132. lua_error(l);
  1133. return 0;
  1134. }
  1135. //==============================================================================
  1136. /// Pre-wrap method PointLight::loadLensFlare.
  1137. static inline int pwrapPointLightloadLensFlare(lua_State* l)
  1138. {
  1139. UserData* ud;
  1140. (void)ud;
  1141. void* voidp;
  1142. (void)voidp;
  1143. LuaBinder::checkArgsCount(l, 2);
  1144. // Get "this" as "self"
  1145. if(LuaBinder::checkUserData(l, 1, classnamePointLight, 3561037663389896020, ud)) return -1;
  1146. PointLight* self = static_cast<PointLight*>(ud->m_data);
  1147. ANKI_ASSERT(self != nullptr);
  1148. // Pop arguments
  1149. const char* arg0;
  1150. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1151. // Call the method
  1152. Error ret = self->loadLensFlare(arg0);
  1153. // Push return value
  1154. if(ANKI_UNLIKELY(ret))
  1155. {
  1156. lua_pushstring(l, "Glue code returned an error");
  1157. return -1;
  1158. }
  1159. lua_pushnumber(l, ret);
  1160. return 1;
  1161. }
  1162. //==============================================================================
  1163. /// Wrap method PointLight::loadLensFlare.
  1164. static int wrapPointLightloadLensFlare(lua_State* l)
  1165. {
  1166. int res = pwrapPointLightloadLensFlare(l);
  1167. if(res >= 0) return res;
  1168. lua_error(l);
  1169. return 0;
  1170. }
  1171. //==============================================================================
  1172. /// Wrap class PointLight.
  1173. static inline void wrapPointLight(lua_State* l)
  1174. {
  1175. LuaBinder::createClass(l, classnamePointLight);
  1176. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapPointLightgetSceneNodeBase);
  1177. LuaBinder::pushLuaCFuncMethod(l, "loadLensFlare", wrapPointLightloadLensFlare);
  1178. lua_settop(l, 0);
  1179. }
  1180. //==============================================================================
  1181. // SpotLight =
  1182. //==============================================================================
  1183. //==============================================================================
  1184. static const char* classnameSpotLight = "SpotLight";
  1185. template<>
  1186. I64 LuaBinder::getWrappedTypeSignature<SpotLight>()
  1187. {
  1188. return 7940385212889719421;
  1189. }
  1190. template<>
  1191. const char* LuaBinder::getWrappedTypeName<SpotLight>()
  1192. {
  1193. return classnameSpotLight;
  1194. }
  1195. //==============================================================================
  1196. /// Pre-wrap method SpotLight::getSceneNodeBase.
  1197. static inline int pwrapSpotLightgetSceneNodeBase(lua_State* l)
  1198. {
  1199. UserData* ud;
  1200. (void)ud;
  1201. void* voidp;
  1202. (void)voidp;
  1203. LuaBinder::checkArgsCount(l, 1);
  1204. // Get "this" as "self"
  1205. if(LuaBinder::checkUserData(l, 1, classnameSpotLight, 7940385212889719421, ud)) return -1;
  1206. SpotLight* self = static_cast<SpotLight*>(ud->m_data);
  1207. ANKI_ASSERT(self != nullptr);
  1208. // Call the method
  1209. SceneNode& ret = *self;
  1210. // Push return value
  1211. voidp = lua_newuserdata(l, sizeof(UserData));
  1212. ud = static_cast<UserData*>(voidp);
  1213. luaL_setmetatable(l, "SceneNode");
  1214. ud->m_data = static_cast<void*>(&ret);
  1215. ud->m_gc = false;
  1216. ud->m_sig = -2220074417980276571;
  1217. return 1;
  1218. }
  1219. //==============================================================================
  1220. /// Wrap method SpotLight::getSceneNodeBase.
  1221. static int wrapSpotLightgetSceneNodeBase(lua_State* l)
  1222. {
  1223. int res = pwrapSpotLightgetSceneNodeBase(l);
  1224. if(res >= 0) return res;
  1225. lua_error(l);
  1226. return 0;
  1227. }
  1228. //==============================================================================
  1229. /// Wrap class SpotLight.
  1230. static inline void wrapSpotLight(lua_State* l)
  1231. {
  1232. LuaBinder::createClass(l, classnameSpotLight);
  1233. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapSpotLightgetSceneNodeBase);
  1234. lua_settop(l, 0);
  1235. }
  1236. //==============================================================================
  1237. // StaticCollisionNode =
  1238. //==============================================================================
  1239. //==============================================================================
  1240. static const char* classnameStaticCollisionNode = "StaticCollisionNode";
  1241. template<>
  1242. I64 LuaBinder::getWrappedTypeSignature<StaticCollisionNode>()
  1243. {
  1244. return -4376619865753613291;
  1245. }
  1246. template<>
  1247. const char* LuaBinder::getWrappedTypeName<StaticCollisionNode>()
  1248. {
  1249. return classnameStaticCollisionNode;
  1250. }
  1251. //==============================================================================
  1252. /// Pre-wrap method StaticCollisionNode::getSceneNodeBase.
  1253. static inline int pwrapStaticCollisionNodegetSceneNodeBase(lua_State* l)
  1254. {
  1255. UserData* ud;
  1256. (void)ud;
  1257. void* voidp;
  1258. (void)voidp;
  1259. LuaBinder::checkArgsCount(l, 1);
  1260. // Get "this" as "self"
  1261. if(LuaBinder::checkUserData(l, 1, classnameStaticCollisionNode, -4376619865753613291, ud)) return -1;
  1262. StaticCollisionNode* self = static_cast<StaticCollisionNode*>(ud->m_data);
  1263. ANKI_ASSERT(self != nullptr);
  1264. // Call the method
  1265. SceneNode& ret = *self;
  1266. // Push return value
  1267. voidp = lua_newuserdata(l, sizeof(UserData));
  1268. ud = static_cast<UserData*>(voidp);
  1269. luaL_setmetatable(l, "SceneNode");
  1270. ud->m_data = static_cast<void*>(&ret);
  1271. ud->m_gc = false;
  1272. ud->m_sig = -2220074417980276571;
  1273. return 1;
  1274. }
  1275. //==============================================================================
  1276. /// Wrap method StaticCollisionNode::getSceneNodeBase.
  1277. static int wrapStaticCollisionNodegetSceneNodeBase(lua_State* l)
  1278. {
  1279. int res = pwrapStaticCollisionNodegetSceneNodeBase(l);
  1280. if(res >= 0) return res;
  1281. lua_error(l);
  1282. return 0;
  1283. }
  1284. //==============================================================================
  1285. /// Wrap class StaticCollisionNode.
  1286. static inline void wrapStaticCollisionNode(lua_State* l)
  1287. {
  1288. LuaBinder::createClass(l, classnameStaticCollisionNode);
  1289. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapStaticCollisionNodegetSceneNodeBase);
  1290. lua_settop(l, 0);
  1291. }
  1292. //==============================================================================
  1293. // Portal =
  1294. //==============================================================================
  1295. //==============================================================================
  1296. static const char* classnamePortal = "Portal";
  1297. template<>
  1298. I64 LuaBinder::getWrappedTypeSignature<Portal>()
  1299. {
  1300. return 7450426072538297652;
  1301. }
  1302. template<>
  1303. const char* LuaBinder::getWrappedTypeName<Portal>()
  1304. {
  1305. return classnamePortal;
  1306. }
  1307. //==============================================================================
  1308. /// Pre-wrap method Portal::getSceneNodeBase.
  1309. static inline int pwrapPortalgetSceneNodeBase(lua_State* l)
  1310. {
  1311. UserData* ud;
  1312. (void)ud;
  1313. void* voidp;
  1314. (void)voidp;
  1315. LuaBinder::checkArgsCount(l, 1);
  1316. // Get "this" as "self"
  1317. if(LuaBinder::checkUserData(l, 1, classnamePortal, 7450426072538297652, ud)) return -1;
  1318. Portal* self = static_cast<Portal*>(ud->m_data);
  1319. ANKI_ASSERT(self != nullptr);
  1320. // Call the method
  1321. SceneNode& ret = *self;
  1322. // Push return value
  1323. voidp = lua_newuserdata(l, sizeof(UserData));
  1324. ud = static_cast<UserData*>(voidp);
  1325. luaL_setmetatable(l, "SceneNode");
  1326. ud->m_data = static_cast<void*>(&ret);
  1327. ud->m_gc = false;
  1328. ud->m_sig = -2220074417980276571;
  1329. return 1;
  1330. }
  1331. //==============================================================================
  1332. /// Wrap method Portal::getSceneNodeBase.
  1333. static int wrapPortalgetSceneNodeBase(lua_State* l)
  1334. {
  1335. int res = pwrapPortalgetSceneNodeBase(l);
  1336. if(res >= 0) return res;
  1337. lua_error(l);
  1338. return 0;
  1339. }
  1340. //==============================================================================
  1341. /// Wrap class Portal.
  1342. static inline void wrapPortal(lua_State* l)
  1343. {
  1344. LuaBinder::createClass(l, classnamePortal);
  1345. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapPortalgetSceneNodeBase);
  1346. lua_settop(l, 0);
  1347. }
  1348. //==============================================================================
  1349. // Sector =
  1350. //==============================================================================
  1351. //==============================================================================
  1352. static const char* classnameSector = "Sector";
  1353. template<>
  1354. I64 LuaBinder::getWrappedTypeSignature<Sector>()
  1355. {
  1356. return 2371391302432627552;
  1357. }
  1358. template<>
  1359. const char* LuaBinder::getWrappedTypeName<Sector>()
  1360. {
  1361. return classnameSector;
  1362. }
  1363. //==============================================================================
  1364. /// Pre-wrap method Sector::getSceneNodeBase.
  1365. static inline int pwrapSectorgetSceneNodeBase(lua_State* l)
  1366. {
  1367. UserData* ud;
  1368. (void)ud;
  1369. void* voidp;
  1370. (void)voidp;
  1371. LuaBinder::checkArgsCount(l, 1);
  1372. // Get "this" as "self"
  1373. if(LuaBinder::checkUserData(l, 1, classnameSector, 2371391302432627552, ud)) return -1;
  1374. Sector* self = static_cast<Sector*>(ud->m_data);
  1375. ANKI_ASSERT(self != nullptr);
  1376. // Call the method
  1377. SceneNode& ret = *self;
  1378. // Push return value
  1379. voidp = lua_newuserdata(l, sizeof(UserData));
  1380. ud = static_cast<UserData*>(voidp);
  1381. luaL_setmetatable(l, "SceneNode");
  1382. ud->m_data = static_cast<void*>(&ret);
  1383. ud->m_gc = false;
  1384. ud->m_sig = -2220074417980276571;
  1385. return 1;
  1386. }
  1387. //==============================================================================
  1388. /// Wrap method Sector::getSceneNodeBase.
  1389. static int wrapSectorgetSceneNodeBase(lua_State* l)
  1390. {
  1391. int res = pwrapSectorgetSceneNodeBase(l);
  1392. if(res >= 0) return res;
  1393. lua_error(l);
  1394. return 0;
  1395. }
  1396. //==============================================================================
  1397. /// Wrap class Sector.
  1398. static inline void wrapSector(lua_State* l)
  1399. {
  1400. LuaBinder::createClass(l, classnameSector);
  1401. LuaBinder::pushLuaCFuncMethod(l, "getSceneNodeBase", wrapSectorgetSceneNodeBase);
  1402. lua_settop(l, 0);
  1403. }
  1404. //==============================================================================
  1405. // SceneGraph =
  1406. //==============================================================================
  1407. //==============================================================================
  1408. static const char* classnameSceneGraph = "SceneGraph";
  1409. template<>
  1410. I64 LuaBinder::getWrappedTypeSignature<SceneGraph>()
  1411. {
  1412. return -7754439619132389154;
  1413. }
  1414. template<>
  1415. const char* LuaBinder::getWrappedTypeName<SceneGraph>()
  1416. {
  1417. return classnameSceneGraph;
  1418. }
  1419. //==============================================================================
  1420. /// Pre-wrap method SceneGraph::newModelNode.
  1421. static inline int pwrapSceneGraphnewModelNode(lua_State* l)
  1422. {
  1423. UserData* ud;
  1424. (void)ud;
  1425. void* voidp;
  1426. (void)voidp;
  1427. LuaBinder::checkArgsCount(l, 3);
  1428. // Get "this" as "self"
  1429. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1430. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1431. ANKI_ASSERT(self != nullptr);
  1432. // Pop arguments
  1433. const char* arg0;
  1434. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1435. const char* arg1;
  1436. if(LuaBinder::checkString(l, 3, arg1)) return -1;
  1437. // Call the method
  1438. ModelNode* ret = newSceneNode<ModelNode>(self, arg0, arg1);
  1439. // Push return value
  1440. if(ANKI_UNLIKELY(ret == nullptr))
  1441. {
  1442. lua_pushstring(l, "Glue code returned nullptr");
  1443. return -1;
  1444. }
  1445. voidp = lua_newuserdata(l, sizeof(UserData));
  1446. ud = static_cast<UserData*>(voidp);
  1447. luaL_setmetatable(l, "ModelNode");
  1448. ud->m_data = static_cast<void*>(ret);
  1449. ud->m_gc = false;
  1450. ud->m_sig = -1856316251880904290;
  1451. return 1;
  1452. }
  1453. //==============================================================================
  1454. /// Wrap method SceneGraph::newModelNode.
  1455. static int wrapSceneGraphnewModelNode(lua_State* l)
  1456. {
  1457. int res = pwrapSceneGraphnewModelNode(l);
  1458. if(res >= 0) return res;
  1459. lua_error(l);
  1460. return 0;
  1461. }
  1462. //==============================================================================
  1463. /// Pre-wrap method SceneGraph::newInstanceNode.
  1464. static inline int pwrapSceneGraphnewInstanceNode(lua_State* l)
  1465. {
  1466. UserData* ud;
  1467. (void)ud;
  1468. void* voidp;
  1469. (void)voidp;
  1470. LuaBinder::checkArgsCount(l, 2);
  1471. // Get "this" as "self"
  1472. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1473. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1474. ANKI_ASSERT(self != nullptr);
  1475. // Pop arguments
  1476. const char* arg0;
  1477. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1478. // Call the method
  1479. InstanceNode* ret = newSceneNode<InstanceNode>(self, arg0);
  1480. // Push return value
  1481. if(ANKI_UNLIKELY(ret == nullptr))
  1482. {
  1483. lua_pushstring(l, "Glue code returned nullptr");
  1484. return -1;
  1485. }
  1486. voidp = lua_newuserdata(l, sizeof(UserData));
  1487. ud = static_cast<UserData*>(voidp);
  1488. luaL_setmetatable(l, "InstanceNode");
  1489. ud->m_data = static_cast<void*>(ret);
  1490. ud->m_gc = false;
  1491. ud->m_sig = -2063375830923741403;
  1492. return 1;
  1493. }
  1494. //==============================================================================
  1495. /// Wrap method SceneGraph::newInstanceNode.
  1496. static int wrapSceneGraphnewInstanceNode(lua_State* l)
  1497. {
  1498. int res = pwrapSceneGraphnewInstanceNode(l);
  1499. if(res >= 0) return res;
  1500. lua_error(l);
  1501. return 0;
  1502. }
  1503. //==============================================================================
  1504. /// Pre-wrap method SceneGraph::newPointLight.
  1505. static inline int pwrapSceneGraphnewPointLight(lua_State* l)
  1506. {
  1507. UserData* ud;
  1508. (void)ud;
  1509. void* voidp;
  1510. (void)voidp;
  1511. LuaBinder::checkArgsCount(l, 2);
  1512. // Get "this" as "self"
  1513. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1514. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1515. ANKI_ASSERT(self != nullptr);
  1516. // Pop arguments
  1517. const char* arg0;
  1518. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1519. // Call the method
  1520. PointLight* ret = newSceneNode<PointLight>(self, arg0);
  1521. // Push return value
  1522. if(ANKI_UNLIKELY(ret == nullptr))
  1523. {
  1524. lua_pushstring(l, "Glue code returned nullptr");
  1525. return -1;
  1526. }
  1527. voidp = lua_newuserdata(l, sizeof(UserData));
  1528. ud = static_cast<UserData*>(voidp);
  1529. luaL_setmetatable(l, "PointLight");
  1530. ud->m_data = static_cast<void*>(ret);
  1531. ud->m_gc = false;
  1532. ud->m_sig = 3561037663389896020;
  1533. return 1;
  1534. }
  1535. //==============================================================================
  1536. /// Wrap method SceneGraph::newPointLight.
  1537. static int wrapSceneGraphnewPointLight(lua_State* l)
  1538. {
  1539. int res = pwrapSceneGraphnewPointLight(l);
  1540. if(res >= 0) return res;
  1541. lua_error(l);
  1542. return 0;
  1543. }
  1544. //==============================================================================
  1545. /// Pre-wrap method SceneGraph::newSpotLight.
  1546. static inline int pwrapSceneGraphnewSpotLight(lua_State* l)
  1547. {
  1548. UserData* ud;
  1549. (void)ud;
  1550. void* voidp;
  1551. (void)voidp;
  1552. LuaBinder::checkArgsCount(l, 2);
  1553. // Get "this" as "self"
  1554. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1555. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1556. ANKI_ASSERT(self != nullptr);
  1557. // Pop arguments
  1558. const char* arg0;
  1559. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1560. // Call the method
  1561. SpotLight* ret = newSceneNode<SpotLight>(self, arg0);
  1562. // Push return value
  1563. if(ANKI_UNLIKELY(ret == nullptr))
  1564. {
  1565. lua_pushstring(l, "Glue code returned nullptr");
  1566. return -1;
  1567. }
  1568. voidp = lua_newuserdata(l, sizeof(UserData));
  1569. ud = static_cast<UserData*>(voidp);
  1570. luaL_setmetatable(l, "SpotLight");
  1571. ud->m_data = static_cast<void*>(ret);
  1572. ud->m_gc = false;
  1573. ud->m_sig = 7940385212889719421;
  1574. return 1;
  1575. }
  1576. //==============================================================================
  1577. /// Wrap method SceneGraph::newSpotLight.
  1578. static int wrapSceneGraphnewSpotLight(lua_State* l)
  1579. {
  1580. int res = pwrapSceneGraphnewSpotLight(l);
  1581. if(res >= 0) return res;
  1582. lua_error(l);
  1583. return 0;
  1584. }
  1585. //==============================================================================
  1586. /// Pre-wrap method SceneGraph::newStaticCollisionNode.
  1587. static inline int pwrapSceneGraphnewStaticCollisionNode(lua_State* l)
  1588. {
  1589. UserData* ud;
  1590. (void)ud;
  1591. void* voidp;
  1592. (void)voidp;
  1593. LuaBinder::checkArgsCount(l, 3);
  1594. // Get "this" as "self"
  1595. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1596. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1597. ANKI_ASSERT(self != nullptr);
  1598. // Pop arguments
  1599. const char* arg0;
  1600. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1601. const char* arg1;
  1602. if(LuaBinder::checkString(l, 3, arg1)) return -1;
  1603. // Call the method
  1604. StaticCollisionNode* ret = newSceneNode<StaticCollisionNode>(self, arg0, arg1);
  1605. // Push return value
  1606. if(ANKI_UNLIKELY(ret == nullptr))
  1607. {
  1608. lua_pushstring(l, "Glue code returned nullptr");
  1609. return -1;
  1610. }
  1611. voidp = lua_newuserdata(l, sizeof(UserData));
  1612. ud = static_cast<UserData*>(voidp);
  1613. luaL_setmetatable(l, "StaticCollisionNode");
  1614. ud->m_data = static_cast<void*>(ret);
  1615. ud->m_gc = false;
  1616. ud->m_sig = -4376619865753613291;
  1617. return 1;
  1618. }
  1619. //==============================================================================
  1620. /// Wrap method SceneGraph::newStaticCollisionNode.
  1621. static int wrapSceneGraphnewStaticCollisionNode(lua_State* l)
  1622. {
  1623. int res = pwrapSceneGraphnewStaticCollisionNode(l);
  1624. if(res >= 0) return res;
  1625. lua_error(l);
  1626. return 0;
  1627. }
  1628. //==============================================================================
  1629. /// Pre-wrap method SceneGraph::newPortal.
  1630. static inline int pwrapSceneGraphnewPortal(lua_State* l)
  1631. {
  1632. UserData* ud;
  1633. (void)ud;
  1634. void* voidp;
  1635. (void)voidp;
  1636. LuaBinder::checkArgsCount(l, 3);
  1637. // Get "this" as "self"
  1638. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1639. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1640. ANKI_ASSERT(self != nullptr);
  1641. // Pop arguments
  1642. const char* arg0;
  1643. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1644. const char* arg1;
  1645. if(LuaBinder::checkString(l, 3, arg1)) return -1;
  1646. // Call the method
  1647. Portal* ret = newSceneNode<Portal>(self, arg0, arg1);
  1648. // Push return value
  1649. if(ANKI_UNLIKELY(ret == nullptr))
  1650. {
  1651. lua_pushstring(l, "Glue code returned nullptr");
  1652. return -1;
  1653. }
  1654. voidp = lua_newuserdata(l, sizeof(UserData));
  1655. ud = static_cast<UserData*>(voidp);
  1656. luaL_setmetatable(l, "Portal");
  1657. ud->m_data = static_cast<void*>(ret);
  1658. ud->m_gc = false;
  1659. ud->m_sig = 7450426072538297652;
  1660. return 1;
  1661. }
  1662. //==============================================================================
  1663. /// Wrap method SceneGraph::newPortal.
  1664. static int wrapSceneGraphnewPortal(lua_State* l)
  1665. {
  1666. int res = pwrapSceneGraphnewPortal(l);
  1667. if(res >= 0) return res;
  1668. lua_error(l);
  1669. return 0;
  1670. }
  1671. //==============================================================================
  1672. /// Pre-wrap method SceneGraph::newSector.
  1673. static inline int pwrapSceneGraphnewSector(lua_State* l)
  1674. {
  1675. UserData* ud;
  1676. (void)ud;
  1677. void* voidp;
  1678. (void)voidp;
  1679. LuaBinder::checkArgsCount(l, 3);
  1680. // Get "this" as "self"
  1681. if(LuaBinder::checkUserData(l, 1, classnameSceneGraph, -7754439619132389154, ud)) return -1;
  1682. SceneGraph* self = static_cast<SceneGraph*>(ud->m_data);
  1683. ANKI_ASSERT(self != nullptr);
  1684. // Pop arguments
  1685. const char* arg0;
  1686. if(LuaBinder::checkString(l, 2, arg0)) return -1;
  1687. const char* arg1;
  1688. if(LuaBinder::checkString(l, 3, arg1)) return -1;
  1689. // Call the method
  1690. Sector* ret = newSceneNode<Sector>(self, arg0, arg1);
  1691. // Push return value
  1692. if(ANKI_UNLIKELY(ret == nullptr))
  1693. {
  1694. lua_pushstring(l, "Glue code returned nullptr");
  1695. return -1;
  1696. }
  1697. voidp = lua_newuserdata(l, sizeof(UserData));
  1698. ud = static_cast<UserData*>(voidp);
  1699. luaL_setmetatable(l, "Sector");
  1700. ud->m_data = static_cast<void*>(ret);
  1701. ud->m_gc = false;
  1702. ud->m_sig = 2371391302432627552;
  1703. return 1;
  1704. }
  1705. //==============================================================================
  1706. /// Wrap method SceneGraph::newSector.
  1707. static int wrapSceneGraphnewSector(lua_State* l)
  1708. {
  1709. int res = pwrapSceneGraphnewSector(l);
  1710. if(res >= 0) return res;
  1711. lua_error(l);
  1712. return 0;
  1713. }
  1714. //==============================================================================
  1715. /// Wrap class SceneGraph.
  1716. static inline void wrapSceneGraph(lua_State* l)
  1717. {
  1718. LuaBinder::createClass(l, classnameSceneGraph);
  1719. LuaBinder::pushLuaCFuncMethod(l, "newModelNode", wrapSceneGraphnewModelNode);
  1720. LuaBinder::pushLuaCFuncMethod(l, "newInstanceNode", wrapSceneGraphnewInstanceNode);
  1721. LuaBinder::pushLuaCFuncMethod(l, "newPointLight", wrapSceneGraphnewPointLight);
  1722. LuaBinder::pushLuaCFuncMethod(l, "newSpotLight", wrapSceneGraphnewSpotLight);
  1723. LuaBinder::pushLuaCFuncMethod(l, "newStaticCollisionNode", wrapSceneGraphnewStaticCollisionNode);
  1724. LuaBinder::pushLuaCFuncMethod(l, "newPortal", wrapSceneGraphnewPortal);
  1725. LuaBinder::pushLuaCFuncMethod(l, "newSector", wrapSceneGraphnewSector);
  1726. lua_settop(l, 0);
  1727. }
  1728. //==============================================================================
  1729. /// Pre-wrap function getSceneGraph.
  1730. static inline int pwrapgetSceneGraph(lua_State* l)
  1731. {
  1732. UserData* ud;
  1733. (void)ud;
  1734. void* voidp;
  1735. (void)voidp;
  1736. LuaBinder::checkArgsCount(l, 0);
  1737. // Call the function
  1738. SceneGraph* ret = getSceneGraph(l);
  1739. // Push return value
  1740. if(ANKI_UNLIKELY(ret == nullptr))
  1741. {
  1742. lua_pushstring(l, "Glue code returned nullptr");
  1743. return -1;
  1744. }
  1745. voidp = lua_newuserdata(l, sizeof(UserData));
  1746. ud = static_cast<UserData*>(voidp);
  1747. luaL_setmetatable(l, "SceneGraph");
  1748. ud->m_data = static_cast<void*>(ret);
  1749. ud->m_gc = false;
  1750. ud->m_sig = -7754439619132389154;
  1751. return 1;
  1752. }
  1753. //==============================================================================
  1754. /// Wrap function getSceneGraph.
  1755. static int wrapgetSceneGraph(lua_State* l)
  1756. {
  1757. int res = pwrapgetSceneGraph(l);
  1758. if(res >= 0) return res;
  1759. lua_error(l);
  1760. return 0;
  1761. }
  1762. //==============================================================================
  1763. /// Wrap the module.
  1764. void wrapModuleScene(lua_State* l)
  1765. {
  1766. wrapMoveComponent(l);
  1767. wrapLightComponent(l);
  1768. wrapLensFlareComponent(l);
  1769. wrapSceneNode(l);
  1770. wrapModelNode(l);
  1771. wrapInstanceNode(l);
  1772. wrapPointLight(l);
  1773. wrapSpotLight(l);
  1774. wrapStaticCollisionNode(l);
  1775. wrapPortal(l);
  1776. wrapSector(l);
  1777. wrapSceneGraph(l);
  1778. LuaBinder::pushLuaCFunc(l, "getSceneGraph", wrapgetSceneGraph);
  1779. }
  1780. } // end namespace anki