lua_Matrix.cpp 123 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_Matrix.h"
  4. #include "Base.h"
  5. #include "MathUtil.h"
  6. #include "Matrix.h"
  7. #include "Plane.h"
  8. #include "Quaternion.h"
  9. namespace gameplay
  10. {
  11. void luaRegister_Matrix()
  12. {
  13. const luaL_Reg lua_members[] =
  14. {
  15. {"add", lua_Matrix_add},
  16. {"decompose", lua_Matrix_decompose},
  17. {"determinant", lua_Matrix_determinant},
  18. {"getBackVector", lua_Matrix_getBackVector},
  19. {"getDownVector", lua_Matrix_getDownVector},
  20. {"getForwardVector", lua_Matrix_getForwardVector},
  21. {"getLeftVector", lua_Matrix_getLeftVector},
  22. {"getRightVector", lua_Matrix_getRightVector},
  23. {"getRotation", lua_Matrix_getRotation},
  24. {"getScale", lua_Matrix_getScale},
  25. {"getTranslation", lua_Matrix_getTranslation},
  26. {"getUpVector", lua_Matrix_getUpVector},
  27. {"invert", lua_Matrix_invert},
  28. {"isIdentity", lua_Matrix_isIdentity},
  29. {"m", lua_Matrix_m},
  30. {"multiply", lua_Matrix_multiply},
  31. {"negate", lua_Matrix_negate},
  32. {"rotate", lua_Matrix_rotate},
  33. {"rotateX", lua_Matrix_rotateX},
  34. {"rotateY", lua_Matrix_rotateY},
  35. {"rotateZ", lua_Matrix_rotateZ},
  36. {"scale", lua_Matrix_scale},
  37. {"set", lua_Matrix_set},
  38. {"setIdentity", lua_Matrix_setIdentity},
  39. {"setZero", lua_Matrix_setZero},
  40. {"subtract", lua_Matrix_subtract},
  41. {"transformPoint", lua_Matrix_transformPoint},
  42. {"transformVector", lua_Matrix_transformVector},
  43. {"translate", lua_Matrix_translate},
  44. {"transpose", lua_Matrix_transpose},
  45. {NULL, NULL}
  46. };
  47. const luaL_Reg lua_statics[] =
  48. {
  49. {"add", lua_Matrix_static_add},
  50. {"createBillboard", lua_Matrix_static_createBillboard},
  51. {"createLookAt", lua_Matrix_static_createLookAt},
  52. {"createOrthographic", lua_Matrix_static_createOrthographic},
  53. {"createOrthographicOffCenter", lua_Matrix_static_createOrthographicOffCenter},
  54. {"createPerspective", lua_Matrix_static_createPerspective},
  55. {"createReflection", lua_Matrix_static_createReflection},
  56. {"createRotation", lua_Matrix_static_createRotation},
  57. {"createRotationX", lua_Matrix_static_createRotationX},
  58. {"createRotationY", lua_Matrix_static_createRotationY},
  59. {"createRotationZ", lua_Matrix_static_createRotationZ},
  60. {"createScale", lua_Matrix_static_createScale},
  61. {"createTranslation", lua_Matrix_static_createTranslation},
  62. {"identity", lua_Matrix_static_identity},
  63. {"multiply", lua_Matrix_static_multiply},
  64. {"subtract", lua_Matrix_static_subtract},
  65. {"zero", lua_Matrix_static_zero},
  66. {NULL, NULL}
  67. };
  68. std::vector<std::string> scopePath;
  69. gameplay::ScriptUtil::registerClass("Matrix", lua_members, lua_Matrix__init, lua_Matrix__gc, lua_statics, scopePath);
  70. }
  71. static Matrix* getInstance(lua_State* state)
  72. {
  73. void* userdata = luaL_checkudata(state, 1, "Matrix");
  74. luaL_argcheck(state, userdata != NULL, 1, "'Matrix' expected.");
  75. return (Matrix*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
  76. }
  77. int lua_Matrix__gc(lua_State* state)
  78. {
  79. // Get the number of parameters.
  80. int paramCount = lua_gettop(state);
  81. // Attempt to match the parameters to a valid binding.
  82. switch (paramCount)
  83. {
  84. case 1:
  85. {
  86. if ((lua_type(state, 1) == LUA_TUSERDATA))
  87. {
  88. void* userdata = luaL_checkudata(state, 1, "Matrix");
  89. luaL_argcheck(state, userdata != NULL, 1, "'Matrix' expected.");
  90. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
  91. if (object->owns)
  92. {
  93. Matrix* instance = (Matrix*)object->instance;
  94. SAFE_DELETE(instance);
  95. }
  96. return 0;
  97. }
  98. lua_pushstring(state, "lua_Matrix__gc - Failed to match the given parameters to a valid function signature.");
  99. lua_error(state);
  100. break;
  101. }
  102. default:
  103. {
  104. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  105. lua_error(state);
  106. break;
  107. }
  108. }
  109. return 0;
  110. }
  111. int lua_Matrix__init(lua_State* state)
  112. {
  113. // Get the number of parameters.
  114. int paramCount = lua_gettop(state);
  115. // Attempt to match the parameters to a valid binding.
  116. switch (paramCount)
  117. {
  118. case 0:
  119. {
  120. void* returnPtr = (void*)new Matrix();
  121. if (returnPtr)
  122. {
  123. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  124. object->instance = returnPtr;
  125. object->owns = true;
  126. luaL_getmetatable(state, "Matrix");
  127. lua_setmetatable(state, -2);
  128. }
  129. else
  130. {
  131. lua_pushnil(state);
  132. }
  133. return 1;
  134. break;
  135. }
  136. case 1:
  137. {
  138. do
  139. {
  140. if ((lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TLIGHTUSERDATA))
  141. {
  142. // Get parameter 1 off the stack.
  143. gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(1);
  144. void* returnPtr = (void*)new Matrix(param1);
  145. if (returnPtr)
  146. {
  147. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  148. object->instance = returnPtr;
  149. object->owns = true;
  150. luaL_getmetatable(state, "Matrix");
  151. lua_setmetatable(state, -2);
  152. }
  153. else
  154. {
  155. lua_pushnil(state);
  156. }
  157. return 1;
  158. }
  159. } while (0);
  160. do
  161. {
  162. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  163. {
  164. // Get parameter 1 off the stack.
  165. bool param1Valid;
  166. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(1, "Matrix", true, &param1Valid);
  167. if (!param1Valid)
  168. break;
  169. void* returnPtr = (void*)new Matrix(*param1);
  170. if (returnPtr)
  171. {
  172. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  173. object->instance = returnPtr;
  174. object->owns = true;
  175. luaL_getmetatable(state, "Matrix");
  176. lua_setmetatable(state, -2);
  177. }
  178. else
  179. {
  180. lua_pushnil(state);
  181. }
  182. return 1;
  183. }
  184. } while (0);
  185. lua_pushstring(state, "lua_Matrix__init - Failed to match the given parameters to a valid function signature.");
  186. lua_error(state);
  187. break;
  188. }
  189. case 16:
  190. {
  191. do
  192. {
  193. if (lua_type(state, 1) == LUA_TNUMBER &&
  194. lua_type(state, 2) == LUA_TNUMBER &&
  195. lua_type(state, 3) == LUA_TNUMBER &&
  196. lua_type(state, 4) == LUA_TNUMBER &&
  197. lua_type(state, 5) == LUA_TNUMBER &&
  198. lua_type(state, 6) == LUA_TNUMBER &&
  199. lua_type(state, 7) == LUA_TNUMBER &&
  200. lua_type(state, 8) == LUA_TNUMBER &&
  201. lua_type(state, 9) == LUA_TNUMBER &&
  202. lua_type(state, 10) == LUA_TNUMBER &&
  203. lua_type(state, 11) == LUA_TNUMBER &&
  204. lua_type(state, 12) == LUA_TNUMBER &&
  205. lua_type(state, 13) == LUA_TNUMBER &&
  206. lua_type(state, 14) == LUA_TNUMBER &&
  207. lua_type(state, 15) == LUA_TNUMBER &&
  208. lua_type(state, 16) == LUA_TNUMBER)
  209. {
  210. // Get parameter 1 off the stack.
  211. float param1 = (float)luaL_checknumber(state, 1);
  212. // Get parameter 2 off the stack.
  213. float param2 = (float)luaL_checknumber(state, 2);
  214. // Get parameter 3 off the stack.
  215. float param3 = (float)luaL_checknumber(state, 3);
  216. // Get parameter 4 off the stack.
  217. float param4 = (float)luaL_checknumber(state, 4);
  218. // Get parameter 5 off the stack.
  219. float param5 = (float)luaL_checknumber(state, 5);
  220. // Get parameter 6 off the stack.
  221. float param6 = (float)luaL_checknumber(state, 6);
  222. // Get parameter 7 off the stack.
  223. float param7 = (float)luaL_checknumber(state, 7);
  224. // Get parameter 8 off the stack.
  225. float param8 = (float)luaL_checknumber(state, 8);
  226. // Get parameter 9 off the stack.
  227. float param9 = (float)luaL_checknumber(state, 9);
  228. // Get parameter 10 off the stack.
  229. float param10 = (float)luaL_checknumber(state, 10);
  230. // Get parameter 11 off the stack.
  231. float param11 = (float)luaL_checknumber(state, 11);
  232. // Get parameter 12 off the stack.
  233. float param12 = (float)luaL_checknumber(state, 12);
  234. // Get parameter 13 off the stack.
  235. float param13 = (float)luaL_checknumber(state, 13);
  236. // Get parameter 14 off the stack.
  237. float param14 = (float)luaL_checknumber(state, 14);
  238. // Get parameter 15 off the stack.
  239. float param15 = (float)luaL_checknumber(state, 15);
  240. // Get parameter 16 off the stack.
  241. float param16 = (float)luaL_checknumber(state, 16);
  242. void* returnPtr = (void*)new Matrix(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16);
  243. if (returnPtr)
  244. {
  245. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  246. object->instance = returnPtr;
  247. object->owns = true;
  248. luaL_getmetatable(state, "Matrix");
  249. lua_setmetatable(state, -2);
  250. }
  251. else
  252. {
  253. lua_pushnil(state);
  254. }
  255. return 1;
  256. }
  257. } while (0);
  258. lua_pushstring(state, "lua_Matrix__init - Failed to match the given parameters to a valid function signature.");
  259. lua_error(state);
  260. break;
  261. }
  262. default:
  263. {
  264. lua_pushstring(state, "Invalid number of parameters (expected 0, 1 or 16).");
  265. lua_error(state);
  266. break;
  267. }
  268. }
  269. return 0;
  270. }
  271. int lua_Matrix_add(lua_State* state)
  272. {
  273. // Get the number of parameters.
  274. int paramCount = lua_gettop(state);
  275. // Attempt to match the parameters to a valid binding.
  276. switch (paramCount)
  277. {
  278. case 2:
  279. {
  280. do
  281. {
  282. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  283. lua_type(state, 2) == LUA_TNUMBER)
  284. {
  285. // Get parameter 1 off the stack.
  286. float param1 = (float)luaL_checknumber(state, 2);
  287. Matrix* instance = getInstance(state);
  288. instance->add(param1);
  289. return 0;
  290. }
  291. } while (0);
  292. do
  293. {
  294. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  295. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  296. {
  297. // Get parameter 1 off the stack.
  298. bool param1Valid;
  299. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
  300. if (!param1Valid)
  301. break;
  302. Matrix* instance = getInstance(state);
  303. instance->add(*param1);
  304. return 0;
  305. }
  306. } while (0);
  307. lua_pushstring(state, "lua_Matrix_add - Failed to match the given parameters to a valid function signature.");
  308. lua_error(state);
  309. break;
  310. }
  311. case 3:
  312. {
  313. do
  314. {
  315. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  316. lua_type(state, 2) == LUA_TNUMBER &&
  317. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  318. {
  319. // Get parameter 1 off the stack.
  320. float param1 = (float)luaL_checknumber(state, 2);
  321. // Get parameter 2 off the stack.
  322. bool param2Valid;
  323. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  324. if (!param2Valid)
  325. break;
  326. Matrix* instance = getInstance(state);
  327. instance->add(param1, param2);
  328. return 0;
  329. }
  330. } while (0);
  331. lua_pushstring(state, "lua_Matrix_add - Failed to match the given parameters to a valid function signature.");
  332. lua_error(state);
  333. break;
  334. }
  335. default:
  336. {
  337. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  338. lua_error(state);
  339. break;
  340. }
  341. }
  342. return 0;
  343. }
  344. int lua_Matrix_decompose(lua_State* state)
  345. {
  346. // Get the number of parameters.
  347. int paramCount = lua_gettop(state);
  348. // Attempt to match the parameters to a valid binding.
  349. switch (paramCount)
  350. {
  351. case 4:
  352. {
  353. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  354. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  355. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) &&
  356. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  357. {
  358. // Get parameter 1 off the stack.
  359. bool param1Valid;
  360. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  361. if (!param1Valid)
  362. {
  363. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  364. lua_error(state);
  365. }
  366. // Get parameter 2 off the stack.
  367. bool param2Valid;
  368. gameplay::ScriptUtil::LuaArray<Quaternion> param2 = gameplay::ScriptUtil::getObjectPointer<Quaternion>(3, "Quaternion", false, &param2Valid);
  369. if (!param2Valid)
  370. {
  371. lua_pushstring(state, "Failed to convert parameter 2 to type 'Quaternion'.");
  372. lua_error(state);
  373. }
  374. // Get parameter 3 off the stack.
  375. bool param3Valid;
  376. gameplay::ScriptUtil::LuaArray<Vector3> param3 = gameplay::ScriptUtil::getObjectPointer<Vector3>(4, "Vector3", false, &param3Valid);
  377. if (!param3Valid)
  378. {
  379. lua_pushstring(state, "Failed to convert parameter 3 to type 'Vector3'.");
  380. lua_error(state);
  381. }
  382. Matrix* instance = getInstance(state);
  383. bool result = instance->decompose(param1, param2, param3);
  384. // Push the return value onto the stack.
  385. lua_pushboolean(state, result);
  386. return 1;
  387. }
  388. lua_pushstring(state, "lua_Matrix_decompose - Failed to match the given parameters to a valid function signature.");
  389. lua_error(state);
  390. break;
  391. }
  392. default:
  393. {
  394. lua_pushstring(state, "Invalid number of parameters (expected 4).");
  395. lua_error(state);
  396. break;
  397. }
  398. }
  399. return 0;
  400. }
  401. int lua_Matrix_determinant(lua_State* state)
  402. {
  403. // Get the number of parameters.
  404. int paramCount = lua_gettop(state);
  405. // Attempt to match the parameters to a valid binding.
  406. switch (paramCount)
  407. {
  408. case 1:
  409. {
  410. if ((lua_type(state, 1) == LUA_TUSERDATA))
  411. {
  412. Matrix* instance = getInstance(state);
  413. float result = instance->determinant();
  414. // Push the return value onto the stack.
  415. lua_pushnumber(state, result);
  416. return 1;
  417. }
  418. lua_pushstring(state, "lua_Matrix_determinant - Failed to match the given parameters to a valid function signature.");
  419. lua_error(state);
  420. break;
  421. }
  422. default:
  423. {
  424. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  425. lua_error(state);
  426. break;
  427. }
  428. }
  429. return 0;
  430. }
  431. int lua_Matrix_getBackVector(lua_State* state)
  432. {
  433. // Get the number of parameters.
  434. int paramCount = lua_gettop(state);
  435. // Attempt to match the parameters to a valid binding.
  436. switch (paramCount)
  437. {
  438. case 2:
  439. {
  440. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  441. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  442. {
  443. // Get parameter 1 off the stack.
  444. bool param1Valid;
  445. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  446. if (!param1Valid)
  447. {
  448. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  449. lua_error(state);
  450. }
  451. Matrix* instance = getInstance(state);
  452. instance->getBackVector(param1);
  453. return 0;
  454. }
  455. lua_pushstring(state, "lua_Matrix_getBackVector - Failed to match the given parameters to a valid function signature.");
  456. lua_error(state);
  457. break;
  458. }
  459. default:
  460. {
  461. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  462. lua_error(state);
  463. break;
  464. }
  465. }
  466. return 0;
  467. }
  468. int lua_Matrix_getDownVector(lua_State* state)
  469. {
  470. // Get the number of parameters.
  471. int paramCount = lua_gettop(state);
  472. // Attempt to match the parameters to a valid binding.
  473. switch (paramCount)
  474. {
  475. case 2:
  476. {
  477. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  478. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  479. {
  480. // Get parameter 1 off the stack.
  481. bool param1Valid;
  482. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  483. if (!param1Valid)
  484. {
  485. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  486. lua_error(state);
  487. }
  488. Matrix* instance = getInstance(state);
  489. instance->getDownVector(param1);
  490. return 0;
  491. }
  492. lua_pushstring(state, "lua_Matrix_getDownVector - Failed to match the given parameters to a valid function signature.");
  493. lua_error(state);
  494. break;
  495. }
  496. default:
  497. {
  498. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  499. lua_error(state);
  500. break;
  501. }
  502. }
  503. return 0;
  504. }
  505. int lua_Matrix_getForwardVector(lua_State* state)
  506. {
  507. // Get the number of parameters.
  508. int paramCount = lua_gettop(state);
  509. // Attempt to match the parameters to a valid binding.
  510. switch (paramCount)
  511. {
  512. case 2:
  513. {
  514. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  515. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  516. {
  517. // Get parameter 1 off the stack.
  518. bool param1Valid;
  519. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  520. if (!param1Valid)
  521. {
  522. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  523. lua_error(state);
  524. }
  525. Matrix* instance = getInstance(state);
  526. instance->getForwardVector(param1);
  527. return 0;
  528. }
  529. lua_pushstring(state, "lua_Matrix_getForwardVector - Failed to match the given parameters to a valid function signature.");
  530. lua_error(state);
  531. break;
  532. }
  533. default:
  534. {
  535. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  536. lua_error(state);
  537. break;
  538. }
  539. }
  540. return 0;
  541. }
  542. int lua_Matrix_getLeftVector(lua_State* state)
  543. {
  544. // Get the number of parameters.
  545. int paramCount = lua_gettop(state);
  546. // Attempt to match the parameters to a valid binding.
  547. switch (paramCount)
  548. {
  549. case 2:
  550. {
  551. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  552. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  553. {
  554. // Get parameter 1 off the stack.
  555. bool param1Valid;
  556. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  557. if (!param1Valid)
  558. {
  559. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  560. lua_error(state);
  561. }
  562. Matrix* instance = getInstance(state);
  563. instance->getLeftVector(param1);
  564. return 0;
  565. }
  566. lua_pushstring(state, "lua_Matrix_getLeftVector - Failed to match the given parameters to a valid function signature.");
  567. lua_error(state);
  568. break;
  569. }
  570. default:
  571. {
  572. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  573. lua_error(state);
  574. break;
  575. }
  576. }
  577. return 0;
  578. }
  579. int lua_Matrix_getRightVector(lua_State* state)
  580. {
  581. // Get the number of parameters.
  582. int paramCount = lua_gettop(state);
  583. // Attempt to match the parameters to a valid binding.
  584. switch (paramCount)
  585. {
  586. case 2:
  587. {
  588. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  589. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  590. {
  591. // Get parameter 1 off the stack.
  592. bool param1Valid;
  593. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  594. if (!param1Valid)
  595. {
  596. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  597. lua_error(state);
  598. }
  599. Matrix* instance = getInstance(state);
  600. instance->getRightVector(param1);
  601. return 0;
  602. }
  603. lua_pushstring(state, "lua_Matrix_getRightVector - Failed to match the given parameters to a valid function signature.");
  604. lua_error(state);
  605. break;
  606. }
  607. default:
  608. {
  609. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  610. lua_error(state);
  611. break;
  612. }
  613. }
  614. return 0;
  615. }
  616. int lua_Matrix_getRotation(lua_State* state)
  617. {
  618. // Get the number of parameters.
  619. int paramCount = lua_gettop(state);
  620. // Attempt to match the parameters to a valid binding.
  621. switch (paramCount)
  622. {
  623. case 2:
  624. {
  625. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  626. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  627. {
  628. // Get parameter 1 off the stack.
  629. bool param1Valid;
  630. gameplay::ScriptUtil::LuaArray<Quaternion> param1 = gameplay::ScriptUtil::getObjectPointer<Quaternion>(2, "Quaternion", false, &param1Valid);
  631. if (!param1Valid)
  632. {
  633. lua_pushstring(state, "Failed to convert parameter 1 to type 'Quaternion'.");
  634. lua_error(state);
  635. }
  636. Matrix* instance = getInstance(state);
  637. bool result = instance->getRotation(param1);
  638. // Push the return value onto the stack.
  639. lua_pushboolean(state, result);
  640. return 1;
  641. }
  642. lua_pushstring(state, "lua_Matrix_getRotation - Failed to match the given parameters to a valid function signature.");
  643. lua_error(state);
  644. break;
  645. }
  646. default:
  647. {
  648. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  649. lua_error(state);
  650. break;
  651. }
  652. }
  653. return 0;
  654. }
  655. int lua_Matrix_getScale(lua_State* state)
  656. {
  657. // Get the number of parameters.
  658. int paramCount = lua_gettop(state);
  659. // Attempt to match the parameters to a valid binding.
  660. switch (paramCount)
  661. {
  662. case 2:
  663. {
  664. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  665. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  666. {
  667. // Get parameter 1 off the stack.
  668. bool param1Valid;
  669. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  670. if (!param1Valid)
  671. {
  672. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  673. lua_error(state);
  674. }
  675. Matrix* instance = getInstance(state);
  676. instance->getScale(param1);
  677. return 0;
  678. }
  679. lua_pushstring(state, "lua_Matrix_getScale - Failed to match the given parameters to a valid function signature.");
  680. lua_error(state);
  681. break;
  682. }
  683. default:
  684. {
  685. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  686. lua_error(state);
  687. break;
  688. }
  689. }
  690. return 0;
  691. }
  692. int lua_Matrix_getTranslation(lua_State* state)
  693. {
  694. // Get the number of parameters.
  695. int paramCount = lua_gettop(state);
  696. // Attempt to match the parameters to a valid binding.
  697. switch (paramCount)
  698. {
  699. case 2:
  700. {
  701. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  702. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  703. {
  704. // Get parameter 1 off the stack.
  705. bool param1Valid;
  706. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  707. if (!param1Valid)
  708. {
  709. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  710. lua_error(state);
  711. }
  712. Matrix* instance = getInstance(state);
  713. instance->getTranslation(param1);
  714. return 0;
  715. }
  716. lua_pushstring(state, "lua_Matrix_getTranslation - Failed to match the given parameters to a valid function signature.");
  717. lua_error(state);
  718. break;
  719. }
  720. default:
  721. {
  722. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  723. lua_error(state);
  724. break;
  725. }
  726. }
  727. return 0;
  728. }
  729. int lua_Matrix_getUpVector(lua_State* state)
  730. {
  731. // Get the number of parameters.
  732. int paramCount = lua_gettop(state);
  733. // Attempt to match the parameters to a valid binding.
  734. switch (paramCount)
  735. {
  736. case 2:
  737. {
  738. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  739. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  740. {
  741. // Get parameter 1 off the stack.
  742. bool param1Valid;
  743. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  744. if (!param1Valid)
  745. {
  746. lua_pushstring(state, "Failed to convert parameter 1 to type 'Vector3'.");
  747. lua_error(state);
  748. }
  749. Matrix* instance = getInstance(state);
  750. instance->getUpVector(param1);
  751. return 0;
  752. }
  753. lua_pushstring(state, "lua_Matrix_getUpVector - Failed to match the given parameters to a valid function signature.");
  754. lua_error(state);
  755. break;
  756. }
  757. default:
  758. {
  759. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  760. lua_error(state);
  761. break;
  762. }
  763. }
  764. return 0;
  765. }
  766. int lua_Matrix_invert(lua_State* state)
  767. {
  768. // Get the number of parameters.
  769. int paramCount = lua_gettop(state);
  770. // Attempt to match the parameters to a valid binding.
  771. switch (paramCount)
  772. {
  773. case 1:
  774. {
  775. do
  776. {
  777. if ((lua_type(state, 1) == LUA_TUSERDATA))
  778. {
  779. Matrix* instance = getInstance(state);
  780. bool result = instance->invert();
  781. // Push the return value onto the stack.
  782. lua_pushboolean(state, result);
  783. return 1;
  784. }
  785. } while (0);
  786. lua_pushstring(state, "lua_Matrix_invert - Failed to match the given parameters to a valid function signature.");
  787. lua_error(state);
  788. break;
  789. }
  790. case 2:
  791. {
  792. do
  793. {
  794. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  795. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  796. {
  797. // Get parameter 1 off the stack.
  798. bool param1Valid;
  799. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
  800. if (!param1Valid)
  801. break;
  802. Matrix* instance = getInstance(state);
  803. bool result = instance->invert(param1);
  804. // Push the return value onto the stack.
  805. lua_pushboolean(state, result);
  806. return 1;
  807. }
  808. } while (0);
  809. lua_pushstring(state, "lua_Matrix_invert - Failed to match the given parameters to a valid function signature.");
  810. lua_error(state);
  811. break;
  812. }
  813. default:
  814. {
  815. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  816. lua_error(state);
  817. break;
  818. }
  819. }
  820. return 0;
  821. }
  822. int lua_Matrix_isIdentity(lua_State* state)
  823. {
  824. // Get the number of parameters.
  825. int paramCount = lua_gettop(state);
  826. // Attempt to match the parameters to a valid binding.
  827. switch (paramCount)
  828. {
  829. case 1:
  830. {
  831. if ((lua_type(state, 1) == LUA_TUSERDATA))
  832. {
  833. Matrix* instance = getInstance(state);
  834. bool result = instance->isIdentity();
  835. // Push the return value onto the stack.
  836. lua_pushboolean(state, result);
  837. return 1;
  838. }
  839. lua_pushstring(state, "lua_Matrix_isIdentity - Failed to match the given parameters to a valid function signature.");
  840. lua_error(state);
  841. break;
  842. }
  843. default:
  844. {
  845. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  846. lua_error(state);
  847. break;
  848. }
  849. }
  850. return 0;
  851. }
  852. int lua_Matrix_m(lua_State* state)
  853. {
  854. // Validate the number of parameters.
  855. if (lua_gettop(state) > 2)
  856. {
  857. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  858. lua_error(state);
  859. }
  860. Matrix* instance = getInstance(state);
  861. if (lua_gettop(state) == 2)
  862. {
  863. // Get parameter 2 off the stack.
  864. gameplay::ScriptUtil::LuaArray<float> param2 = gameplay::ScriptUtil::getFloatPointer(2);
  865. memcpy(instance->m, param2, sizeof(float) * 16);
  866. return 0;
  867. }
  868. else
  869. {
  870. float* result = instance->m;
  871. // Push the return value onto the stack.
  872. lua_pushlightuserdata(state, result);
  873. return 1;
  874. }
  875. }
  876. int lua_Matrix_multiply(lua_State* state)
  877. {
  878. // Get the number of parameters.
  879. int paramCount = lua_gettop(state);
  880. // Attempt to match the parameters to a valid binding.
  881. switch (paramCount)
  882. {
  883. case 2:
  884. {
  885. do
  886. {
  887. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  888. lua_type(state, 2) == LUA_TNUMBER)
  889. {
  890. // Get parameter 1 off the stack.
  891. float param1 = (float)luaL_checknumber(state, 2);
  892. Matrix* instance = getInstance(state);
  893. instance->multiply(param1);
  894. return 0;
  895. }
  896. } while (0);
  897. do
  898. {
  899. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  900. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  901. {
  902. // Get parameter 1 off the stack.
  903. bool param1Valid;
  904. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
  905. if (!param1Valid)
  906. break;
  907. Matrix* instance = getInstance(state);
  908. instance->multiply(*param1);
  909. return 0;
  910. }
  911. } while (0);
  912. lua_pushstring(state, "lua_Matrix_multiply - Failed to match the given parameters to a valid function signature.");
  913. lua_error(state);
  914. break;
  915. }
  916. case 3:
  917. {
  918. do
  919. {
  920. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  921. lua_type(state, 2) == LUA_TNUMBER &&
  922. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  923. {
  924. // Get parameter 1 off the stack.
  925. float param1 = (float)luaL_checknumber(state, 2);
  926. // Get parameter 2 off the stack.
  927. bool param2Valid;
  928. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  929. if (!param2Valid)
  930. break;
  931. Matrix* instance = getInstance(state);
  932. instance->multiply(param1, param2);
  933. return 0;
  934. }
  935. } while (0);
  936. lua_pushstring(state, "lua_Matrix_multiply - Failed to match the given parameters to a valid function signature.");
  937. lua_error(state);
  938. break;
  939. }
  940. default:
  941. {
  942. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  943. lua_error(state);
  944. break;
  945. }
  946. }
  947. return 0;
  948. }
  949. int lua_Matrix_negate(lua_State* state)
  950. {
  951. // Get the number of parameters.
  952. int paramCount = lua_gettop(state);
  953. // Attempt to match the parameters to a valid binding.
  954. switch (paramCount)
  955. {
  956. case 1:
  957. {
  958. do
  959. {
  960. if ((lua_type(state, 1) == LUA_TUSERDATA))
  961. {
  962. Matrix* instance = getInstance(state);
  963. instance->negate();
  964. return 0;
  965. }
  966. } while (0);
  967. lua_pushstring(state, "lua_Matrix_negate - Failed to match the given parameters to a valid function signature.");
  968. lua_error(state);
  969. break;
  970. }
  971. case 2:
  972. {
  973. do
  974. {
  975. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  976. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  977. {
  978. // Get parameter 1 off the stack.
  979. bool param1Valid;
  980. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
  981. if (!param1Valid)
  982. break;
  983. Matrix* instance = getInstance(state);
  984. instance->negate(param1);
  985. return 0;
  986. }
  987. } while (0);
  988. lua_pushstring(state, "lua_Matrix_negate - Failed to match the given parameters to a valid function signature.");
  989. lua_error(state);
  990. break;
  991. }
  992. default:
  993. {
  994. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  995. lua_error(state);
  996. break;
  997. }
  998. }
  999. return 0;
  1000. }
  1001. int lua_Matrix_rotate(lua_State* state)
  1002. {
  1003. // Get the number of parameters.
  1004. int paramCount = lua_gettop(state);
  1005. // Attempt to match the parameters to a valid binding.
  1006. switch (paramCount)
  1007. {
  1008. case 2:
  1009. {
  1010. do
  1011. {
  1012. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1013. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1014. {
  1015. // Get parameter 1 off the stack.
  1016. bool param1Valid;
  1017. gameplay::ScriptUtil::LuaArray<Quaternion> param1 = gameplay::ScriptUtil::getObjectPointer<Quaternion>(2, "Quaternion", true, &param1Valid);
  1018. if (!param1Valid)
  1019. break;
  1020. Matrix* instance = getInstance(state);
  1021. instance->rotate(*param1);
  1022. return 0;
  1023. }
  1024. } while (0);
  1025. lua_pushstring(state, "lua_Matrix_rotate - Failed to match the given parameters to a valid function signature.");
  1026. lua_error(state);
  1027. break;
  1028. }
  1029. case 3:
  1030. {
  1031. do
  1032. {
  1033. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1034. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1035. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1036. {
  1037. // Get parameter 1 off the stack.
  1038. bool param1Valid;
  1039. gameplay::ScriptUtil::LuaArray<Quaternion> param1 = gameplay::ScriptUtil::getObjectPointer<Quaternion>(2, "Quaternion", true, &param1Valid);
  1040. if (!param1Valid)
  1041. break;
  1042. // Get parameter 2 off the stack.
  1043. bool param2Valid;
  1044. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1045. if (!param2Valid)
  1046. break;
  1047. Matrix* instance = getInstance(state);
  1048. instance->rotate(*param1, param2);
  1049. return 0;
  1050. }
  1051. } while (0);
  1052. do
  1053. {
  1054. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1055. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1056. lua_type(state, 3) == LUA_TNUMBER)
  1057. {
  1058. // Get parameter 1 off the stack.
  1059. bool param1Valid;
  1060. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1061. if (!param1Valid)
  1062. break;
  1063. // Get parameter 2 off the stack.
  1064. float param2 = (float)luaL_checknumber(state, 3);
  1065. Matrix* instance = getInstance(state);
  1066. instance->rotate(*param1, param2);
  1067. return 0;
  1068. }
  1069. } while (0);
  1070. lua_pushstring(state, "lua_Matrix_rotate - Failed to match the given parameters to a valid function signature.");
  1071. lua_error(state);
  1072. break;
  1073. }
  1074. case 4:
  1075. {
  1076. do
  1077. {
  1078. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1079. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1080. lua_type(state, 3) == LUA_TNUMBER &&
  1081. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  1082. {
  1083. // Get parameter 1 off the stack.
  1084. bool param1Valid;
  1085. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1086. if (!param1Valid)
  1087. break;
  1088. // Get parameter 2 off the stack.
  1089. float param2 = (float)luaL_checknumber(state, 3);
  1090. // Get parameter 3 off the stack.
  1091. bool param3Valid;
  1092. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(4, "Matrix", false, &param3Valid);
  1093. if (!param3Valid)
  1094. break;
  1095. Matrix* instance = getInstance(state);
  1096. instance->rotate(*param1, param2, param3);
  1097. return 0;
  1098. }
  1099. } while (0);
  1100. lua_pushstring(state, "lua_Matrix_rotate - Failed to match the given parameters to a valid function signature.");
  1101. lua_error(state);
  1102. break;
  1103. }
  1104. default:
  1105. {
  1106. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4).");
  1107. lua_error(state);
  1108. break;
  1109. }
  1110. }
  1111. return 0;
  1112. }
  1113. int lua_Matrix_rotateX(lua_State* state)
  1114. {
  1115. // Get the number of parameters.
  1116. int paramCount = lua_gettop(state);
  1117. // Attempt to match the parameters to a valid binding.
  1118. switch (paramCount)
  1119. {
  1120. case 2:
  1121. {
  1122. do
  1123. {
  1124. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1125. lua_type(state, 2) == LUA_TNUMBER)
  1126. {
  1127. // Get parameter 1 off the stack.
  1128. float param1 = (float)luaL_checknumber(state, 2);
  1129. Matrix* instance = getInstance(state);
  1130. instance->rotateX(param1);
  1131. return 0;
  1132. }
  1133. } while (0);
  1134. lua_pushstring(state, "lua_Matrix_rotateX - Failed to match the given parameters to a valid function signature.");
  1135. lua_error(state);
  1136. break;
  1137. }
  1138. case 3:
  1139. {
  1140. do
  1141. {
  1142. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1143. lua_type(state, 2) == LUA_TNUMBER &&
  1144. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1145. {
  1146. // Get parameter 1 off the stack.
  1147. float param1 = (float)luaL_checknumber(state, 2);
  1148. // Get parameter 2 off the stack.
  1149. bool param2Valid;
  1150. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1151. if (!param2Valid)
  1152. break;
  1153. Matrix* instance = getInstance(state);
  1154. instance->rotateX(param1, param2);
  1155. return 0;
  1156. }
  1157. } while (0);
  1158. lua_pushstring(state, "lua_Matrix_rotateX - Failed to match the given parameters to a valid function signature.");
  1159. lua_error(state);
  1160. break;
  1161. }
  1162. default:
  1163. {
  1164. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  1165. lua_error(state);
  1166. break;
  1167. }
  1168. }
  1169. return 0;
  1170. }
  1171. int lua_Matrix_rotateY(lua_State* state)
  1172. {
  1173. // Get the number of parameters.
  1174. int paramCount = lua_gettop(state);
  1175. // Attempt to match the parameters to a valid binding.
  1176. switch (paramCount)
  1177. {
  1178. case 2:
  1179. {
  1180. do
  1181. {
  1182. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1183. lua_type(state, 2) == LUA_TNUMBER)
  1184. {
  1185. // Get parameter 1 off the stack.
  1186. float param1 = (float)luaL_checknumber(state, 2);
  1187. Matrix* instance = getInstance(state);
  1188. instance->rotateY(param1);
  1189. return 0;
  1190. }
  1191. } while (0);
  1192. lua_pushstring(state, "lua_Matrix_rotateY - Failed to match the given parameters to a valid function signature.");
  1193. lua_error(state);
  1194. break;
  1195. }
  1196. case 3:
  1197. {
  1198. do
  1199. {
  1200. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1201. lua_type(state, 2) == LUA_TNUMBER &&
  1202. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1203. {
  1204. // Get parameter 1 off the stack.
  1205. float param1 = (float)luaL_checknumber(state, 2);
  1206. // Get parameter 2 off the stack.
  1207. bool param2Valid;
  1208. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1209. if (!param2Valid)
  1210. break;
  1211. Matrix* instance = getInstance(state);
  1212. instance->rotateY(param1, param2);
  1213. return 0;
  1214. }
  1215. } while (0);
  1216. lua_pushstring(state, "lua_Matrix_rotateY - Failed to match the given parameters to a valid function signature.");
  1217. lua_error(state);
  1218. break;
  1219. }
  1220. default:
  1221. {
  1222. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  1223. lua_error(state);
  1224. break;
  1225. }
  1226. }
  1227. return 0;
  1228. }
  1229. int lua_Matrix_rotateZ(lua_State* state)
  1230. {
  1231. // Get the number of parameters.
  1232. int paramCount = lua_gettop(state);
  1233. // Attempt to match the parameters to a valid binding.
  1234. switch (paramCount)
  1235. {
  1236. case 2:
  1237. {
  1238. do
  1239. {
  1240. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1241. lua_type(state, 2) == LUA_TNUMBER)
  1242. {
  1243. // Get parameter 1 off the stack.
  1244. float param1 = (float)luaL_checknumber(state, 2);
  1245. Matrix* instance = getInstance(state);
  1246. instance->rotateZ(param1);
  1247. return 0;
  1248. }
  1249. } while (0);
  1250. lua_pushstring(state, "lua_Matrix_rotateZ - Failed to match the given parameters to a valid function signature.");
  1251. lua_error(state);
  1252. break;
  1253. }
  1254. case 3:
  1255. {
  1256. do
  1257. {
  1258. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1259. lua_type(state, 2) == LUA_TNUMBER &&
  1260. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1261. {
  1262. // Get parameter 1 off the stack.
  1263. float param1 = (float)luaL_checknumber(state, 2);
  1264. // Get parameter 2 off the stack.
  1265. bool param2Valid;
  1266. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1267. if (!param2Valid)
  1268. break;
  1269. Matrix* instance = getInstance(state);
  1270. instance->rotateZ(param1, param2);
  1271. return 0;
  1272. }
  1273. } while (0);
  1274. lua_pushstring(state, "lua_Matrix_rotateZ - Failed to match the given parameters to a valid function signature.");
  1275. lua_error(state);
  1276. break;
  1277. }
  1278. default:
  1279. {
  1280. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  1281. lua_error(state);
  1282. break;
  1283. }
  1284. }
  1285. return 0;
  1286. }
  1287. int lua_Matrix_scale(lua_State* state)
  1288. {
  1289. // Get the number of parameters.
  1290. int paramCount = lua_gettop(state);
  1291. // Attempt to match the parameters to a valid binding.
  1292. switch (paramCount)
  1293. {
  1294. case 2:
  1295. {
  1296. do
  1297. {
  1298. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1299. lua_type(state, 2) == LUA_TNUMBER)
  1300. {
  1301. // Get parameter 1 off the stack.
  1302. float param1 = (float)luaL_checknumber(state, 2);
  1303. Matrix* instance = getInstance(state);
  1304. instance->scale(param1);
  1305. return 0;
  1306. }
  1307. } while (0);
  1308. do
  1309. {
  1310. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1311. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1312. {
  1313. // Get parameter 1 off the stack.
  1314. bool param1Valid;
  1315. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1316. if (!param1Valid)
  1317. break;
  1318. Matrix* instance = getInstance(state);
  1319. instance->scale(*param1);
  1320. return 0;
  1321. }
  1322. } while (0);
  1323. lua_pushstring(state, "lua_Matrix_scale - Failed to match the given parameters to a valid function signature.");
  1324. lua_error(state);
  1325. break;
  1326. }
  1327. case 3:
  1328. {
  1329. do
  1330. {
  1331. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1332. lua_type(state, 2) == LUA_TNUMBER &&
  1333. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1334. {
  1335. // Get parameter 1 off the stack.
  1336. float param1 = (float)luaL_checknumber(state, 2);
  1337. // Get parameter 2 off the stack.
  1338. bool param2Valid;
  1339. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1340. if (!param2Valid)
  1341. break;
  1342. Matrix* instance = getInstance(state);
  1343. instance->scale(param1, param2);
  1344. return 0;
  1345. }
  1346. } while (0);
  1347. do
  1348. {
  1349. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1350. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1351. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1352. {
  1353. // Get parameter 1 off the stack.
  1354. bool param1Valid;
  1355. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  1356. if (!param1Valid)
  1357. break;
  1358. // Get parameter 2 off the stack.
  1359. bool param2Valid;
  1360. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  1361. if (!param2Valid)
  1362. break;
  1363. Matrix* instance = getInstance(state);
  1364. instance->scale(*param1, param2);
  1365. return 0;
  1366. }
  1367. } while (0);
  1368. lua_pushstring(state, "lua_Matrix_scale - Failed to match the given parameters to a valid function signature.");
  1369. lua_error(state);
  1370. break;
  1371. }
  1372. case 4:
  1373. {
  1374. do
  1375. {
  1376. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1377. lua_type(state, 2) == LUA_TNUMBER &&
  1378. lua_type(state, 3) == LUA_TNUMBER &&
  1379. lua_type(state, 4) == LUA_TNUMBER)
  1380. {
  1381. // Get parameter 1 off the stack.
  1382. float param1 = (float)luaL_checknumber(state, 2);
  1383. // Get parameter 2 off the stack.
  1384. float param2 = (float)luaL_checknumber(state, 3);
  1385. // Get parameter 3 off the stack.
  1386. float param3 = (float)luaL_checknumber(state, 4);
  1387. Matrix* instance = getInstance(state);
  1388. instance->scale(param1, param2, param3);
  1389. return 0;
  1390. }
  1391. } while (0);
  1392. lua_pushstring(state, "lua_Matrix_scale - Failed to match the given parameters to a valid function signature.");
  1393. lua_error(state);
  1394. break;
  1395. }
  1396. case 5:
  1397. {
  1398. do
  1399. {
  1400. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1401. lua_type(state, 2) == LUA_TNUMBER &&
  1402. lua_type(state, 3) == LUA_TNUMBER &&
  1403. lua_type(state, 4) == LUA_TNUMBER &&
  1404. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  1405. {
  1406. // Get parameter 1 off the stack.
  1407. float param1 = (float)luaL_checknumber(state, 2);
  1408. // Get parameter 2 off the stack.
  1409. float param2 = (float)luaL_checknumber(state, 3);
  1410. // Get parameter 3 off the stack.
  1411. float param3 = (float)luaL_checknumber(state, 4);
  1412. // Get parameter 4 off the stack.
  1413. bool param4Valid;
  1414. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(5, "Matrix", false, &param4Valid);
  1415. if (!param4Valid)
  1416. break;
  1417. Matrix* instance = getInstance(state);
  1418. instance->scale(param1, param2, param3, param4);
  1419. return 0;
  1420. }
  1421. } while (0);
  1422. lua_pushstring(state, "lua_Matrix_scale - Failed to match the given parameters to a valid function signature.");
  1423. lua_error(state);
  1424. break;
  1425. }
  1426. default:
  1427. {
  1428. lua_pushstring(state, "Invalid number of parameters (expected 2, 3, 4 or 5).");
  1429. lua_error(state);
  1430. break;
  1431. }
  1432. }
  1433. return 0;
  1434. }
  1435. int lua_Matrix_set(lua_State* state)
  1436. {
  1437. // Get the number of parameters.
  1438. int paramCount = lua_gettop(state);
  1439. // Attempt to match the parameters to a valid binding.
  1440. switch (paramCount)
  1441. {
  1442. case 2:
  1443. {
  1444. do
  1445. {
  1446. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1447. (lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TLIGHTUSERDATA))
  1448. {
  1449. // Get parameter 1 off the stack.
  1450. gameplay::ScriptUtil::LuaArray<float> param1 = gameplay::ScriptUtil::getFloatPointer(2);
  1451. Matrix* instance = getInstance(state);
  1452. instance->set(param1);
  1453. return 0;
  1454. }
  1455. } while (0);
  1456. do
  1457. {
  1458. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1459. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1460. {
  1461. // Get parameter 1 off the stack.
  1462. bool param1Valid;
  1463. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
  1464. if (!param1Valid)
  1465. break;
  1466. Matrix* instance = getInstance(state);
  1467. instance->set(*param1);
  1468. return 0;
  1469. }
  1470. } while (0);
  1471. lua_pushstring(state, "lua_Matrix_set - Failed to match the given parameters to a valid function signature.");
  1472. lua_error(state);
  1473. break;
  1474. }
  1475. case 17:
  1476. {
  1477. do
  1478. {
  1479. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1480. lua_type(state, 2) == LUA_TNUMBER &&
  1481. lua_type(state, 3) == LUA_TNUMBER &&
  1482. lua_type(state, 4) == LUA_TNUMBER &&
  1483. lua_type(state, 5) == LUA_TNUMBER &&
  1484. lua_type(state, 6) == LUA_TNUMBER &&
  1485. lua_type(state, 7) == LUA_TNUMBER &&
  1486. lua_type(state, 8) == LUA_TNUMBER &&
  1487. lua_type(state, 9) == LUA_TNUMBER &&
  1488. lua_type(state, 10) == LUA_TNUMBER &&
  1489. lua_type(state, 11) == LUA_TNUMBER &&
  1490. lua_type(state, 12) == LUA_TNUMBER &&
  1491. lua_type(state, 13) == LUA_TNUMBER &&
  1492. lua_type(state, 14) == LUA_TNUMBER &&
  1493. lua_type(state, 15) == LUA_TNUMBER &&
  1494. lua_type(state, 16) == LUA_TNUMBER &&
  1495. lua_type(state, 17) == LUA_TNUMBER)
  1496. {
  1497. // Get parameter 1 off the stack.
  1498. float param1 = (float)luaL_checknumber(state, 2);
  1499. // Get parameter 2 off the stack.
  1500. float param2 = (float)luaL_checknumber(state, 3);
  1501. // Get parameter 3 off the stack.
  1502. float param3 = (float)luaL_checknumber(state, 4);
  1503. // Get parameter 4 off the stack.
  1504. float param4 = (float)luaL_checknumber(state, 5);
  1505. // Get parameter 5 off the stack.
  1506. float param5 = (float)luaL_checknumber(state, 6);
  1507. // Get parameter 6 off the stack.
  1508. float param6 = (float)luaL_checknumber(state, 7);
  1509. // Get parameter 7 off the stack.
  1510. float param7 = (float)luaL_checknumber(state, 8);
  1511. // Get parameter 8 off the stack.
  1512. float param8 = (float)luaL_checknumber(state, 9);
  1513. // Get parameter 9 off the stack.
  1514. float param9 = (float)luaL_checknumber(state, 10);
  1515. // Get parameter 10 off the stack.
  1516. float param10 = (float)luaL_checknumber(state, 11);
  1517. // Get parameter 11 off the stack.
  1518. float param11 = (float)luaL_checknumber(state, 12);
  1519. // Get parameter 12 off the stack.
  1520. float param12 = (float)luaL_checknumber(state, 13);
  1521. // Get parameter 13 off the stack.
  1522. float param13 = (float)luaL_checknumber(state, 14);
  1523. // Get parameter 14 off the stack.
  1524. float param14 = (float)luaL_checknumber(state, 15);
  1525. // Get parameter 15 off the stack.
  1526. float param15 = (float)luaL_checknumber(state, 16);
  1527. // Get parameter 16 off the stack.
  1528. float param16 = (float)luaL_checknumber(state, 17);
  1529. Matrix* instance = getInstance(state);
  1530. instance->set(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16);
  1531. return 0;
  1532. }
  1533. } while (0);
  1534. lua_pushstring(state, "lua_Matrix_set - Failed to match the given parameters to a valid function signature.");
  1535. lua_error(state);
  1536. break;
  1537. }
  1538. default:
  1539. {
  1540. lua_pushstring(state, "Invalid number of parameters (expected 2 or 17).");
  1541. lua_error(state);
  1542. break;
  1543. }
  1544. }
  1545. return 0;
  1546. }
  1547. int lua_Matrix_setIdentity(lua_State* state)
  1548. {
  1549. // Get the number of parameters.
  1550. int paramCount = lua_gettop(state);
  1551. // Attempt to match the parameters to a valid binding.
  1552. switch (paramCount)
  1553. {
  1554. case 1:
  1555. {
  1556. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1557. {
  1558. Matrix* instance = getInstance(state);
  1559. instance->setIdentity();
  1560. return 0;
  1561. }
  1562. lua_pushstring(state, "lua_Matrix_setIdentity - Failed to match the given parameters to a valid function signature.");
  1563. lua_error(state);
  1564. break;
  1565. }
  1566. default:
  1567. {
  1568. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1569. lua_error(state);
  1570. break;
  1571. }
  1572. }
  1573. return 0;
  1574. }
  1575. int lua_Matrix_setZero(lua_State* state)
  1576. {
  1577. // Get the number of parameters.
  1578. int paramCount = lua_gettop(state);
  1579. // Attempt to match the parameters to a valid binding.
  1580. switch (paramCount)
  1581. {
  1582. case 1:
  1583. {
  1584. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1585. {
  1586. Matrix* instance = getInstance(state);
  1587. instance->setZero();
  1588. return 0;
  1589. }
  1590. lua_pushstring(state, "lua_Matrix_setZero - Failed to match the given parameters to a valid function signature.");
  1591. lua_error(state);
  1592. break;
  1593. }
  1594. default:
  1595. {
  1596. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1597. lua_error(state);
  1598. break;
  1599. }
  1600. }
  1601. return 0;
  1602. }
  1603. int lua_Matrix_static_add(lua_State* state)
  1604. {
  1605. // Get the number of parameters.
  1606. int paramCount = lua_gettop(state);
  1607. // Attempt to match the parameters to a valid binding.
  1608. switch (paramCount)
  1609. {
  1610. case 3:
  1611. {
  1612. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1613. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1614. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  1615. {
  1616. // Get parameter 1 off the stack.
  1617. bool param1Valid;
  1618. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(1, "Matrix", true, &param1Valid);
  1619. if (!param1Valid)
  1620. {
  1621. lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
  1622. lua_error(state);
  1623. }
  1624. // Get parameter 2 off the stack.
  1625. bool param2Valid;
  1626. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param2Valid);
  1627. if (!param2Valid)
  1628. {
  1629. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  1630. lua_error(state);
  1631. }
  1632. // Get parameter 3 off the stack.
  1633. bool param3Valid;
  1634. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param3Valid);
  1635. if (!param3Valid)
  1636. {
  1637. lua_pushstring(state, "Failed to convert parameter 3 to type 'Matrix'.");
  1638. lua_error(state);
  1639. }
  1640. Matrix::add(*param1, *param2, param3);
  1641. return 0;
  1642. }
  1643. lua_pushstring(state, "lua_Matrix_static_add - Failed to match the given parameters to a valid function signature.");
  1644. lua_error(state);
  1645. break;
  1646. }
  1647. default:
  1648. {
  1649. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1650. lua_error(state);
  1651. break;
  1652. }
  1653. }
  1654. return 0;
  1655. }
  1656. int lua_Matrix_static_createBillboard(lua_State* state)
  1657. {
  1658. // Get the number of parameters.
  1659. int paramCount = lua_gettop(state);
  1660. // Attempt to match the parameters to a valid binding.
  1661. switch (paramCount)
  1662. {
  1663. case 4:
  1664. {
  1665. do
  1666. {
  1667. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1668. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1669. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1670. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  1671. {
  1672. // Get parameter 1 off the stack.
  1673. bool param1Valid;
  1674. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  1675. if (!param1Valid)
  1676. break;
  1677. // Get parameter 2 off the stack.
  1678. bool param2Valid;
  1679. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param2Valid);
  1680. if (!param2Valid)
  1681. break;
  1682. // Get parameter 3 off the stack.
  1683. bool param3Valid;
  1684. gameplay::ScriptUtil::LuaArray<Vector3> param3 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, &param3Valid);
  1685. if (!param3Valid)
  1686. break;
  1687. // Get parameter 4 off the stack.
  1688. bool param4Valid;
  1689. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(4, "Matrix", false, &param4Valid);
  1690. if (!param4Valid)
  1691. break;
  1692. Matrix::createBillboard(*param1, *param2, *param3, param4);
  1693. return 0;
  1694. }
  1695. } while (0);
  1696. lua_pushstring(state, "lua_Matrix_static_createBillboard - Failed to match the given parameters to a valid function signature.");
  1697. lua_error(state);
  1698. break;
  1699. }
  1700. case 5:
  1701. {
  1702. do
  1703. {
  1704. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1705. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1706. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1707. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL) &&
  1708. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  1709. {
  1710. // Get parameter 1 off the stack.
  1711. bool param1Valid;
  1712. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  1713. if (!param1Valid)
  1714. break;
  1715. // Get parameter 2 off the stack.
  1716. bool param2Valid;
  1717. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param2Valid);
  1718. if (!param2Valid)
  1719. break;
  1720. // Get parameter 3 off the stack.
  1721. bool param3Valid;
  1722. gameplay::ScriptUtil::LuaArray<Vector3> param3 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, &param3Valid);
  1723. if (!param3Valid)
  1724. break;
  1725. // Get parameter 4 off the stack.
  1726. bool param4Valid;
  1727. gameplay::ScriptUtil::LuaArray<Vector3> param4 = gameplay::ScriptUtil::getObjectPointer<Vector3>(4, "Vector3", true, &param4Valid);
  1728. if (!param4Valid)
  1729. break;
  1730. // Get parameter 5 off the stack.
  1731. bool param5Valid;
  1732. gameplay::ScriptUtil::LuaArray<Matrix> param5 = gameplay::ScriptUtil::getObjectPointer<Matrix>(5, "Matrix", false, &param5Valid);
  1733. if (!param5Valid)
  1734. break;
  1735. Matrix::createBillboard(*param1, *param2, *param3, *param4, param5);
  1736. return 0;
  1737. }
  1738. } while (0);
  1739. lua_pushstring(state, "lua_Matrix_static_createBillboard - Failed to match the given parameters to a valid function signature.");
  1740. lua_error(state);
  1741. break;
  1742. }
  1743. default:
  1744. {
  1745. lua_pushstring(state, "Invalid number of parameters (expected 4 or 5).");
  1746. lua_error(state);
  1747. break;
  1748. }
  1749. }
  1750. return 0;
  1751. }
  1752. int lua_Matrix_static_createLookAt(lua_State* state)
  1753. {
  1754. // Get the number of parameters.
  1755. int paramCount = lua_gettop(state);
  1756. // Attempt to match the parameters to a valid binding.
  1757. switch (paramCount)
  1758. {
  1759. case 4:
  1760. {
  1761. do
  1762. {
  1763. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1764. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  1765. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  1766. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  1767. {
  1768. // Get parameter 1 off the stack.
  1769. bool param1Valid;
  1770. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  1771. if (!param1Valid)
  1772. break;
  1773. // Get parameter 2 off the stack.
  1774. bool param2Valid;
  1775. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param2Valid);
  1776. if (!param2Valid)
  1777. break;
  1778. // Get parameter 3 off the stack.
  1779. bool param3Valid;
  1780. gameplay::ScriptUtil::LuaArray<Vector3> param3 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", true, &param3Valid);
  1781. if (!param3Valid)
  1782. break;
  1783. // Get parameter 4 off the stack.
  1784. bool param4Valid;
  1785. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(4, "Matrix", false, &param4Valid);
  1786. if (!param4Valid)
  1787. break;
  1788. Matrix::createLookAt(*param1, *param2, *param3, param4);
  1789. return 0;
  1790. }
  1791. } while (0);
  1792. lua_pushstring(state, "lua_Matrix_static_createLookAt - Failed to match the given parameters to a valid function signature.");
  1793. lua_error(state);
  1794. break;
  1795. }
  1796. case 10:
  1797. {
  1798. do
  1799. {
  1800. if (lua_type(state, 1) == LUA_TNUMBER &&
  1801. lua_type(state, 2) == LUA_TNUMBER &&
  1802. lua_type(state, 3) == LUA_TNUMBER &&
  1803. lua_type(state, 4) == LUA_TNUMBER &&
  1804. lua_type(state, 5) == LUA_TNUMBER &&
  1805. lua_type(state, 6) == LUA_TNUMBER &&
  1806. lua_type(state, 7) == LUA_TNUMBER &&
  1807. lua_type(state, 8) == LUA_TNUMBER &&
  1808. lua_type(state, 9) == LUA_TNUMBER &&
  1809. (lua_type(state, 10) == LUA_TUSERDATA || lua_type(state, 10) == LUA_TTABLE || lua_type(state, 10) == LUA_TNIL))
  1810. {
  1811. // Get parameter 1 off the stack.
  1812. float param1 = (float)luaL_checknumber(state, 1);
  1813. // Get parameter 2 off the stack.
  1814. float param2 = (float)luaL_checknumber(state, 2);
  1815. // Get parameter 3 off the stack.
  1816. float param3 = (float)luaL_checknumber(state, 3);
  1817. // Get parameter 4 off the stack.
  1818. float param4 = (float)luaL_checknumber(state, 4);
  1819. // Get parameter 5 off the stack.
  1820. float param5 = (float)luaL_checknumber(state, 5);
  1821. // Get parameter 6 off the stack.
  1822. float param6 = (float)luaL_checknumber(state, 6);
  1823. // Get parameter 7 off the stack.
  1824. float param7 = (float)luaL_checknumber(state, 7);
  1825. // Get parameter 8 off the stack.
  1826. float param8 = (float)luaL_checknumber(state, 8);
  1827. // Get parameter 9 off the stack.
  1828. float param9 = (float)luaL_checknumber(state, 9);
  1829. // Get parameter 10 off the stack.
  1830. bool param10Valid;
  1831. gameplay::ScriptUtil::LuaArray<Matrix> param10 = gameplay::ScriptUtil::getObjectPointer<Matrix>(10, "Matrix", false, &param10Valid);
  1832. if (!param10Valid)
  1833. break;
  1834. Matrix::createLookAt(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
  1835. return 0;
  1836. }
  1837. } while (0);
  1838. lua_pushstring(state, "lua_Matrix_static_createLookAt - Failed to match the given parameters to a valid function signature.");
  1839. lua_error(state);
  1840. break;
  1841. }
  1842. default:
  1843. {
  1844. lua_pushstring(state, "Invalid number of parameters (expected 4 or 10).");
  1845. lua_error(state);
  1846. break;
  1847. }
  1848. }
  1849. return 0;
  1850. }
  1851. int lua_Matrix_static_createOrthographic(lua_State* state)
  1852. {
  1853. // Get the number of parameters.
  1854. int paramCount = lua_gettop(state);
  1855. // Attempt to match the parameters to a valid binding.
  1856. switch (paramCount)
  1857. {
  1858. case 5:
  1859. {
  1860. if (lua_type(state, 1) == LUA_TNUMBER &&
  1861. lua_type(state, 2) == LUA_TNUMBER &&
  1862. lua_type(state, 3) == LUA_TNUMBER &&
  1863. lua_type(state, 4) == LUA_TNUMBER &&
  1864. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  1865. {
  1866. // Get parameter 1 off the stack.
  1867. float param1 = (float)luaL_checknumber(state, 1);
  1868. // Get parameter 2 off the stack.
  1869. float param2 = (float)luaL_checknumber(state, 2);
  1870. // Get parameter 3 off the stack.
  1871. float param3 = (float)luaL_checknumber(state, 3);
  1872. // Get parameter 4 off the stack.
  1873. float param4 = (float)luaL_checknumber(state, 4);
  1874. // Get parameter 5 off the stack.
  1875. bool param5Valid;
  1876. gameplay::ScriptUtil::LuaArray<Matrix> param5 = gameplay::ScriptUtil::getObjectPointer<Matrix>(5, "Matrix", false, &param5Valid);
  1877. if (!param5Valid)
  1878. {
  1879. lua_pushstring(state, "Failed to convert parameter 5 to type 'Matrix'.");
  1880. lua_error(state);
  1881. }
  1882. Matrix::createOrthographic(param1, param2, param3, param4, param5);
  1883. return 0;
  1884. }
  1885. lua_pushstring(state, "lua_Matrix_static_createOrthographic - Failed to match the given parameters to a valid function signature.");
  1886. lua_error(state);
  1887. break;
  1888. }
  1889. default:
  1890. {
  1891. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1892. lua_error(state);
  1893. break;
  1894. }
  1895. }
  1896. return 0;
  1897. }
  1898. int lua_Matrix_static_createOrthographicOffCenter(lua_State* state)
  1899. {
  1900. // Get the number of parameters.
  1901. int paramCount = lua_gettop(state);
  1902. // Attempt to match the parameters to a valid binding.
  1903. switch (paramCount)
  1904. {
  1905. case 7:
  1906. {
  1907. if (lua_type(state, 1) == LUA_TNUMBER &&
  1908. lua_type(state, 2) == LUA_TNUMBER &&
  1909. lua_type(state, 3) == LUA_TNUMBER &&
  1910. lua_type(state, 4) == LUA_TNUMBER &&
  1911. lua_type(state, 5) == LUA_TNUMBER &&
  1912. lua_type(state, 6) == LUA_TNUMBER &&
  1913. (lua_type(state, 7) == LUA_TUSERDATA || lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TNIL))
  1914. {
  1915. // Get parameter 1 off the stack.
  1916. float param1 = (float)luaL_checknumber(state, 1);
  1917. // Get parameter 2 off the stack.
  1918. float param2 = (float)luaL_checknumber(state, 2);
  1919. // Get parameter 3 off the stack.
  1920. float param3 = (float)luaL_checknumber(state, 3);
  1921. // Get parameter 4 off the stack.
  1922. float param4 = (float)luaL_checknumber(state, 4);
  1923. // Get parameter 5 off the stack.
  1924. float param5 = (float)luaL_checknumber(state, 5);
  1925. // Get parameter 6 off the stack.
  1926. float param6 = (float)luaL_checknumber(state, 6);
  1927. // Get parameter 7 off the stack.
  1928. bool param7Valid;
  1929. gameplay::ScriptUtil::LuaArray<Matrix> param7 = gameplay::ScriptUtil::getObjectPointer<Matrix>(7, "Matrix", false, &param7Valid);
  1930. if (!param7Valid)
  1931. {
  1932. lua_pushstring(state, "Failed to convert parameter 7 to type 'Matrix'.");
  1933. lua_error(state);
  1934. }
  1935. Matrix::createOrthographicOffCenter(param1, param2, param3, param4, param5, param6, param7);
  1936. return 0;
  1937. }
  1938. lua_pushstring(state, "lua_Matrix_static_createOrthographicOffCenter - Failed to match the given parameters to a valid function signature.");
  1939. lua_error(state);
  1940. break;
  1941. }
  1942. default:
  1943. {
  1944. lua_pushstring(state, "Invalid number of parameters (expected 7).");
  1945. lua_error(state);
  1946. break;
  1947. }
  1948. }
  1949. return 0;
  1950. }
  1951. int lua_Matrix_static_createPerspective(lua_State* state)
  1952. {
  1953. // Get the number of parameters.
  1954. int paramCount = lua_gettop(state);
  1955. // Attempt to match the parameters to a valid binding.
  1956. switch (paramCount)
  1957. {
  1958. case 5:
  1959. {
  1960. if (lua_type(state, 1) == LUA_TNUMBER &&
  1961. lua_type(state, 2) == LUA_TNUMBER &&
  1962. lua_type(state, 3) == LUA_TNUMBER &&
  1963. lua_type(state, 4) == LUA_TNUMBER &&
  1964. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  1965. {
  1966. // Get parameter 1 off the stack.
  1967. float param1 = (float)luaL_checknumber(state, 1);
  1968. // Get parameter 2 off the stack.
  1969. float param2 = (float)luaL_checknumber(state, 2);
  1970. // Get parameter 3 off the stack.
  1971. float param3 = (float)luaL_checknumber(state, 3);
  1972. // Get parameter 4 off the stack.
  1973. float param4 = (float)luaL_checknumber(state, 4);
  1974. // Get parameter 5 off the stack.
  1975. bool param5Valid;
  1976. gameplay::ScriptUtil::LuaArray<Matrix> param5 = gameplay::ScriptUtil::getObjectPointer<Matrix>(5, "Matrix", false, &param5Valid);
  1977. if (!param5Valid)
  1978. {
  1979. lua_pushstring(state, "Failed to convert parameter 5 to type 'Matrix'.");
  1980. lua_error(state);
  1981. }
  1982. Matrix::createPerspective(param1, param2, param3, param4, param5);
  1983. return 0;
  1984. }
  1985. lua_pushstring(state, "lua_Matrix_static_createPerspective - Failed to match the given parameters to a valid function signature.");
  1986. lua_error(state);
  1987. break;
  1988. }
  1989. default:
  1990. {
  1991. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  1992. lua_error(state);
  1993. break;
  1994. }
  1995. }
  1996. return 0;
  1997. }
  1998. int lua_Matrix_static_createReflection(lua_State* state)
  1999. {
  2000. // Get the number of parameters.
  2001. int paramCount = lua_gettop(state);
  2002. // Attempt to match the parameters to a valid binding.
  2003. switch (paramCount)
  2004. {
  2005. case 2:
  2006. {
  2007. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2008. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2009. {
  2010. // Get parameter 1 off the stack.
  2011. bool param1Valid;
  2012. gameplay::ScriptUtil::LuaArray<Plane> param1 = gameplay::ScriptUtil::getObjectPointer<Plane>(1, "Plane", true, &param1Valid);
  2013. if (!param1Valid)
  2014. {
  2015. lua_pushstring(state, "Failed to convert parameter 1 to type 'Plane'.");
  2016. lua_error(state);
  2017. }
  2018. // Get parameter 2 off the stack.
  2019. bool param2Valid;
  2020. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2021. if (!param2Valid)
  2022. {
  2023. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  2024. lua_error(state);
  2025. }
  2026. Matrix::createReflection(*param1, param2);
  2027. return 0;
  2028. }
  2029. lua_pushstring(state, "lua_Matrix_static_createReflection - Failed to match the given parameters to a valid function signature.");
  2030. lua_error(state);
  2031. break;
  2032. }
  2033. default:
  2034. {
  2035. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2036. lua_error(state);
  2037. break;
  2038. }
  2039. }
  2040. return 0;
  2041. }
  2042. int lua_Matrix_static_createRotation(lua_State* state)
  2043. {
  2044. // Get the number of parameters.
  2045. int paramCount = lua_gettop(state);
  2046. // Attempt to match the parameters to a valid binding.
  2047. switch (paramCount)
  2048. {
  2049. case 2:
  2050. {
  2051. do
  2052. {
  2053. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2054. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2055. {
  2056. // Get parameter 1 off the stack.
  2057. bool param1Valid;
  2058. gameplay::ScriptUtil::LuaArray<Quaternion> param1 = gameplay::ScriptUtil::getObjectPointer<Quaternion>(1, "Quaternion", true, &param1Valid);
  2059. if (!param1Valid)
  2060. break;
  2061. // Get parameter 2 off the stack.
  2062. bool param2Valid;
  2063. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2064. if (!param2Valid)
  2065. break;
  2066. Matrix::createRotation(*param1, param2);
  2067. return 0;
  2068. }
  2069. } while (0);
  2070. lua_pushstring(state, "lua_Matrix_static_createRotation - Failed to match the given parameters to a valid function signature.");
  2071. lua_error(state);
  2072. break;
  2073. }
  2074. case 3:
  2075. {
  2076. do
  2077. {
  2078. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2079. lua_type(state, 2) == LUA_TNUMBER &&
  2080. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2081. {
  2082. // Get parameter 1 off the stack.
  2083. bool param1Valid;
  2084. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  2085. if (!param1Valid)
  2086. break;
  2087. // Get parameter 2 off the stack.
  2088. float param2 = (float)luaL_checknumber(state, 2);
  2089. // Get parameter 3 off the stack.
  2090. bool param3Valid;
  2091. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param3Valid);
  2092. if (!param3Valid)
  2093. break;
  2094. Matrix::createRotation(*param1, param2, param3);
  2095. return 0;
  2096. }
  2097. } while (0);
  2098. lua_pushstring(state, "lua_Matrix_static_createRotation - Failed to match the given parameters to a valid function signature.");
  2099. lua_error(state);
  2100. break;
  2101. }
  2102. default:
  2103. {
  2104. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  2105. lua_error(state);
  2106. break;
  2107. }
  2108. }
  2109. return 0;
  2110. }
  2111. int lua_Matrix_static_createRotationX(lua_State* state)
  2112. {
  2113. // Get the number of parameters.
  2114. int paramCount = lua_gettop(state);
  2115. // Attempt to match the parameters to a valid binding.
  2116. switch (paramCount)
  2117. {
  2118. case 2:
  2119. {
  2120. if (lua_type(state, 1) == LUA_TNUMBER &&
  2121. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2122. {
  2123. // Get parameter 1 off the stack.
  2124. float param1 = (float)luaL_checknumber(state, 1);
  2125. // Get parameter 2 off the stack.
  2126. bool param2Valid;
  2127. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2128. if (!param2Valid)
  2129. {
  2130. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  2131. lua_error(state);
  2132. }
  2133. Matrix::createRotationX(param1, param2);
  2134. return 0;
  2135. }
  2136. lua_pushstring(state, "lua_Matrix_static_createRotationX - Failed to match the given parameters to a valid function signature.");
  2137. lua_error(state);
  2138. break;
  2139. }
  2140. default:
  2141. {
  2142. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2143. lua_error(state);
  2144. break;
  2145. }
  2146. }
  2147. return 0;
  2148. }
  2149. int lua_Matrix_static_createRotationY(lua_State* state)
  2150. {
  2151. // Get the number of parameters.
  2152. int paramCount = lua_gettop(state);
  2153. // Attempt to match the parameters to a valid binding.
  2154. switch (paramCount)
  2155. {
  2156. case 2:
  2157. {
  2158. if (lua_type(state, 1) == LUA_TNUMBER &&
  2159. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2160. {
  2161. // Get parameter 1 off the stack.
  2162. float param1 = (float)luaL_checknumber(state, 1);
  2163. // Get parameter 2 off the stack.
  2164. bool param2Valid;
  2165. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2166. if (!param2Valid)
  2167. {
  2168. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  2169. lua_error(state);
  2170. }
  2171. Matrix::createRotationY(param1, param2);
  2172. return 0;
  2173. }
  2174. lua_pushstring(state, "lua_Matrix_static_createRotationY - Failed to match the given parameters to a valid function signature.");
  2175. lua_error(state);
  2176. break;
  2177. }
  2178. default:
  2179. {
  2180. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2181. lua_error(state);
  2182. break;
  2183. }
  2184. }
  2185. return 0;
  2186. }
  2187. int lua_Matrix_static_createRotationZ(lua_State* state)
  2188. {
  2189. // Get the number of parameters.
  2190. int paramCount = lua_gettop(state);
  2191. // Attempt to match the parameters to a valid binding.
  2192. switch (paramCount)
  2193. {
  2194. case 2:
  2195. {
  2196. if (lua_type(state, 1) == LUA_TNUMBER &&
  2197. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2198. {
  2199. // Get parameter 1 off the stack.
  2200. float param1 = (float)luaL_checknumber(state, 1);
  2201. // Get parameter 2 off the stack.
  2202. bool param2Valid;
  2203. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2204. if (!param2Valid)
  2205. {
  2206. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  2207. lua_error(state);
  2208. }
  2209. Matrix::createRotationZ(param1, param2);
  2210. return 0;
  2211. }
  2212. lua_pushstring(state, "lua_Matrix_static_createRotationZ - Failed to match the given parameters to a valid function signature.");
  2213. lua_error(state);
  2214. break;
  2215. }
  2216. default:
  2217. {
  2218. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2219. lua_error(state);
  2220. break;
  2221. }
  2222. }
  2223. return 0;
  2224. }
  2225. int lua_Matrix_static_createScale(lua_State* state)
  2226. {
  2227. // Get the number of parameters.
  2228. int paramCount = lua_gettop(state);
  2229. // Attempt to match the parameters to a valid binding.
  2230. switch (paramCount)
  2231. {
  2232. case 2:
  2233. {
  2234. do
  2235. {
  2236. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2237. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2238. {
  2239. // Get parameter 1 off the stack.
  2240. bool param1Valid;
  2241. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  2242. if (!param1Valid)
  2243. break;
  2244. // Get parameter 2 off the stack.
  2245. bool param2Valid;
  2246. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2247. if (!param2Valid)
  2248. break;
  2249. Matrix::createScale(*param1, param2);
  2250. return 0;
  2251. }
  2252. } while (0);
  2253. lua_pushstring(state, "lua_Matrix_static_createScale - Failed to match the given parameters to a valid function signature.");
  2254. lua_error(state);
  2255. break;
  2256. }
  2257. case 4:
  2258. {
  2259. do
  2260. {
  2261. if (lua_type(state, 1) == LUA_TNUMBER &&
  2262. lua_type(state, 2) == LUA_TNUMBER &&
  2263. lua_type(state, 3) == LUA_TNUMBER &&
  2264. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  2265. {
  2266. // Get parameter 1 off the stack.
  2267. float param1 = (float)luaL_checknumber(state, 1);
  2268. // Get parameter 2 off the stack.
  2269. float param2 = (float)luaL_checknumber(state, 2);
  2270. // Get parameter 3 off the stack.
  2271. float param3 = (float)luaL_checknumber(state, 3);
  2272. // Get parameter 4 off the stack.
  2273. bool param4Valid;
  2274. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(4, "Matrix", false, &param4Valid);
  2275. if (!param4Valid)
  2276. break;
  2277. Matrix::createScale(param1, param2, param3, param4);
  2278. return 0;
  2279. }
  2280. } while (0);
  2281. lua_pushstring(state, "lua_Matrix_static_createScale - Failed to match the given parameters to a valid function signature.");
  2282. lua_error(state);
  2283. break;
  2284. }
  2285. default:
  2286. {
  2287. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  2288. lua_error(state);
  2289. break;
  2290. }
  2291. }
  2292. return 0;
  2293. }
  2294. int lua_Matrix_static_createTranslation(lua_State* state)
  2295. {
  2296. // Get the number of parameters.
  2297. int paramCount = lua_gettop(state);
  2298. // Attempt to match the parameters to a valid binding.
  2299. switch (paramCount)
  2300. {
  2301. case 2:
  2302. {
  2303. do
  2304. {
  2305. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2306. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2307. {
  2308. // Get parameter 1 off the stack.
  2309. bool param1Valid;
  2310. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(1, "Vector3", true, &param1Valid);
  2311. if (!param1Valid)
  2312. break;
  2313. // Get parameter 2 off the stack.
  2314. bool param2Valid;
  2315. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param2Valid);
  2316. if (!param2Valid)
  2317. break;
  2318. Matrix::createTranslation(*param1, param2);
  2319. return 0;
  2320. }
  2321. } while (0);
  2322. lua_pushstring(state, "lua_Matrix_static_createTranslation - Failed to match the given parameters to a valid function signature.");
  2323. lua_error(state);
  2324. break;
  2325. }
  2326. case 4:
  2327. {
  2328. do
  2329. {
  2330. if (lua_type(state, 1) == LUA_TNUMBER &&
  2331. lua_type(state, 2) == LUA_TNUMBER &&
  2332. lua_type(state, 3) == LUA_TNUMBER &&
  2333. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TNIL))
  2334. {
  2335. // Get parameter 1 off the stack.
  2336. float param1 = (float)luaL_checknumber(state, 1);
  2337. // Get parameter 2 off the stack.
  2338. float param2 = (float)luaL_checknumber(state, 2);
  2339. // Get parameter 3 off the stack.
  2340. float param3 = (float)luaL_checknumber(state, 3);
  2341. // Get parameter 4 off the stack.
  2342. bool param4Valid;
  2343. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(4, "Matrix", false, &param4Valid);
  2344. if (!param4Valid)
  2345. break;
  2346. Matrix::createTranslation(param1, param2, param3, param4);
  2347. return 0;
  2348. }
  2349. } while (0);
  2350. lua_pushstring(state, "lua_Matrix_static_createTranslation - Failed to match the given parameters to a valid function signature.");
  2351. lua_error(state);
  2352. break;
  2353. }
  2354. default:
  2355. {
  2356. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  2357. lua_error(state);
  2358. break;
  2359. }
  2360. }
  2361. return 0;
  2362. }
  2363. int lua_Matrix_static_identity(lua_State* state)
  2364. {
  2365. // Get the number of parameters.
  2366. int paramCount = lua_gettop(state);
  2367. // Attempt to match the parameters to a valid binding.
  2368. switch (paramCount)
  2369. {
  2370. case 0:
  2371. {
  2372. void* returnPtr = (void*)&(Matrix::identity());
  2373. if (returnPtr)
  2374. {
  2375. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  2376. object->instance = returnPtr;
  2377. object->owns = false;
  2378. luaL_getmetatable(state, "Matrix");
  2379. lua_setmetatable(state, -2);
  2380. }
  2381. else
  2382. {
  2383. lua_pushnil(state);
  2384. }
  2385. return 1;
  2386. break;
  2387. }
  2388. default:
  2389. {
  2390. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  2391. lua_error(state);
  2392. break;
  2393. }
  2394. }
  2395. return 0;
  2396. }
  2397. int lua_Matrix_static_multiply(lua_State* state)
  2398. {
  2399. // Get the number of parameters.
  2400. int paramCount = lua_gettop(state);
  2401. // Attempt to match the parameters to a valid binding.
  2402. switch (paramCount)
  2403. {
  2404. case 3:
  2405. {
  2406. do
  2407. {
  2408. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2409. lua_type(state, 2) == LUA_TNUMBER &&
  2410. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2411. {
  2412. // Get parameter 1 off the stack.
  2413. bool param1Valid;
  2414. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(1, "Matrix", true, &param1Valid);
  2415. if (!param1Valid)
  2416. break;
  2417. // Get parameter 2 off the stack.
  2418. float param2 = (float)luaL_checknumber(state, 2);
  2419. // Get parameter 3 off the stack.
  2420. bool param3Valid;
  2421. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param3Valid);
  2422. if (!param3Valid)
  2423. break;
  2424. Matrix::multiply(*param1, param2, param3);
  2425. return 0;
  2426. }
  2427. } while (0);
  2428. do
  2429. {
  2430. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2431. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2432. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2433. {
  2434. // Get parameter 1 off the stack.
  2435. bool param1Valid;
  2436. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(1, "Matrix", true, &param1Valid);
  2437. if (!param1Valid)
  2438. break;
  2439. // Get parameter 2 off the stack.
  2440. bool param2Valid;
  2441. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param2Valid);
  2442. if (!param2Valid)
  2443. break;
  2444. // Get parameter 3 off the stack.
  2445. bool param3Valid;
  2446. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param3Valid);
  2447. if (!param3Valid)
  2448. break;
  2449. Matrix::multiply(*param1, *param2, param3);
  2450. return 0;
  2451. }
  2452. } while (0);
  2453. lua_pushstring(state, "lua_Matrix_static_multiply - Failed to match the given parameters to a valid function signature.");
  2454. lua_error(state);
  2455. break;
  2456. }
  2457. default:
  2458. {
  2459. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2460. lua_error(state);
  2461. break;
  2462. }
  2463. }
  2464. return 0;
  2465. }
  2466. int lua_Matrix_static_subtract(lua_State* state)
  2467. {
  2468. // Get the number of parameters.
  2469. int paramCount = lua_gettop(state);
  2470. // Attempt to match the parameters to a valid binding.
  2471. switch (paramCount)
  2472. {
  2473. case 3:
  2474. {
  2475. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2476. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2477. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2478. {
  2479. // Get parameter 1 off the stack.
  2480. bool param1Valid;
  2481. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(1, "Matrix", true, &param1Valid);
  2482. if (!param1Valid)
  2483. {
  2484. lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
  2485. lua_error(state);
  2486. }
  2487. // Get parameter 2 off the stack.
  2488. bool param2Valid;
  2489. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param2Valid);
  2490. if (!param2Valid)
  2491. {
  2492. lua_pushstring(state, "Failed to convert parameter 2 to type 'Matrix'.");
  2493. lua_error(state);
  2494. }
  2495. // Get parameter 3 off the stack.
  2496. bool param3Valid;
  2497. gameplay::ScriptUtil::LuaArray<Matrix> param3 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param3Valid);
  2498. if (!param3Valid)
  2499. {
  2500. lua_pushstring(state, "Failed to convert parameter 3 to type 'Matrix'.");
  2501. lua_error(state);
  2502. }
  2503. Matrix::subtract(*param1, *param2, param3);
  2504. return 0;
  2505. }
  2506. lua_pushstring(state, "lua_Matrix_static_subtract - Failed to match the given parameters to a valid function signature.");
  2507. lua_error(state);
  2508. break;
  2509. }
  2510. default:
  2511. {
  2512. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2513. lua_error(state);
  2514. break;
  2515. }
  2516. }
  2517. return 0;
  2518. }
  2519. int lua_Matrix_static_zero(lua_State* state)
  2520. {
  2521. // Get the number of parameters.
  2522. int paramCount = lua_gettop(state);
  2523. // Attempt to match the parameters to a valid binding.
  2524. switch (paramCount)
  2525. {
  2526. case 0:
  2527. {
  2528. void* returnPtr = (void*)&(Matrix::zero());
  2529. if (returnPtr)
  2530. {
  2531. gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
  2532. object->instance = returnPtr;
  2533. object->owns = false;
  2534. luaL_getmetatable(state, "Matrix");
  2535. lua_setmetatable(state, -2);
  2536. }
  2537. else
  2538. {
  2539. lua_pushnil(state);
  2540. }
  2541. return 1;
  2542. break;
  2543. }
  2544. default:
  2545. {
  2546. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  2547. lua_error(state);
  2548. break;
  2549. }
  2550. }
  2551. return 0;
  2552. }
  2553. int lua_Matrix_subtract(lua_State* state)
  2554. {
  2555. // Get the number of parameters.
  2556. int paramCount = lua_gettop(state);
  2557. // Attempt to match the parameters to a valid binding.
  2558. switch (paramCount)
  2559. {
  2560. case 2:
  2561. {
  2562. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2563. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2564. {
  2565. // Get parameter 1 off the stack.
  2566. bool param1Valid;
  2567. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", true, &param1Valid);
  2568. if (!param1Valid)
  2569. {
  2570. lua_pushstring(state, "Failed to convert parameter 1 to type 'Matrix'.");
  2571. lua_error(state);
  2572. }
  2573. Matrix* instance = getInstance(state);
  2574. instance->subtract(*param1);
  2575. return 0;
  2576. }
  2577. lua_pushstring(state, "lua_Matrix_subtract - Failed to match the given parameters to a valid function signature.");
  2578. lua_error(state);
  2579. break;
  2580. }
  2581. default:
  2582. {
  2583. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2584. lua_error(state);
  2585. break;
  2586. }
  2587. }
  2588. return 0;
  2589. }
  2590. int lua_Matrix_transformPoint(lua_State* state)
  2591. {
  2592. // Get the number of parameters.
  2593. int paramCount = lua_gettop(state);
  2594. // Attempt to match the parameters to a valid binding.
  2595. switch (paramCount)
  2596. {
  2597. case 2:
  2598. {
  2599. do
  2600. {
  2601. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2602. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2603. {
  2604. // Get parameter 1 off the stack.
  2605. bool param1Valid;
  2606. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  2607. if (!param1Valid)
  2608. break;
  2609. Matrix* instance = getInstance(state);
  2610. instance->transformPoint(param1);
  2611. return 0;
  2612. }
  2613. } while (0);
  2614. lua_pushstring(state, "lua_Matrix_transformPoint - Failed to match the given parameters to a valid function signature.");
  2615. lua_error(state);
  2616. break;
  2617. }
  2618. case 3:
  2619. {
  2620. do
  2621. {
  2622. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2623. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2624. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2625. {
  2626. // Get parameter 1 off the stack.
  2627. bool param1Valid;
  2628. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  2629. if (!param1Valid)
  2630. break;
  2631. // Get parameter 2 off the stack.
  2632. bool param2Valid;
  2633. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", false, &param2Valid);
  2634. if (!param2Valid)
  2635. break;
  2636. Matrix* instance = getInstance(state);
  2637. instance->transformPoint(*param1, param2);
  2638. return 0;
  2639. }
  2640. } while (0);
  2641. lua_pushstring(state, "lua_Matrix_transformPoint - Failed to match the given parameters to a valid function signature.");
  2642. lua_error(state);
  2643. break;
  2644. }
  2645. default:
  2646. {
  2647. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  2648. lua_error(state);
  2649. break;
  2650. }
  2651. }
  2652. return 0;
  2653. }
  2654. int lua_Matrix_transformVector(lua_State* state)
  2655. {
  2656. // Get the number of parameters.
  2657. int paramCount = lua_gettop(state);
  2658. // Attempt to match the parameters to a valid binding.
  2659. switch (paramCount)
  2660. {
  2661. case 2:
  2662. {
  2663. do
  2664. {
  2665. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2666. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2667. {
  2668. // Get parameter 1 off the stack.
  2669. bool param1Valid;
  2670. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", false, &param1Valid);
  2671. if (!param1Valid)
  2672. break;
  2673. Matrix* instance = getInstance(state);
  2674. instance->transformVector(param1);
  2675. return 0;
  2676. }
  2677. } while (0);
  2678. do
  2679. {
  2680. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2681. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2682. {
  2683. // Get parameter 1 off the stack.
  2684. bool param1Valid;
  2685. gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", false, &param1Valid);
  2686. if (!param1Valid)
  2687. break;
  2688. Matrix* instance = getInstance(state);
  2689. instance->transformVector(param1);
  2690. return 0;
  2691. }
  2692. } while (0);
  2693. lua_pushstring(state, "lua_Matrix_transformVector - Failed to match the given parameters to a valid function signature.");
  2694. lua_error(state);
  2695. break;
  2696. }
  2697. case 3:
  2698. {
  2699. do
  2700. {
  2701. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2702. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2703. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2704. {
  2705. // Get parameter 1 off the stack.
  2706. bool param1Valid;
  2707. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  2708. if (!param1Valid)
  2709. break;
  2710. // Get parameter 2 off the stack.
  2711. bool param2Valid;
  2712. gameplay::ScriptUtil::LuaArray<Vector3> param2 = gameplay::ScriptUtil::getObjectPointer<Vector3>(3, "Vector3", false, &param2Valid);
  2713. if (!param2Valid)
  2714. break;
  2715. Matrix* instance = getInstance(state);
  2716. instance->transformVector(*param1, param2);
  2717. return 0;
  2718. }
  2719. } while (0);
  2720. do
  2721. {
  2722. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2723. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2724. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2725. {
  2726. // Get parameter 1 off the stack.
  2727. bool param1Valid;
  2728. gameplay::ScriptUtil::LuaArray<Vector4> param1 = gameplay::ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true, &param1Valid);
  2729. if (!param1Valid)
  2730. break;
  2731. // Get parameter 2 off the stack.
  2732. bool param2Valid;
  2733. gameplay::ScriptUtil::LuaArray<Vector4> param2 = gameplay::ScriptUtil::getObjectPointer<Vector4>(3, "Vector4", false, &param2Valid);
  2734. if (!param2Valid)
  2735. break;
  2736. Matrix* instance = getInstance(state);
  2737. instance->transformVector(*param1, param2);
  2738. return 0;
  2739. }
  2740. } while (0);
  2741. lua_pushstring(state, "lua_Matrix_transformVector - Failed to match the given parameters to a valid function signature.");
  2742. lua_error(state);
  2743. break;
  2744. }
  2745. case 6:
  2746. {
  2747. do
  2748. {
  2749. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2750. lua_type(state, 2) == LUA_TNUMBER &&
  2751. lua_type(state, 3) == LUA_TNUMBER &&
  2752. lua_type(state, 4) == LUA_TNUMBER &&
  2753. lua_type(state, 5) == LUA_TNUMBER &&
  2754. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TNIL))
  2755. {
  2756. // Get parameter 1 off the stack.
  2757. float param1 = (float)luaL_checknumber(state, 2);
  2758. // Get parameter 2 off the stack.
  2759. float param2 = (float)luaL_checknumber(state, 3);
  2760. // Get parameter 3 off the stack.
  2761. float param3 = (float)luaL_checknumber(state, 4);
  2762. // Get parameter 4 off the stack.
  2763. float param4 = (float)luaL_checknumber(state, 5);
  2764. // Get parameter 5 off the stack.
  2765. bool param5Valid;
  2766. gameplay::ScriptUtil::LuaArray<Vector3> param5 = gameplay::ScriptUtil::getObjectPointer<Vector3>(6, "Vector3", false, &param5Valid);
  2767. if (!param5Valid)
  2768. break;
  2769. Matrix* instance = getInstance(state);
  2770. instance->transformVector(param1, param2, param3, param4, param5);
  2771. return 0;
  2772. }
  2773. } while (0);
  2774. lua_pushstring(state, "lua_Matrix_transformVector - Failed to match the given parameters to a valid function signature.");
  2775. lua_error(state);
  2776. break;
  2777. }
  2778. default:
  2779. {
  2780. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 6).");
  2781. lua_error(state);
  2782. break;
  2783. }
  2784. }
  2785. return 0;
  2786. }
  2787. int lua_Matrix_translate(lua_State* state)
  2788. {
  2789. // Get the number of parameters.
  2790. int paramCount = lua_gettop(state);
  2791. // Attempt to match the parameters to a valid binding.
  2792. switch (paramCount)
  2793. {
  2794. case 2:
  2795. {
  2796. do
  2797. {
  2798. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2799. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2800. {
  2801. // Get parameter 1 off the stack.
  2802. bool param1Valid;
  2803. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  2804. if (!param1Valid)
  2805. break;
  2806. Matrix* instance = getInstance(state);
  2807. instance->translate(*param1);
  2808. return 0;
  2809. }
  2810. } while (0);
  2811. lua_pushstring(state, "lua_Matrix_translate - Failed to match the given parameters to a valid function signature.");
  2812. lua_error(state);
  2813. break;
  2814. }
  2815. case 3:
  2816. {
  2817. do
  2818. {
  2819. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2820. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2821. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2822. {
  2823. // Get parameter 1 off the stack.
  2824. bool param1Valid;
  2825. gameplay::ScriptUtil::LuaArray<Vector3> param1 = gameplay::ScriptUtil::getObjectPointer<Vector3>(2, "Vector3", true, &param1Valid);
  2826. if (!param1Valid)
  2827. break;
  2828. // Get parameter 2 off the stack.
  2829. bool param2Valid;
  2830. gameplay::ScriptUtil::LuaArray<Matrix> param2 = gameplay::ScriptUtil::getObjectPointer<Matrix>(3, "Matrix", false, &param2Valid);
  2831. if (!param2Valid)
  2832. break;
  2833. Matrix* instance = getInstance(state);
  2834. instance->translate(*param1, param2);
  2835. return 0;
  2836. }
  2837. } while (0);
  2838. lua_pushstring(state, "lua_Matrix_translate - Failed to match the given parameters to a valid function signature.");
  2839. lua_error(state);
  2840. break;
  2841. }
  2842. case 4:
  2843. {
  2844. do
  2845. {
  2846. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2847. lua_type(state, 2) == LUA_TNUMBER &&
  2848. lua_type(state, 3) == LUA_TNUMBER &&
  2849. lua_type(state, 4) == LUA_TNUMBER)
  2850. {
  2851. // Get parameter 1 off the stack.
  2852. float param1 = (float)luaL_checknumber(state, 2);
  2853. // Get parameter 2 off the stack.
  2854. float param2 = (float)luaL_checknumber(state, 3);
  2855. // Get parameter 3 off the stack.
  2856. float param3 = (float)luaL_checknumber(state, 4);
  2857. Matrix* instance = getInstance(state);
  2858. instance->translate(param1, param2, param3);
  2859. return 0;
  2860. }
  2861. } while (0);
  2862. lua_pushstring(state, "lua_Matrix_translate - Failed to match the given parameters to a valid function signature.");
  2863. lua_error(state);
  2864. break;
  2865. }
  2866. case 5:
  2867. {
  2868. do
  2869. {
  2870. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2871. lua_type(state, 2) == LUA_TNUMBER &&
  2872. lua_type(state, 3) == LUA_TNUMBER &&
  2873. lua_type(state, 4) == LUA_TNUMBER &&
  2874. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TNIL))
  2875. {
  2876. // Get parameter 1 off the stack.
  2877. float param1 = (float)luaL_checknumber(state, 2);
  2878. // Get parameter 2 off the stack.
  2879. float param2 = (float)luaL_checknumber(state, 3);
  2880. // Get parameter 3 off the stack.
  2881. float param3 = (float)luaL_checknumber(state, 4);
  2882. // Get parameter 4 off the stack.
  2883. bool param4Valid;
  2884. gameplay::ScriptUtil::LuaArray<Matrix> param4 = gameplay::ScriptUtil::getObjectPointer<Matrix>(5, "Matrix", false, &param4Valid);
  2885. if (!param4Valid)
  2886. break;
  2887. Matrix* instance = getInstance(state);
  2888. instance->translate(param1, param2, param3, param4);
  2889. return 0;
  2890. }
  2891. } while (0);
  2892. lua_pushstring(state, "lua_Matrix_translate - Failed to match the given parameters to a valid function signature.");
  2893. lua_error(state);
  2894. break;
  2895. }
  2896. default:
  2897. {
  2898. lua_pushstring(state, "Invalid number of parameters (expected 2, 3, 4 or 5).");
  2899. lua_error(state);
  2900. break;
  2901. }
  2902. }
  2903. return 0;
  2904. }
  2905. int lua_Matrix_transpose(lua_State* state)
  2906. {
  2907. // Get the number of parameters.
  2908. int paramCount = lua_gettop(state);
  2909. // Attempt to match the parameters to a valid binding.
  2910. switch (paramCount)
  2911. {
  2912. case 1:
  2913. {
  2914. do
  2915. {
  2916. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2917. {
  2918. Matrix* instance = getInstance(state);
  2919. instance->transpose();
  2920. return 0;
  2921. }
  2922. } while (0);
  2923. lua_pushstring(state, "lua_Matrix_transpose - Failed to match the given parameters to a valid function signature.");
  2924. lua_error(state);
  2925. break;
  2926. }
  2927. case 2:
  2928. {
  2929. do
  2930. {
  2931. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2932. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2933. {
  2934. // Get parameter 1 off the stack.
  2935. bool param1Valid;
  2936. gameplay::ScriptUtil::LuaArray<Matrix> param1 = gameplay::ScriptUtil::getObjectPointer<Matrix>(2, "Matrix", false, &param1Valid);
  2937. if (!param1Valid)
  2938. break;
  2939. Matrix* instance = getInstance(state);
  2940. instance->transpose(param1);
  2941. return 0;
  2942. }
  2943. } while (0);
  2944. lua_pushstring(state, "lua_Matrix_transpose - Failed to match the given parameters to a valid function signature.");
  2945. lua_error(state);
  2946. break;
  2947. }
  2948. default:
  2949. {
  2950. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2951. lua_error(state);
  2952. break;
  2953. }
  2954. }
  2955. return 0;
  2956. }
  2957. }