lua_Transform.cpp 123 KB

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