lua_Joint.cpp 205 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "Joint.h"
  4. #include "lua_Joint.h"
  5. #include "lua_Global.h"
  6. namespace gameplay
  7. {
  8. void luaRegister_Joint()
  9. {
  10. ScriptController* sc = ScriptController::getInstance();
  11. const luaL_Reg lua_members[] =
  12. {
  13. {"addChild", lua_Joint_addChild},
  14. {"addListener", lua_Joint_addListener},
  15. {"addRef", lua_Joint_addRef},
  16. {"clone", lua_Joint_clone},
  17. {"createAnimation", lua_Joint_createAnimation},
  18. {"createAnimationFromBy", lua_Joint_createAnimationFromBy},
  19. {"createAnimationFromTo", lua_Joint_createAnimationFromTo},
  20. {"destroyAnimation", lua_Joint_destroyAnimation},
  21. {"findNode", lua_Joint_findNode},
  22. {"getActiveCameraTranslationView", lua_Joint_getActiveCameraTranslationView},
  23. {"getActiveCameraTranslationWorld", lua_Joint_getActiveCameraTranslationWorld},
  24. {"getAnimation", lua_Joint_getAnimation},
  25. {"getAnimationPropertyComponentCount", lua_Joint_getAnimationPropertyComponentCount},
  26. {"getAnimationPropertyValue", lua_Joint_getAnimationPropertyValue},
  27. {"getAudioSource", lua_Joint_getAudioSource},
  28. {"getBackVector", lua_Joint_getBackVector},
  29. {"getBoundingSphere", lua_Joint_getBoundingSphere},
  30. {"getCamera", lua_Joint_getCamera},
  31. {"getChildCount", lua_Joint_getChildCount},
  32. {"getCollisionObject", lua_Joint_getCollisionObject},
  33. {"getDownVector", lua_Joint_getDownVector},
  34. {"getFirstChild", lua_Joint_getFirstChild},
  35. {"getForm", lua_Joint_getForm},
  36. {"getForwardVector", lua_Joint_getForwardVector},
  37. {"getForwardVectorView", lua_Joint_getForwardVectorView},
  38. {"getForwardVectorWorld", lua_Joint_getForwardVectorWorld},
  39. {"getId", lua_Joint_getId},
  40. {"getInverseBindPose", lua_Joint_getInverseBindPose},
  41. {"getInverseTransposeWorldMatrix", lua_Joint_getInverseTransposeWorldMatrix},
  42. {"getInverseTransposeWorldViewMatrix", lua_Joint_getInverseTransposeWorldViewMatrix},
  43. {"getInverseViewMatrix", lua_Joint_getInverseViewMatrix},
  44. {"getInverseViewProjectionMatrix", lua_Joint_getInverseViewProjectionMatrix},
  45. {"getLeftVector", lua_Joint_getLeftVector},
  46. {"getLight", lua_Joint_getLight},
  47. {"getMatrix", lua_Joint_getMatrix},
  48. {"getModel", lua_Joint_getModel},
  49. {"getNextSibling", lua_Joint_getNextSibling},
  50. {"getParent", lua_Joint_getParent},
  51. {"getParticleEmitter", lua_Joint_getParticleEmitter},
  52. {"getPreviousSibling", lua_Joint_getPreviousSibling},
  53. {"getProjectionMatrix", lua_Joint_getProjectionMatrix},
  54. {"getRefCount", lua_Joint_getRefCount},
  55. {"getRightVector", lua_Joint_getRightVector},
  56. {"getRightVectorWorld", lua_Joint_getRightVectorWorld},
  57. {"getRootNode", lua_Joint_getRootNode},
  58. {"getRotation", lua_Joint_getRotation},
  59. {"getScale", lua_Joint_getScale},
  60. {"getScaleX", lua_Joint_getScaleX},
  61. {"getScaleY", lua_Joint_getScaleY},
  62. {"getScaleZ", lua_Joint_getScaleZ},
  63. {"getScene", lua_Joint_getScene},
  64. {"getTranslation", lua_Joint_getTranslation},
  65. {"getTranslationView", lua_Joint_getTranslationView},
  66. {"getTranslationWorld", lua_Joint_getTranslationWorld},
  67. {"getTranslationX", lua_Joint_getTranslationX},
  68. {"getTranslationY", lua_Joint_getTranslationY},
  69. {"getTranslationZ", lua_Joint_getTranslationZ},
  70. {"getType", lua_Joint_getType},
  71. {"getUpVector", lua_Joint_getUpVector},
  72. {"getUpVectorWorld", lua_Joint_getUpVectorWorld},
  73. {"getViewMatrix", lua_Joint_getViewMatrix},
  74. {"getViewProjectionMatrix", lua_Joint_getViewProjectionMatrix},
  75. {"getWorldMatrix", lua_Joint_getWorldMatrix},
  76. {"getWorldViewMatrix", lua_Joint_getWorldViewMatrix},
  77. {"getWorldViewProjectionMatrix", lua_Joint_getWorldViewProjectionMatrix},
  78. {"isDynamic", lua_Joint_isDynamic},
  79. {"isTransparent", lua_Joint_isTransparent},
  80. {"isVisible", lua_Joint_isVisible},
  81. {"release", lua_Joint_release},
  82. {"removeAllChildren", lua_Joint_removeAllChildren},
  83. {"removeChild", lua_Joint_removeChild},
  84. {"removeListener", lua_Joint_removeListener},
  85. {"rotate", lua_Joint_rotate},
  86. {"rotateX", lua_Joint_rotateX},
  87. {"rotateY", lua_Joint_rotateY},
  88. {"rotateZ", lua_Joint_rotateZ},
  89. {"scale", lua_Joint_scale},
  90. {"scaleX", lua_Joint_scaleX},
  91. {"scaleY", lua_Joint_scaleY},
  92. {"scaleZ", lua_Joint_scaleZ},
  93. {"set", lua_Joint_set},
  94. {"setAnimationPropertyValue", lua_Joint_setAnimationPropertyValue},
  95. {"setAudioSource", lua_Joint_setAudioSource},
  96. {"setCamera", lua_Joint_setCamera},
  97. {"setCollisionObject", lua_Joint_setCollisionObject},
  98. {"setDynamic", lua_Joint_setDynamic},
  99. {"setForm", lua_Joint_setForm},
  100. {"setId", lua_Joint_setId},
  101. {"setIdentity", lua_Joint_setIdentity},
  102. {"setLight", lua_Joint_setLight},
  103. {"setModel", lua_Joint_setModel},
  104. {"setParticleEmitter", lua_Joint_setParticleEmitter},
  105. {"setRotation", lua_Joint_setRotation},
  106. {"setScale", lua_Joint_setScale},
  107. {"setScaleX", lua_Joint_setScaleX},
  108. {"setScaleY", lua_Joint_setScaleY},
  109. {"setScaleZ", lua_Joint_setScaleZ},
  110. {"setTranslation", lua_Joint_setTranslation},
  111. {"setTranslationX", lua_Joint_setTranslationX},
  112. {"setTranslationY", lua_Joint_setTranslationY},
  113. {"setTranslationZ", lua_Joint_setTranslationZ},
  114. {"setTransparent", lua_Joint_setTransparent},
  115. {"setVisible", lua_Joint_setVisible},
  116. {"transformPoint", lua_Joint_transformPoint},
  117. {"transformVector", lua_Joint_transformVector},
  118. {"translate", lua_Joint_translate},
  119. {"translateForward", lua_Joint_translateForward},
  120. {"translateLeft", lua_Joint_translateLeft},
  121. {"translateUp", lua_Joint_translateUp},
  122. {"translateX", lua_Joint_translateX},
  123. {"translateY", lua_Joint_translateY},
  124. {"translateZ", lua_Joint_translateZ},
  125. {NULL, NULL}
  126. };
  127. const luaL_Reg lua_statics[] =
  128. {
  129. {"ANIMATE_ROTATE", lua_Joint_static_ANIMATE_ROTATE},
  130. {"ANIMATE_ROTATE_TRANSLATE", lua_Joint_static_ANIMATE_ROTATE_TRANSLATE},
  131. {"ANIMATE_SCALE", lua_Joint_static_ANIMATE_SCALE},
  132. {"ANIMATE_SCALE_ROTATE_TRANSLATE", lua_Joint_static_ANIMATE_SCALE_ROTATE_TRANSLATE},
  133. {"ANIMATE_SCALE_UNIT", lua_Joint_static_ANIMATE_SCALE_UNIT},
  134. {"ANIMATE_SCALE_X", lua_Joint_static_ANIMATE_SCALE_X},
  135. {"ANIMATE_SCALE_Y", lua_Joint_static_ANIMATE_SCALE_Y},
  136. {"ANIMATE_SCALE_Z", lua_Joint_static_ANIMATE_SCALE_Z},
  137. {"ANIMATE_TRANSLATE", lua_Joint_static_ANIMATE_TRANSLATE},
  138. {"ANIMATE_TRANSLATE_X", lua_Joint_static_ANIMATE_TRANSLATE_X},
  139. {"ANIMATE_TRANSLATE_Y", lua_Joint_static_ANIMATE_TRANSLATE_Y},
  140. {"ANIMATE_TRANSLATE_Z", lua_Joint_static_ANIMATE_TRANSLATE_Z},
  141. {"isTransformChangedSuspended", lua_Joint_static_isTransformChangedSuspended},
  142. {"resumeTransformChanged", lua_Joint_static_resumeTransformChanged},
  143. {"suspendTransformChanged", lua_Joint_static_suspendTransformChanged},
  144. {NULL, NULL}
  145. };
  146. std::vector<std::string> scopePath;
  147. sc->registerClass("Joint", lua_members, NULL, lua_Joint__gc, lua_statics, scopePath);
  148. }
  149. static Joint* getInstance(lua_State* state)
  150. {
  151. void* userdata = luaL_checkudata(state, 1, "Joint");
  152. luaL_argcheck(state, userdata != NULL, 1, "'Joint' expected.");
  153. return (Joint*)((ScriptController::LuaObject*)userdata)->instance;
  154. }
  155. int lua_Joint__gc(lua_State* state)
  156. {
  157. // Get the number of parameters.
  158. int paramCount = lua_gettop(state);
  159. // Attempt to match the parameters to a valid binding.
  160. switch (paramCount)
  161. {
  162. case 1:
  163. {
  164. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  165. {
  166. void* userdata = luaL_checkudata(state, 1, "Joint");
  167. luaL_argcheck(state, userdata != NULL, 1, "'Joint' expected.");
  168. ScriptController::LuaObject* object = (ScriptController::LuaObject*)userdata;
  169. if (object->owns)
  170. {
  171. Joint* instance = (Joint*)object->instance;
  172. SAFE_RELEASE(instance);
  173. }
  174. return 0;
  175. }
  176. else
  177. {
  178. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  179. lua_error(state);
  180. }
  181. break;
  182. }
  183. default:
  184. {
  185. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  186. lua_error(state);
  187. break;
  188. }
  189. }
  190. return 0;
  191. }
  192. int lua_Joint_addChild(lua_State* state)
  193. {
  194. // Get the number of parameters.
  195. int paramCount = lua_gettop(state);
  196. // Attempt to match the parameters to a valid binding.
  197. switch (paramCount)
  198. {
  199. case 2:
  200. {
  201. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  202. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  203. {
  204. // Get parameter 1 off the stack.
  205. Node* param1 = ScriptController::getInstance()->getObjectPointer<Node>(2, "Node", false);
  206. Joint* instance = getInstance(state);
  207. instance->addChild(param1);
  208. return 0;
  209. }
  210. else
  211. {
  212. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  213. lua_error(state);
  214. }
  215. break;
  216. }
  217. default:
  218. {
  219. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  220. lua_error(state);
  221. break;
  222. }
  223. }
  224. return 0;
  225. }
  226. int lua_Joint_addListener(lua_State* state)
  227. {
  228. // Get the number of parameters.
  229. int paramCount = lua_gettop(state);
  230. // Attempt to match the parameters to a valid binding.
  231. switch (paramCount)
  232. {
  233. case 2:
  234. {
  235. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  236. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  237. {
  238. // Get parameter 1 off the stack.
  239. Transform::Listener* param1 = ScriptController::getInstance()->getObjectPointer<Transform::Listener>(2, "TransformListener", false);
  240. Joint* instance = getInstance(state);
  241. instance->addListener(param1);
  242. return 0;
  243. }
  244. else
  245. {
  246. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  247. lua_error(state);
  248. }
  249. break;
  250. }
  251. case 3:
  252. {
  253. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  254. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  255. lua_type(state, 3) == LUA_TNUMBER)
  256. {
  257. // Get parameter 1 off the stack.
  258. Transform::Listener* param1 = ScriptController::getInstance()->getObjectPointer<Transform::Listener>(2, "TransformListener", false);
  259. // Get parameter 2 off the stack.
  260. long param2 = (long)luaL_checklong(state, 3);
  261. Joint* instance = getInstance(state);
  262. instance->addListener(param1, param2);
  263. return 0;
  264. }
  265. else
  266. {
  267. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  268. lua_error(state);
  269. }
  270. break;
  271. }
  272. default:
  273. {
  274. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  275. lua_error(state);
  276. break;
  277. }
  278. }
  279. return 0;
  280. }
  281. int lua_Joint_addRef(lua_State* state)
  282. {
  283. // Get the number of parameters.
  284. int paramCount = lua_gettop(state);
  285. // Attempt to match the parameters to a valid binding.
  286. switch (paramCount)
  287. {
  288. case 1:
  289. {
  290. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  291. {
  292. Joint* instance = getInstance(state);
  293. instance->addRef();
  294. return 0;
  295. }
  296. else
  297. {
  298. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  299. lua_error(state);
  300. }
  301. break;
  302. }
  303. default:
  304. {
  305. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  306. lua_error(state);
  307. break;
  308. }
  309. }
  310. return 0;
  311. }
  312. int lua_Joint_clone(lua_State* state)
  313. {
  314. // Get the number of parameters.
  315. int paramCount = lua_gettop(state);
  316. // Attempt to match the parameters to a valid binding.
  317. switch (paramCount)
  318. {
  319. case 1:
  320. {
  321. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  322. {
  323. Joint* instance = getInstance(state);
  324. void* returnPtr = (void*)instance->clone();
  325. if (returnPtr)
  326. {
  327. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  328. object->instance = returnPtr;
  329. object->owns = false;
  330. luaL_getmetatable(state, "Node");
  331. lua_setmetatable(state, -2);
  332. }
  333. else
  334. {
  335. lua_pushnil(state);
  336. }
  337. return 1;
  338. }
  339. else
  340. {
  341. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  342. lua_error(state);
  343. }
  344. break;
  345. }
  346. default:
  347. {
  348. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  349. lua_error(state);
  350. break;
  351. }
  352. }
  353. return 0;
  354. }
  355. int lua_Joint_createAnimation(lua_State* state)
  356. {
  357. // Get the number of parameters.
  358. int paramCount = lua_gettop(state);
  359. // Attempt to match the parameters to a valid binding.
  360. switch (paramCount)
  361. {
  362. case 3:
  363. {
  364. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  365. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  366. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  367. {
  368. // Get parameter 1 off the stack.
  369. const char* param1 = ScriptController::getInstance()->getString(2, false);
  370. // Get parameter 2 off the stack.
  371. const char* param2 = ScriptController::getInstance()->getString(3, false);
  372. Joint* instance = getInstance(state);
  373. void* returnPtr = (void*)instance->createAnimation(param1, param2);
  374. if (returnPtr)
  375. {
  376. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  377. object->instance = returnPtr;
  378. object->owns = false;
  379. luaL_getmetatable(state, "Animation");
  380. lua_setmetatable(state, -2);
  381. }
  382. else
  383. {
  384. lua_pushnil(state);
  385. }
  386. return 1;
  387. }
  388. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  389. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  390. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  391. {
  392. // Get parameter 1 off the stack.
  393. const char* param1 = ScriptController::getInstance()->getString(2, false);
  394. // Get parameter 2 off the stack.
  395. Properties* param2 = ScriptController::getInstance()->getObjectPointer<Properties>(3, "Properties", false);
  396. Joint* instance = getInstance(state);
  397. void* returnPtr = (void*)instance->createAnimation(param1, param2);
  398. if (returnPtr)
  399. {
  400. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  401. object->instance = returnPtr;
  402. object->owns = false;
  403. luaL_getmetatable(state, "Animation");
  404. lua_setmetatable(state, -2);
  405. }
  406. else
  407. {
  408. lua_pushnil(state);
  409. }
  410. return 1;
  411. }
  412. else
  413. {
  414. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  415. lua_error(state);
  416. }
  417. break;
  418. }
  419. case 7:
  420. {
  421. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  422. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  423. lua_type(state, 3) == LUA_TNUMBER &&
  424. lua_type(state, 4) == LUA_TNUMBER &&
  425. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  426. (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
  427. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL))
  428. {
  429. // Get parameter 1 off the stack.
  430. const char* param1 = ScriptController::getInstance()->getString(2, false);
  431. // Get parameter 2 off the stack.
  432. int param2 = (int)luaL_checkint(state, 3);
  433. // Get parameter 3 off the stack.
  434. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  435. // Get parameter 4 off the stack.
  436. unsigned long* param4 = ScriptController::getInstance()->getUnsignedLongPointer(5);
  437. // Get parameter 5 off the stack.
  438. float* param5 = ScriptController::getInstance()->getFloatPointer(6);
  439. // Get parameter 6 off the stack.
  440. Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7));
  441. Joint* instance = getInstance(state);
  442. void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6);
  443. if (returnPtr)
  444. {
  445. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  446. object->instance = returnPtr;
  447. object->owns = false;
  448. luaL_getmetatable(state, "Animation");
  449. lua_setmetatable(state, -2);
  450. }
  451. else
  452. {
  453. lua_pushnil(state);
  454. }
  455. return 1;
  456. }
  457. else
  458. {
  459. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  460. lua_error(state);
  461. }
  462. break;
  463. }
  464. case 9:
  465. {
  466. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  467. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  468. lua_type(state, 3) == LUA_TNUMBER &&
  469. lua_type(state, 4) == LUA_TNUMBER &&
  470. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  471. (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
  472. (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) &&
  473. (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) &&
  474. (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL))
  475. {
  476. // Get parameter 1 off the stack.
  477. const char* param1 = ScriptController::getInstance()->getString(2, false);
  478. // Get parameter 2 off the stack.
  479. int param2 = (int)luaL_checkint(state, 3);
  480. // Get parameter 3 off the stack.
  481. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  482. // Get parameter 4 off the stack.
  483. unsigned long* param4 = ScriptController::getInstance()->getUnsignedLongPointer(5);
  484. // Get parameter 5 off the stack.
  485. float* param5 = ScriptController::getInstance()->getFloatPointer(6);
  486. // Get parameter 6 off the stack.
  487. float* param6 = ScriptController::getInstance()->getFloatPointer(7);
  488. // Get parameter 7 off the stack.
  489. float* param7 = ScriptController::getInstance()->getFloatPointer(8);
  490. // Get parameter 8 off the stack.
  491. Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9));
  492. Joint* instance = getInstance(state);
  493. void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8);
  494. if (returnPtr)
  495. {
  496. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  497. object->instance = returnPtr;
  498. object->owns = false;
  499. luaL_getmetatable(state, "Animation");
  500. lua_setmetatable(state, -2);
  501. }
  502. else
  503. {
  504. lua_pushnil(state);
  505. }
  506. return 1;
  507. }
  508. else
  509. {
  510. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  511. lua_error(state);
  512. }
  513. break;
  514. }
  515. default:
  516. {
  517. lua_pushstring(state, "Invalid number of parameters (expected 3, 7 or 9).");
  518. lua_error(state);
  519. break;
  520. }
  521. }
  522. return 0;
  523. }
  524. int lua_Joint_createAnimationFromBy(lua_State* state)
  525. {
  526. // Get the number of parameters.
  527. int paramCount = lua_gettop(state);
  528. // Attempt to match the parameters to a valid binding.
  529. switch (paramCount)
  530. {
  531. case 7:
  532. {
  533. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  534. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  535. lua_type(state, 3) == LUA_TNUMBER &&
  536. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  537. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  538. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  539. lua_type(state, 7) == LUA_TNUMBER)
  540. {
  541. // Get parameter 1 off the stack.
  542. const char* param1 = ScriptController::getInstance()->getString(2, false);
  543. // Get parameter 2 off the stack.
  544. int param2 = (int)luaL_checkint(state, 3);
  545. // Get parameter 3 off the stack.
  546. float* param3 = ScriptController::getInstance()->getFloatPointer(4);
  547. // Get parameter 4 off the stack.
  548. float* param4 = ScriptController::getInstance()->getFloatPointer(5);
  549. // Get parameter 5 off the stack.
  550. Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
  551. // Get parameter 6 off the stack.
  552. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
  553. Joint* instance = getInstance(state);
  554. void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6);
  555. if (returnPtr)
  556. {
  557. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  558. object->instance = returnPtr;
  559. object->owns = false;
  560. luaL_getmetatable(state, "Animation");
  561. lua_setmetatable(state, -2);
  562. }
  563. else
  564. {
  565. lua_pushnil(state);
  566. }
  567. return 1;
  568. }
  569. else
  570. {
  571. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  572. lua_error(state);
  573. }
  574. break;
  575. }
  576. default:
  577. {
  578. lua_pushstring(state, "Invalid number of parameters (expected 7).");
  579. lua_error(state);
  580. break;
  581. }
  582. }
  583. return 0;
  584. }
  585. int lua_Joint_createAnimationFromTo(lua_State* state)
  586. {
  587. // Get the number of parameters.
  588. int paramCount = lua_gettop(state);
  589. // Attempt to match the parameters to a valid binding.
  590. switch (paramCount)
  591. {
  592. case 7:
  593. {
  594. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  595. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  596. lua_type(state, 3) == LUA_TNUMBER &&
  597. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  598. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  599. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  600. lua_type(state, 7) == LUA_TNUMBER)
  601. {
  602. // Get parameter 1 off the stack.
  603. const char* param1 = ScriptController::getInstance()->getString(2, false);
  604. // Get parameter 2 off the stack.
  605. int param2 = (int)luaL_checkint(state, 3);
  606. // Get parameter 3 off the stack.
  607. float* param3 = ScriptController::getInstance()->getFloatPointer(4);
  608. // Get parameter 4 off the stack.
  609. float* param4 = ScriptController::getInstance()->getFloatPointer(5);
  610. // Get parameter 5 off the stack.
  611. Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
  612. // Get parameter 6 off the stack.
  613. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
  614. Joint* instance = getInstance(state);
  615. void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6);
  616. if (returnPtr)
  617. {
  618. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  619. object->instance = returnPtr;
  620. object->owns = false;
  621. luaL_getmetatable(state, "Animation");
  622. lua_setmetatable(state, -2);
  623. }
  624. else
  625. {
  626. lua_pushnil(state);
  627. }
  628. return 1;
  629. }
  630. else
  631. {
  632. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  633. lua_error(state);
  634. }
  635. break;
  636. }
  637. default:
  638. {
  639. lua_pushstring(state, "Invalid number of parameters (expected 7).");
  640. lua_error(state);
  641. break;
  642. }
  643. }
  644. return 0;
  645. }
  646. int lua_Joint_destroyAnimation(lua_State* state)
  647. {
  648. // Get the number of parameters.
  649. int paramCount = lua_gettop(state);
  650. // Attempt to match the parameters to a valid binding.
  651. switch (paramCount)
  652. {
  653. case 1:
  654. {
  655. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  656. {
  657. Joint* instance = getInstance(state);
  658. instance->destroyAnimation();
  659. return 0;
  660. }
  661. else
  662. {
  663. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  664. lua_error(state);
  665. }
  666. break;
  667. }
  668. case 2:
  669. {
  670. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  671. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  672. {
  673. // Get parameter 1 off the stack.
  674. const char* param1 = ScriptController::getInstance()->getString(2, false);
  675. Joint* instance = getInstance(state);
  676. instance->destroyAnimation(param1);
  677. return 0;
  678. }
  679. else
  680. {
  681. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  682. lua_error(state);
  683. }
  684. break;
  685. }
  686. default:
  687. {
  688. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  689. lua_error(state);
  690. break;
  691. }
  692. }
  693. return 0;
  694. }
  695. int lua_Joint_findNode(lua_State* state)
  696. {
  697. // Get the number of parameters.
  698. int paramCount = lua_gettop(state);
  699. // Attempt to match the parameters to a valid binding.
  700. switch (paramCount)
  701. {
  702. case 2:
  703. {
  704. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  705. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  706. {
  707. // Get parameter 1 off the stack.
  708. const char* param1 = ScriptController::getInstance()->getString(2, false);
  709. Joint* instance = getInstance(state);
  710. void* returnPtr = (void*)instance->findNode(param1);
  711. if (returnPtr)
  712. {
  713. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  714. object->instance = returnPtr;
  715. object->owns = false;
  716. luaL_getmetatable(state, "Node");
  717. lua_setmetatable(state, -2);
  718. }
  719. else
  720. {
  721. lua_pushnil(state);
  722. }
  723. return 1;
  724. }
  725. else
  726. {
  727. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  728. lua_error(state);
  729. }
  730. break;
  731. }
  732. case 3:
  733. {
  734. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  735. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  736. lua_type(state, 3) == LUA_TBOOLEAN)
  737. {
  738. // Get parameter 1 off the stack.
  739. const char* param1 = ScriptController::getInstance()->getString(2, false);
  740. // Get parameter 2 off the stack.
  741. bool param2 = ScriptController::luaCheckBool(state, 3);
  742. Joint* instance = getInstance(state);
  743. void* returnPtr = (void*)instance->findNode(param1, param2);
  744. if (returnPtr)
  745. {
  746. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  747. object->instance = returnPtr;
  748. object->owns = false;
  749. luaL_getmetatable(state, "Node");
  750. lua_setmetatable(state, -2);
  751. }
  752. else
  753. {
  754. lua_pushnil(state);
  755. }
  756. return 1;
  757. }
  758. else
  759. {
  760. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  761. lua_error(state);
  762. }
  763. break;
  764. }
  765. case 4:
  766. {
  767. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  768. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  769. lua_type(state, 3) == LUA_TBOOLEAN &&
  770. lua_type(state, 4) == LUA_TBOOLEAN)
  771. {
  772. // Get parameter 1 off the stack.
  773. const char* param1 = ScriptController::getInstance()->getString(2, false);
  774. // Get parameter 2 off the stack.
  775. bool param2 = ScriptController::luaCheckBool(state, 3);
  776. // Get parameter 3 off the stack.
  777. bool param3 = ScriptController::luaCheckBool(state, 4);
  778. Joint* instance = getInstance(state);
  779. void* returnPtr = (void*)instance->findNode(param1, param2, param3);
  780. if (returnPtr)
  781. {
  782. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  783. object->instance = returnPtr;
  784. object->owns = false;
  785. luaL_getmetatable(state, "Node");
  786. lua_setmetatable(state, -2);
  787. }
  788. else
  789. {
  790. lua_pushnil(state);
  791. }
  792. return 1;
  793. }
  794. else
  795. {
  796. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  797. lua_error(state);
  798. }
  799. break;
  800. }
  801. default:
  802. {
  803. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4).");
  804. lua_error(state);
  805. break;
  806. }
  807. }
  808. return 0;
  809. }
  810. int lua_Joint_getActiveCameraTranslationView(lua_State* state)
  811. {
  812. // Get the number of parameters.
  813. int paramCount = lua_gettop(state);
  814. // Attempt to match the parameters to a valid binding.
  815. switch (paramCount)
  816. {
  817. case 1:
  818. {
  819. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  820. {
  821. Joint* instance = getInstance(state);
  822. void* returnPtr = (void*)new Vector3(instance->getActiveCameraTranslationView());
  823. if (returnPtr)
  824. {
  825. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  826. object->instance = returnPtr;
  827. object->owns = true;
  828. luaL_getmetatable(state, "Vector3");
  829. lua_setmetatable(state, -2);
  830. }
  831. else
  832. {
  833. lua_pushnil(state);
  834. }
  835. return 1;
  836. }
  837. else
  838. {
  839. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  840. lua_error(state);
  841. }
  842. break;
  843. }
  844. default:
  845. {
  846. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  847. lua_error(state);
  848. break;
  849. }
  850. }
  851. return 0;
  852. }
  853. int lua_Joint_getActiveCameraTranslationWorld(lua_State* state)
  854. {
  855. // Get the number of parameters.
  856. int paramCount = lua_gettop(state);
  857. // Attempt to match the parameters to a valid binding.
  858. switch (paramCount)
  859. {
  860. case 1:
  861. {
  862. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  863. {
  864. Joint* instance = getInstance(state);
  865. void* returnPtr = (void*)new Vector3(instance->getActiveCameraTranslationWorld());
  866. if (returnPtr)
  867. {
  868. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  869. object->instance = returnPtr;
  870. object->owns = true;
  871. luaL_getmetatable(state, "Vector3");
  872. lua_setmetatable(state, -2);
  873. }
  874. else
  875. {
  876. lua_pushnil(state);
  877. }
  878. return 1;
  879. }
  880. else
  881. {
  882. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  883. lua_error(state);
  884. }
  885. break;
  886. }
  887. default:
  888. {
  889. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  890. lua_error(state);
  891. break;
  892. }
  893. }
  894. return 0;
  895. }
  896. int lua_Joint_getAnimation(lua_State* state)
  897. {
  898. // Get the number of parameters.
  899. int paramCount = lua_gettop(state);
  900. // Attempt to match the parameters to a valid binding.
  901. switch (paramCount)
  902. {
  903. case 1:
  904. {
  905. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  906. {
  907. Joint* instance = getInstance(state);
  908. void* returnPtr = (void*)instance->getAnimation();
  909. if (returnPtr)
  910. {
  911. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  912. object->instance = returnPtr;
  913. object->owns = false;
  914. luaL_getmetatable(state, "Animation");
  915. lua_setmetatable(state, -2);
  916. }
  917. else
  918. {
  919. lua_pushnil(state);
  920. }
  921. return 1;
  922. }
  923. else
  924. {
  925. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  926. lua_error(state);
  927. }
  928. break;
  929. }
  930. case 2:
  931. {
  932. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  933. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  934. {
  935. // Get parameter 1 off the stack.
  936. const char* param1 = ScriptController::getInstance()->getString(2, false);
  937. Joint* instance = getInstance(state);
  938. void* returnPtr = (void*)instance->getAnimation(param1);
  939. if (returnPtr)
  940. {
  941. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  942. object->instance = returnPtr;
  943. object->owns = false;
  944. luaL_getmetatable(state, "Animation");
  945. lua_setmetatable(state, -2);
  946. }
  947. else
  948. {
  949. lua_pushnil(state);
  950. }
  951. return 1;
  952. }
  953. else
  954. {
  955. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  956. lua_error(state);
  957. }
  958. break;
  959. }
  960. default:
  961. {
  962. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  963. lua_error(state);
  964. break;
  965. }
  966. }
  967. return 0;
  968. }
  969. int lua_Joint_getAnimationPropertyComponentCount(lua_State* state)
  970. {
  971. // Get the number of parameters.
  972. int paramCount = lua_gettop(state);
  973. // Attempt to match the parameters to a valid binding.
  974. switch (paramCount)
  975. {
  976. case 2:
  977. {
  978. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  979. lua_type(state, 2) == LUA_TNUMBER)
  980. {
  981. // Get parameter 1 off the stack.
  982. int param1 = (int)luaL_checkint(state, 2);
  983. Joint* instance = getInstance(state);
  984. unsigned int result = instance->getAnimationPropertyComponentCount(param1);
  985. // Push the return value onto the stack.
  986. lua_pushunsigned(state, result);
  987. return 1;
  988. }
  989. else
  990. {
  991. lua_pushstring(state, "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 2).");
  999. lua_error(state);
  1000. break;
  1001. }
  1002. }
  1003. return 0;
  1004. }
  1005. int lua_Joint_getAnimationPropertyValue(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 3:
  1013. {
  1014. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1015. lua_type(state, 2) == LUA_TNUMBER &&
  1016. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  1017. {
  1018. // Get parameter 1 off the stack.
  1019. int param1 = (int)luaL_checkint(state, 2);
  1020. // Get parameter 2 off the stack.
  1021. AnimationValue* param2 = ScriptController::getInstance()->getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  1022. Joint* instance = getInstance(state);
  1023. instance->getAnimationPropertyValue(param1, param2);
  1024. return 0;
  1025. }
  1026. else
  1027. {
  1028. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1029. lua_error(state);
  1030. }
  1031. break;
  1032. }
  1033. default:
  1034. {
  1035. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1036. lua_error(state);
  1037. break;
  1038. }
  1039. }
  1040. return 0;
  1041. }
  1042. int lua_Joint_getAudioSource(lua_State* state)
  1043. {
  1044. // Get the number of parameters.
  1045. int paramCount = lua_gettop(state);
  1046. // Attempt to match the parameters to a valid binding.
  1047. switch (paramCount)
  1048. {
  1049. case 1:
  1050. {
  1051. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1052. {
  1053. Joint* instance = getInstance(state);
  1054. void* returnPtr = (void*)instance->getAudioSource();
  1055. if (returnPtr)
  1056. {
  1057. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1058. object->instance = returnPtr;
  1059. object->owns = false;
  1060. luaL_getmetatable(state, "AudioSource");
  1061. lua_setmetatable(state, -2);
  1062. }
  1063. else
  1064. {
  1065. lua_pushnil(state);
  1066. }
  1067. return 1;
  1068. }
  1069. else
  1070. {
  1071. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1072. lua_error(state);
  1073. }
  1074. break;
  1075. }
  1076. default:
  1077. {
  1078. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1079. lua_error(state);
  1080. break;
  1081. }
  1082. }
  1083. return 0;
  1084. }
  1085. int lua_Joint_getBackVector(lua_State* state)
  1086. {
  1087. // Get the number of parameters.
  1088. int paramCount = lua_gettop(state);
  1089. // Attempt to match the parameters to a valid binding.
  1090. switch (paramCount)
  1091. {
  1092. case 1:
  1093. {
  1094. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1095. {
  1096. Joint* instance = getInstance(state);
  1097. void* returnPtr = (void*)new Vector3(instance->getBackVector());
  1098. if (returnPtr)
  1099. {
  1100. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1101. object->instance = returnPtr;
  1102. object->owns = true;
  1103. luaL_getmetatable(state, "Vector3");
  1104. lua_setmetatable(state, -2);
  1105. }
  1106. else
  1107. {
  1108. lua_pushnil(state);
  1109. }
  1110. return 1;
  1111. }
  1112. else
  1113. {
  1114. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1115. lua_error(state);
  1116. }
  1117. break;
  1118. }
  1119. case 2:
  1120. {
  1121. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1122. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1123. {
  1124. // Get parameter 1 off the stack.
  1125. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  1126. Joint* instance = getInstance(state);
  1127. instance->getBackVector(param1);
  1128. return 0;
  1129. }
  1130. else
  1131. {
  1132. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1133. lua_error(state);
  1134. }
  1135. break;
  1136. }
  1137. default:
  1138. {
  1139. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1140. lua_error(state);
  1141. break;
  1142. }
  1143. }
  1144. return 0;
  1145. }
  1146. int lua_Joint_getBoundingSphere(lua_State* state)
  1147. {
  1148. // Get the number of parameters.
  1149. int paramCount = lua_gettop(state);
  1150. // Attempt to match the parameters to a valid binding.
  1151. switch (paramCount)
  1152. {
  1153. case 1:
  1154. {
  1155. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1156. {
  1157. Joint* instance = getInstance(state);
  1158. void* returnPtr = (void*)&(instance->getBoundingSphere());
  1159. if (returnPtr)
  1160. {
  1161. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1162. object->instance = returnPtr;
  1163. object->owns = false;
  1164. luaL_getmetatable(state, "BoundingSphere");
  1165. lua_setmetatable(state, -2);
  1166. }
  1167. else
  1168. {
  1169. lua_pushnil(state);
  1170. }
  1171. return 1;
  1172. }
  1173. else
  1174. {
  1175. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1176. lua_error(state);
  1177. }
  1178. break;
  1179. }
  1180. default:
  1181. {
  1182. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1183. lua_error(state);
  1184. break;
  1185. }
  1186. }
  1187. return 0;
  1188. }
  1189. int lua_Joint_getCamera(lua_State* state)
  1190. {
  1191. // Get the number of parameters.
  1192. int paramCount = lua_gettop(state);
  1193. // Attempt to match the parameters to a valid binding.
  1194. switch (paramCount)
  1195. {
  1196. case 1:
  1197. {
  1198. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1199. {
  1200. Joint* instance = getInstance(state);
  1201. void* returnPtr = (void*)instance->getCamera();
  1202. if (returnPtr)
  1203. {
  1204. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1205. object->instance = returnPtr;
  1206. object->owns = false;
  1207. luaL_getmetatable(state, "Camera");
  1208. lua_setmetatable(state, -2);
  1209. }
  1210. else
  1211. {
  1212. lua_pushnil(state);
  1213. }
  1214. return 1;
  1215. }
  1216. else
  1217. {
  1218. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1219. lua_error(state);
  1220. }
  1221. break;
  1222. }
  1223. default:
  1224. {
  1225. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1226. lua_error(state);
  1227. break;
  1228. }
  1229. }
  1230. return 0;
  1231. }
  1232. int lua_Joint_getChildCount(lua_State* state)
  1233. {
  1234. // Get the number of parameters.
  1235. int paramCount = lua_gettop(state);
  1236. // Attempt to match the parameters to a valid binding.
  1237. switch (paramCount)
  1238. {
  1239. case 1:
  1240. {
  1241. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1242. {
  1243. Joint* instance = getInstance(state);
  1244. unsigned int result = instance->getChildCount();
  1245. // Push the return value onto the stack.
  1246. lua_pushunsigned(state, result);
  1247. return 1;
  1248. }
  1249. else
  1250. {
  1251. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1252. lua_error(state);
  1253. }
  1254. break;
  1255. }
  1256. default:
  1257. {
  1258. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1259. lua_error(state);
  1260. break;
  1261. }
  1262. }
  1263. return 0;
  1264. }
  1265. int lua_Joint_getCollisionObject(lua_State* state)
  1266. {
  1267. // Get the number of parameters.
  1268. int paramCount = lua_gettop(state);
  1269. // Attempt to match the parameters to a valid binding.
  1270. switch (paramCount)
  1271. {
  1272. case 1:
  1273. {
  1274. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1275. {
  1276. Joint* instance = getInstance(state);
  1277. void* returnPtr = (void*)instance->getCollisionObject();
  1278. if (returnPtr)
  1279. {
  1280. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1281. object->instance = returnPtr;
  1282. object->owns = false;
  1283. luaL_getmetatable(state, "PhysicsCollisionObject");
  1284. lua_setmetatable(state, -2);
  1285. }
  1286. else
  1287. {
  1288. lua_pushnil(state);
  1289. }
  1290. return 1;
  1291. }
  1292. else
  1293. {
  1294. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1295. lua_error(state);
  1296. }
  1297. break;
  1298. }
  1299. default:
  1300. {
  1301. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1302. lua_error(state);
  1303. break;
  1304. }
  1305. }
  1306. return 0;
  1307. }
  1308. int lua_Joint_getDownVector(lua_State* state)
  1309. {
  1310. // Get the number of parameters.
  1311. int paramCount = lua_gettop(state);
  1312. // Attempt to match the parameters to a valid binding.
  1313. switch (paramCount)
  1314. {
  1315. case 1:
  1316. {
  1317. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1318. {
  1319. Joint* instance = getInstance(state);
  1320. void* returnPtr = (void*)new Vector3(instance->getDownVector());
  1321. if (returnPtr)
  1322. {
  1323. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1324. object->instance = returnPtr;
  1325. object->owns = true;
  1326. luaL_getmetatable(state, "Vector3");
  1327. lua_setmetatable(state, -2);
  1328. }
  1329. else
  1330. {
  1331. lua_pushnil(state);
  1332. }
  1333. return 1;
  1334. }
  1335. else
  1336. {
  1337. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1338. lua_error(state);
  1339. }
  1340. break;
  1341. }
  1342. case 2:
  1343. {
  1344. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1345. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1346. {
  1347. // Get parameter 1 off the stack.
  1348. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  1349. Joint* instance = getInstance(state);
  1350. instance->getDownVector(param1);
  1351. return 0;
  1352. }
  1353. else
  1354. {
  1355. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1356. lua_error(state);
  1357. }
  1358. break;
  1359. }
  1360. default:
  1361. {
  1362. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1363. lua_error(state);
  1364. break;
  1365. }
  1366. }
  1367. return 0;
  1368. }
  1369. int lua_Joint_getFirstChild(lua_State* state)
  1370. {
  1371. // Get the number of parameters.
  1372. int paramCount = lua_gettop(state);
  1373. // Attempt to match the parameters to a valid binding.
  1374. switch (paramCount)
  1375. {
  1376. case 1:
  1377. {
  1378. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1379. {
  1380. Joint* instance = getInstance(state);
  1381. void* returnPtr = (void*)instance->getFirstChild();
  1382. if (returnPtr)
  1383. {
  1384. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1385. object->instance = returnPtr;
  1386. object->owns = false;
  1387. luaL_getmetatable(state, "Node");
  1388. lua_setmetatable(state, -2);
  1389. }
  1390. else
  1391. {
  1392. lua_pushnil(state);
  1393. }
  1394. return 1;
  1395. }
  1396. else
  1397. {
  1398. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1399. lua_error(state);
  1400. }
  1401. break;
  1402. }
  1403. default:
  1404. {
  1405. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1406. lua_error(state);
  1407. break;
  1408. }
  1409. }
  1410. return 0;
  1411. }
  1412. int lua_Joint_getForm(lua_State* state)
  1413. {
  1414. // Get the number of parameters.
  1415. int paramCount = lua_gettop(state);
  1416. // Attempt to match the parameters to a valid binding.
  1417. switch (paramCount)
  1418. {
  1419. case 1:
  1420. {
  1421. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1422. {
  1423. Joint* instance = getInstance(state);
  1424. void* returnPtr = (void*)instance->getForm();
  1425. if (returnPtr)
  1426. {
  1427. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1428. object->instance = returnPtr;
  1429. object->owns = false;
  1430. luaL_getmetatable(state, "Form");
  1431. lua_setmetatable(state, -2);
  1432. }
  1433. else
  1434. {
  1435. lua_pushnil(state);
  1436. }
  1437. return 1;
  1438. }
  1439. else
  1440. {
  1441. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1442. lua_error(state);
  1443. }
  1444. break;
  1445. }
  1446. default:
  1447. {
  1448. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1449. lua_error(state);
  1450. break;
  1451. }
  1452. }
  1453. return 0;
  1454. }
  1455. int lua_Joint_getForwardVector(lua_State* state)
  1456. {
  1457. // Get the number of parameters.
  1458. int paramCount = lua_gettop(state);
  1459. // Attempt to match the parameters to a valid binding.
  1460. switch (paramCount)
  1461. {
  1462. case 1:
  1463. {
  1464. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1465. {
  1466. Joint* instance = getInstance(state);
  1467. void* returnPtr = (void*)new Vector3(instance->getForwardVector());
  1468. if (returnPtr)
  1469. {
  1470. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1471. object->instance = returnPtr;
  1472. object->owns = true;
  1473. luaL_getmetatable(state, "Vector3");
  1474. lua_setmetatable(state, -2);
  1475. }
  1476. else
  1477. {
  1478. lua_pushnil(state);
  1479. }
  1480. return 1;
  1481. }
  1482. else
  1483. {
  1484. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1485. lua_error(state);
  1486. }
  1487. break;
  1488. }
  1489. case 2:
  1490. {
  1491. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1492. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1493. {
  1494. // Get parameter 1 off the stack.
  1495. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  1496. Joint* instance = getInstance(state);
  1497. instance->getForwardVector(param1);
  1498. return 0;
  1499. }
  1500. else
  1501. {
  1502. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1503. lua_error(state);
  1504. }
  1505. break;
  1506. }
  1507. default:
  1508. {
  1509. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1510. lua_error(state);
  1511. break;
  1512. }
  1513. }
  1514. return 0;
  1515. }
  1516. int lua_Joint_getForwardVectorView(lua_State* state)
  1517. {
  1518. // Get the number of parameters.
  1519. int paramCount = lua_gettop(state);
  1520. // Attempt to match the parameters to a valid binding.
  1521. switch (paramCount)
  1522. {
  1523. case 1:
  1524. {
  1525. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1526. {
  1527. Joint* instance = getInstance(state);
  1528. void* returnPtr = (void*)new Vector3(instance->getForwardVectorView());
  1529. if (returnPtr)
  1530. {
  1531. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1532. object->instance = returnPtr;
  1533. object->owns = true;
  1534. luaL_getmetatable(state, "Vector3");
  1535. lua_setmetatable(state, -2);
  1536. }
  1537. else
  1538. {
  1539. lua_pushnil(state);
  1540. }
  1541. return 1;
  1542. }
  1543. else
  1544. {
  1545. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1546. lua_error(state);
  1547. }
  1548. break;
  1549. }
  1550. default:
  1551. {
  1552. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1553. lua_error(state);
  1554. break;
  1555. }
  1556. }
  1557. return 0;
  1558. }
  1559. int lua_Joint_getForwardVectorWorld(lua_State* state)
  1560. {
  1561. // Get the number of parameters.
  1562. int paramCount = lua_gettop(state);
  1563. // Attempt to match the parameters to a valid binding.
  1564. switch (paramCount)
  1565. {
  1566. case 1:
  1567. {
  1568. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1569. {
  1570. Joint* instance = getInstance(state);
  1571. void* returnPtr = (void*)new Vector3(instance->getForwardVectorWorld());
  1572. if (returnPtr)
  1573. {
  1574. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1575. object->instance = returnPtr;
  1576. object->owns = true;
  1577. luaL_getmetatable(state, "Vector3");
  1578. lua_setmetatable(state, -2);
  1579. }
  1580. else
  1581. {
  1582. lua_pushnil(state);
  1583. }
  1584. return 1;
  1585. }
  1586. else
  1587. {
  1588. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1589. lua_error(state);
  1590. }
  1591. break;
  1592. }
  1593. default:
  1594. {
  1595. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1596. lua_error(state);
  1597. break;
  1598. }
  1599. }
  1600. return 0;
  1601. }
  1602. int lua_Joint_getId(lua_State* state)
  1603. {
  1604. // Get the number of parameters.
  1605. int paramCount = lua_gettop(state);
  1606. // Attempt to match the parameters to a valid binding.
  1607. switch (paramCount)
  1608. {
  1609. case 1:
  1610. {
  1611. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1612. {
  1613. Joint* instance = getInstance(state);
  1614. const char* result = instance->getId();
  1615. // Push the return value onto the stack.
  1616. lua_pushstring(state, result);
  1617. return 1;
  1618. }
  1619. else
  1620. {
  1621. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1622. lua_error(state);
  1623. }
  1624. break;
  1625. }
  1626. default:
  1627. {
  1628. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1629. lua_error(state);
  1630. break;
  1631. }
  1632. }
  1633. return 0;
  1634. }
  1635. int lua_Joint_getInverseBindPose(lua_State* state)
  1636. {
  1637. // Get the number of parameters.
  1638. int paramCount = lua_gettop(state);
  1639. // Attempt to match the parameters to a valid binding.
  1640. switch (paramCount)
  1641. {
  1642. case 1:
  1643. {
  1644. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1645. {
  1646. Joint* instance = getInstance(state);
  1647. void* returnPtr = (void*)&(instance->getInverseBindPose());
  1648. if (returnPtr)
  1649. {
  1650. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1651. object->instance = returnPtr;
  1652. object->owns = false;
  1653. luaL_getmetatable(state, "Matrix");
  1654. lua_setmetatable(state, -2);
  1655. }
  1656. else
  1657. {
  1658. lua_pushnil(state);
  1659. }
  1660. return 1;
  1661. }
  1662. else
  1663. {
  1664. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1665. lua_error(state);
  1666. }
  1667. break;
  1668. }
  1669. default:
  1670. {
  1671. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1672. lua_error(state);
  1673. break;
  1674. }
  1675. }
  1676. return 0;
  1677. }
  1678. int lua_Joint_getInverseTransposeWorldMatrix(lua_State* state)
  1679. {
  1680. // Get the number of parameters.
  1681. int paramCount = lua_gettop(state);
  1682. // Attempt to match the parameters to a valid binding.
  1683. switch (paramCount)
  1684. {
  1685. case 1:
  1686. {
  1687. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1688. {
  1689. Joint* instance = getInstance(state);
  1690. void* returnPtr = (void*)&(instance->getInverseTransposeWorldMatrix());
  1691. if (returnPtr)
  1692. {
  1693. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1694. object->instance = returnPtr;
  1695. object->owns = false;
  1696. luaL_getmetatable(state, "Matrix");
  1697. lua_setmetatable(state, -2);
  1698. }
  1699. else
  1700. {
  1701. lua_pushnil(state);
  1702. }
  1703. return 1;
  1704. }
  1705. else
  1706. {
  1707. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1708. lua_error(state);
  1709. }
  1710. break;
  1711. }
  1712. default:
  1713. {
  1714. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1715. lua_error(state);
  1716. break;
  1717. }
  1718. }
  1719. return 0;
  1720. }
  1721. int lua_Joint_getInverseTransposeWorldViewMatrix(lua_State* state)
  1722. {
  1723. // Get the number of parameters.
  1724. int paramCount = lua_gettop(state);
  1725. // Attempt to match the parameters to a valid binding.
  1726. switch (paramCount)
  1727. {
  1728. case 1:
  1729. {
  1730. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1731. {
  1732. Joint* instance = getInstance(state);
  1733. void* returnPtr = (void*)&(instance->getInverseTransposeWorldViewMatrix());
  1734. if (returnPtr)
  1735. {
  1736. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1737. object->instance = returnPtr;
  1738. object->owns = false;
  1739. luaL_getmetatable(state, "Matrix");
  1740. lua_setmetatable(state, -2);
  1741. }
  1742. else
  1743. {
  1744. lua_pushnil(state);
  1745. }
  1746. return 1;
  1747. }
  1748. else
  1749. {
  1750. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1751. lua_error(state);
  1752. }
  1753. break;
  1754. }
  1755. default:
  1756. {
  1757. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1758. lua_error(state);
  1759. break;
  1760. }
  1761. }
  1762. return 0;
  1763. }
  1764. int lua_Joint_getInverseViewMatrix(lua_State* state)
  1765. {
  1766. // Get the number of parameters.
  1767. int paramCount = lua_gettop(state);
  1768. // Attempt to match the parameters to a valid binding.
  1769. switch (paramCount)
  1770. {
  1771. case 1:
  1772. {
  1773. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1774. {
  1775. Joint* instance = getInstance(state);
  1776. void* returnPtr = (void*)&(instance->getInverseViewMatrix());
  1777. if (returnPtr)
  1778. {
  1779. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1780. object->instance = returnPtr;
  1781. object->owns = false;
  1782. luaL_getmetatable(state, "Matrix");
  1783. lua_setmetatable(state, -2);
  1784. }
  1785. else
  1786. {
  1787. lua_pushnil(state);
  1788. }
  1789. return 1;
  1790. }
  1791. else
  1792. {
  1793. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1794. lua_error(state);
  1795. }
  1796. break;
  1797. }
  1798. default:
  1799. {
  1800. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1801. lua_error(state);
  1802. break;
  1803. }
  1804. }
  1805. return 0;
  1806. }
  1807. int lua_Joint_getInverseViewProjectionMatrix(lua_State* state)
  1808. {
  1809. // Get the number of parameters.
  1810. int paramCount = lua_gettop(state);
  1811. // Attempt to match the parameters to a valid binding.
  1812. switch (paramCount)
  1813. {
  1814. case 1:
  1815. {
  1816. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1817. {
  1818. Joint* instance = getInstance(state);
  1819. void* returnPtr = (void*)&(instance->getInverseViewProjectionMatrix());
  1820. if (returnPtr)
  1821. {
  1822. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1823. object->instance = returnPtr;
  1824. object->owns = false;
  1825. luaL_getmetatable(state, "Matrix");
  1826. lua_setmetatable(state, -2);
  1827. }
  1828. else
  1829. {
  1830. lua_pushnil(state);
  1831. }
  1832. return 1;
  1833. }
  1834. else
  1835. {
  1836. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1837. lua_error(state);
  1838. }
  1839. break;
  1840. }
  1841. default:
  1842. {
  1843. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1844. lua_error(state);
  1845. break;
  1846. }
  1847. }
  1848. return 0;
  1849. }
  1850. int lua_Joint_getLeftVector(lua_State* state)
  1851. {
  1852. // Get the number of parameters.
  1853. int paramCount = lua_gettop(state);
  1854. // Attempt to match the parameters to a valid binding.
  1855. switch (paramCount)
  1856. {
  1857. case 1:
  1858. {
  1859. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1860. {
  1861. Joint* instance = getInstance(state);
  1862. void* returnPtr = (void*)new Vector3(instance->getLeftVector());
  1863. if (returnPtr)
  1864. {
  1865. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1866. object->instance = returnPtr;
  1867. object->owns = true;
  1868. luaL_getmetatable(state, "Vector3");
  1869. lua_setmetatable(state, -2);
  1870. }
  1871. else
  1872. {
  1873. lua_pushnil(state);
  1874. }
  1875. return 1;
  1876. }
  1877. else
  1878. {
  1879. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1880. lua_error(state);
  1881. }
  1882. break;
  1883. }
  1884. case 2:
  1885. {
  1886. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  1887. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  1888. {
  1889. // Get parameter 1 off the stack.
  1890. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  1891. Joint* instance = getInstance(state);
  1892. instance->getLeftVector(param1);
  1893. return 0;
  1894. }
  1895. else
  1896. {
  1897. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1898. lua_error(state);
  1899. }
  1900. break;
  1901. }
  1902. default:
  1903. {
  1904. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1905. lua_error(state);
  1906. break;
  1907. }
  1908. }
  1909. return 0;
  1910. }
  1911. int lua_Joint_getLight(lua_State* state)
  1912. {
  1913. // Get the number of parameters.
  1914. int paramCount = lua_gettop(state);
  1915. // Attempt to match the parameters to a valid binding.
  1916. switch (paramCount)
  1917. {
  1918. case 1:
  1919. {
  1920. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1921. {
  1922. Joint* instance = getInstance(state);
  1923. void* returnPtr = (void*)instance->getLight();
  1924. if (returnPtr)
  1925. {
  1926. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1927. object->instance = returnPtr;
  1928. object->owns = false;
  1929. luaL_getmetatable(state, "Light");
  1930. lua_setmetatable(state, -2);
  1931. }
  1932. else
  1933. {
  1934. lua_pushnil(state);
  1935. }
  1936. return 1;
  1937. }
  1938. else
  1939. {
  1940. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1941. lua_error(state);
  1942. }
  1943. break;
  1944. }
  1945. default:
  1946. {
  1947. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1948. lua_error(state);
  1949. break;
  1950. }
  1951. }
  1952. return 0;
  1953. }
  1954. int lua_Joint_getMatrix(lua_State* state)
  1955. {
  1956. // Get the number of parameters.
  1957. int paramCount = lua_gettop(state);
  1958. // Attempt to match the parameters to a valid binding.
  1959. switch (paramCount)
  1960. {
  1961. case 1:
  1962. {
  1963. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  1964. {
  1965. Joint* instance = getInstance(state);
  1966. void* returnPtr = (void*)&(instance->getMatrix());
  1967. if (returnPtr)
  1968. {
  1969. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  1970. object->instance = returnPtr;
  1971. object->owns = false;
  1972. luaL_getmetatable(state, "Matrix");
  1973. lua_setmetatable(state, -2);
  1974. }
  1975. else
  1976. {
  1977. lua_pushnil(state);
  1978. }
  1979. return 1;
  1980. }
  1981. else
  1982. {
  1983. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  1984. lua_error(state);
  1985. }
  1986. break;
  1987. }
  1988. default:
  1989. {
  1990. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1991. lua_error(state);
  1992. break;
  1993. }
  1994. }
  1995. return 0;
  1996. }
  1997. int lua_Joint_getModel(lua_State* state)
  1998. {
  1999. // Get the number of parameters.
  2000. int paramCount = lua_gettop(state);
  2001. // Attempt to match the parameters to a valid binding.
  2002. switch (paramCount)
  2003. {
  2004. case 1:
  2005. {
  2006. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2007. {
  2008. Joint* instance = getInstance(state);
  2009. void* returnPtr = (void*)instance->getModel();
  2010. if (returnPtr)
  2011. {
  2012. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2013. object->instance = returnPtr;
  2014. object->owns = false;
  2015. luaL_getmetatable(state, "Model");
  2016. lua_setmetatable(state, -2);
  2017. }
  2018. else
  2019. {
  2020. lua_pushnil(state);
  2021. }
  2022. return 1;
  2023. }
  2024. else
  2025. {
  2026. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2027. lua_error(state);
  2028. }
  2029. break;
  2030. }
  2031. default:
  2032. {
  2033. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2034. lua_error(state);
  2035. break;
  2036. }
  2037. }
  2038. return 0;
  2039. }
  2040. int lua_Joint_getNextSibling(lua_State* state)
  2041. {
  2042. // Get the number of parameters.
  2043. int paramCount = lua_gettop(state);
  2044. // Attempt to match the parameters to a valid binding.
  2045. switch (paramCount)
  2046. {
  2047. case 1:
  2048. {
  2049. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2050. {
  2051. Joint* instance = getInstance(state);
  2052. void* returnPtr = (void*)instance->getNextSibling();
  2053. if (returnPtr)
  2054. {
  2055. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2056. object->instance = returnPtr;
  2057. object->owns = false;
  2058. luaL_getmetatable(state, "Node");
  2059. lua_setmetatable(state, -2);
  2060. }
  2061. else
  2062. {
  2063. lua_pushnil(state);
  2064. }
  2065. return 1;
  2066. }
  2067. else
  2068. {
  2069. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2070. lua_error(state);
  2071. }
  2072. break;
  2073. }
  2074. default:
  2075. {
  2076. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2077. lua_error(state);
  2078. break;
  2079. }
  2080. }
  2081. return 0;
  2082. }
  2083. int lua_Joint_getParent(lua_State* state)
  2084. {
  2085. // Get the number of parameters.
  2086. int paramCount = lua_gettop(state);
  2087. // Attempt to match the parameters to a valid binding.
  2088. switch (paramCount)
  2089. {
  2090. case 1:
  2091. {
  2092. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2093. {
  2094. Joint* instance = getInstance(state);
  2095. void* returnPtr = (void*)instance->getParent();
  2096. if (returnPtr)
  2097. {
  2098. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2099. object->instance = returnPtr;
  2100. object->owns = false;
  2101. luaL_getmetatable(state, "Node");
  2102. lua_setmetatable(state, -2);
  2103. }
  2104. else
  2105. {
  2106. lua_pushnil(state);
  2107. }
  2108. return 1;
  2109. }
  2110. else
  2111. {
  2112. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2113. lua_error(state);
  2114. }
  2115. break;
  2116. }
  2117. default:
  2118. {
  2119. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2120. lua_error(state);
  2121. break;
  2122. }
  2123. }
  2124. return 0;
  2125. }
  2126. int lua_Joint_getParticleEmitter(lua_State* state)
  2127. {
  2128. // Get the number of parameters.
  2129. int paramCount = lua_gettop(state);
  2130. // Attempt to match the parameters to a valid binding.
  2131. switch (paramCount)
  2132. {
  2133. case 1:
  2134. {
  2135. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2136. {
  2137. Joint* instance = getInstance(state);
  2138. void* returnPtr = (void*)instance->getParticleEmitter();
  2139. if (returnPtr)
  2140. {
  2141. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2142. object->instance = returnPtr;
  2143. object->owns = false;
  2144. luaL_getmetatable(state, "ParticleEmitter");
  2145. lua_setmetatable(state, -2);
  2146. }
  2147. else
  2148. {
  2149. lua_pushnil(state);
  2150. }
  2151. return 1;
  2152. }
  2153. else
  2154. {
  2155. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2156. lua_error(state);
  2157. }
  2158. break;
  2159. }
  2160. default:
  2161. {
  2162. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2163. lua_error(state);
  2164. break;
  2165. }
  2166. }
  2167. return 0;
  2168. }
  2169. int lua_Joint_getPreviousSibling(lua_State* state)
  2170. {
  2171. // Get the number of parameters.
  2172. int paramCount = lua_gettop(state);
  2173. // Attempt to match the parameters to a valid binding.
  2174. switch (paramCount)
  2175. {
  2176. case 1:
  2177. {
  2178. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2179. {
  2180. Joint* instance = getInstance(state);
  2181. void* returnPtr = (void*)instance->getPreviousSibling();
  2182. if (returnPtr)
  2183. {
  2184. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2185. object->instance = returnPtr;
  2186. object->owns = false;
  2187. luaL_getmetatable(state, "Node");
  2188. lua_setmetatable(state, -2);
  2189. }
  2190. else
  2191. {
  2192. lua_pushnil(state);
  2193. }
  2194. return 1;
  2195. }
  2196. else
  2197. {
  2198. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2199. lua_error(state);
  2200. }
  2201. break;
  2202. }
  2203. default:
  2204. {
  2205. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2206. lua_error(state);
  2207. break;
  2208. }
  2209. }
  2210. return 0;
  2211. }
  2212. int lua_Joint_getProjectionMatrix(lua_State* state)
  2213. {
  2214. // Get the number of parameters.
  2215. int paramCount = lua_gettop(state);
  2216. // Attempt to match the parameters to a valid binding.
  2217. switch (paramCount)
  2218. {
  2219. case 1:
  2220. {
  2221. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2222. {
  2223. Joint* instance = getInstance(state);
  2224. void* returnPtr = (void*)&(instance->getProjectionMatrix());
  2225. if (returnPtr)
  2226. {
  2227. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2228. object->instance = returnPtr;
  2229. object->owns = false;
  2230. luaL_getmetatable(state, "Matrix");
  2231. lua_setmetatable(state, -2);
  2232. }
  2233. else
  2234. {
  2235. lua_pushnil(state);
  2236. }
  2237. return 1;
  2238. }
  2239. else
  2240. {
  2241. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2242. lua_error(state);
  2243. }
  2244. break;
  2245. }
  2246. default:
  2247. {
  2248. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2249. lua_error(state);
  2250. break;
  2251. }
  2252. }
  2253. return 0;
  2254. }
  2255. int lua_Joint_getRefCount(lua_State* state)
  2256. {
  2257. // Get the number of parameters.
  2258. int paramCount = lua_gettop(state);
  2259. // Attempt to match the parameters to a valid binding.
  2260. switch (paramCount)
  2261. {
  2262. case 1:
  2263. {
  2264. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2265. {
  2266. Joint* instance = getInstance(state);
  2267. unsigned int result = instance->getRefCount();
  2268. // Push the return value onto the stack.
  2269. lua_pushunsigned(state, result);
  2270. return 1;
  2271. }
  2272. else
  2273. {
  2274. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2275. lua_error(state);
  2276. }
  2277. break;
  2278. }
  2279. default:
  2280. {
  2281. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2282. lua_error(state);
  2283. break;
  2284. }
  2285. }
  2286. return 0;
  2287. }
  2288. int lua_Joint_getRightVector(lua_State* state)
  2289. {
  2290. // Get the number of parameters.
  2291. int paramCount = lua_gettop(state);
  2292. // Attempt to match the parameters to a valid binding.
  2293. switch (paramCount)
  2294. {
  2295. case 1:
  2296. {
  2297. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2298. {
  2299. Joint* instance = getInstance(state);
  2300. void* returnPtr = (void*)new Vector3(instance->getRightVector());
  2301. if (returnPtr)
  2302. {
  2303. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2304. object->instance = returnPtr;
  2305. object->owns = true;
  2306. luaL_getmetatable(state, "Vector3");
  2307. lua_setmetatable(state, -2);
  2308. }
  2309. else
  2310. {
  2311. lua_pushnil(state);
  2312. }
  2313. return 1;
  2314. }
  2315. else
  2316. {
  2317. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2318. lua_error(state);
  2319. }
  2320. break;
  2321. }
  2322. case 2:
  2323. {
  2324. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2325. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2326. {
  2327. // Get parameter 1 off the stack.
  2328. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  2329. Joint* instance = getInstance(state);
  2330. instance->getRightVector(param1);
  2331. return 0;
  2332. }
  2333. else
  2334. {
  2335. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2336. lua_error(state);
  2337. }
  2338. break;
  2339. }
  2340. default:
  2341. {
  2342. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2343. lua_error(state);
  2344. break;
  2345. }
  2346. }
  2347. return 0;
  2348. }
  2349. int lua_Joint_getRightVectorWorld(lua_State* state)
  2350. {
  2351. // Get the number of parameters.
  2352. int paramCount = lua_gettop(state);
  2353. // Attempt to match the parameters to a valid binding.
  2354. switch (paramCount)
  2355. {
  2356. case 1:
  2357. {
  2358. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2359. {
  2360. Joint* instance = getInstance(state);
  2361. void* returnPtr = (void*)new Vector3(instance->getRightVectorWorld());
  2362. if (returnPtr)
  2363. {
  2364. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2365. object->instance = returnPtr;
  2366. object->owns = true;
  2367. luaL_getmetatable(state, "Vector3");
  2368. lua_setmetatable(state, -2);
  2369. }
  2370. else
  2371. {
  2372. lua_pushnil(state);
  2373. }
  2374. return 1;
  2375. }
  2376. else
  2377. {
  2378. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2379. lua_error(state);
  2380. }
  2381. break;
  2382. }
  2383. default:
  2384. {
  2385. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2386. lua_error(state);
  2387. break;
  2388. }
  2389. }
  2390. return 0;
  2391. }
  2392. int lua_Joint_getRootNode(lua_State* state)
  2393. {
  2394. // Get the number of parameters.
  2395. int paramCount = lua_gettop(state);
  2396. // Attempt to match the parameters to a valid binding.
  2397. switch (paramCount)
  2398. {
  2399. case 1:
  2400. {
  2401. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2402. {
  2403. Joint* instance = getInstance(state);
  2404. void* returnPtr = (void*)instance->getRootNode();
  2405. if (returnPtr)
  2406. {
  2407. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2408. object->instance = returnPtr;
  2409. object->owns = false;
  2410. luaL_getmetatable(state, "Node");
  2411. lua_setmetatable(state, -2);
  2412. }
  2413. else
  2414. {
  2415. lua_pushnil(state);
  2416. }
  2417. return 1;
  2418. }
  2419. else
  2420. {
  2421. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2422. lua_error(state);
  2423. }
  2424. break;
  2425. }
  2426. default:
  2427. {
  2428. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2429. lua_error(state);
  2430. break;
  2431. }
  2432. }
  2433. return 0;
  2434. }
  2435. int lua_Joint_getRotation(lua_State* state)
  2436. {
  2437. // Get the number of parameters.
  2438. int paramCount = lua_gettop(state);
  2439. // Attempt to match the parameters to a valid binding.
  2440. switch (paramCount)
  2441. {
  2442. case 1:
  2443. {
  2444. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2445. {
  2446. Joint* instance = getInstance(state);
  2447. void* returnPtr = (void*)&(instance->getRotation());
  2448. if (returnPtr)
  2449. {
  2450. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2451. object->instance = returnPtr;
  2452. object->owns = false;
  2453. luaL_getmetatable(state, "Quaternion");
  2454. lua_setmetatable(state, -2);
  2455. }
  2456. else
  2457. {
  2458. lua_pushnil(state);
  2459. }
  2460. return 1;
  2461. }
  2462. else
  2463. {
  2464. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2465. lua_error(state);
  2466. }
  2467. break;
  2468. }
  2469. case 2:
  2470. {
  2471. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2472. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2473. {
  2474. // Get parameter 1 off the stack.
  2475. Quaternion* param1 = ScriptController::getInstance()->getObjectPointer<Quaternion>(2, "Quaternion", false);
  2476. Joint* instance = getInstance(state);
  2477. instance->getRotation(param1);
  2478. return 0;
  2479. }
  2480. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2481. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2482. {
  2483. // Get parameter 1 off the stack.
  2484. Matrix* param1 = ScriptController::getInstance()->getObjectPointer<Matrix>(2, "Matrix", false);
  2485. Joint* instance = getInstance(state);
  2486. instance->getRotation(param1);
  2487. return 0;
  2488. }
  2489. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2490. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2491. {
  2492. // Get parameter 1 off the stack.
  2493. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  2494. Joint* instance = getInstance(state);
  2495. float result = instance->getRotation(param1);
  2496. // Push the return value onto the stack.
  2497. lua_pushnumber(state, result);
  2498. return 1;
  2499. }
  2500. else
  2501. {
  2502. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2503. lua_error(state);
  2504. }
  2505. break;
  2506. }
  2507. default:
  2508. {
  2509. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2510. lua_error(state);
  2511. break;
  2512. }
  2513. }
  2514. return 0;
  2515. }
  2516. int lua_Joint_getScale(lua_State* state)
  2517. {
  2518. // Get the number of parameters.
  2519. int paramCount = lua_gettop(state);
  2520. // Attempt to match the parameters to a valid binding.
  2521. switch (paramCount)
  2522. {
  2523. case 1:
  2524. {
  2525. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2526. {
  2527. Joint* instance = getInstance(state);
  2528. void* returnPtr = (void*)&(instance->getScale());
  2529. if (returnPtr)
  2530. {
  2531. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2532. object->instance = returnPtr;
  2533. object->owns = false;
  2534. luaL_getmetatable(state, "Vector3");
  2535. lua_setmetatable(state, -2);
  2536. }
  2537. else
  2538. {
  2539. lua_pushnil(state);
  2540. }
  2541. return 1;
  2542. }
  2543. else
  2544. {
  2545. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2546. lua_error(state);
  2547. }
  2548. break;
  2549. }
  2550. case 2:
  2551. {
  2552. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2553. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2554. {
  2555. // Get parameter 1 off the stack.
  2556. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  2557. Joint* instance = getInstance(state);
  2558. instance->getScale(param1);
  2559. return 0;
  2560. }
  2561. else
  2562. {
  2563. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2564. lua_error(state);
  2565. }
  2566. break;
  2567. }
  2568. default:
  2569. {
  2570. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2571. lua_error(state);
  2572. break;
  2573. }
  2574. }
  2575. return 0;
  2576. }
  2577. int lua_Joint_getScaleX(lua_State* state)
  2578. {
  2579. // Get the number of parameters.
  2580. int paramCount = lua_gettop(state);
  2581. // Attempt to match the parameters to a valid binding.
  2582. switch (paramCount)
  2583. {
  2584. case 1:
  2585. {
  2586. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2587. {
  2588. Joint* instance = getInstance(state);
  2589. float result = instance->getScaleX();
  2590. // Push the return value onto the stack.
  2591. lua_pushnumber(state, result);
  2592. return 1;
  2593. }
  2594. else
  2595. {
  2596. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2597. lua_error(state);
  2598. }
  2599. break;
  2600. }
  2601. default:
  2602. {
  2603. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2604. lua_error(state);
  2605. break;
  2606. }
  2607. }
  2608. return 0;
  2609. }
  2610. int lua_Joint_getScaleY(lua_State* state)
  2611. {
  2612. // Get the number of parameters.
  2613. int paramCount = lua_gettop(state);
  2614. // Attempt to match the parameters to a valid binding.
  2615. switch (paramCount)
  2616. {
  2617. case 1:
  2618. {
  2619. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2620. {
  2621. Joint* instance = getInstance(state);
  2622. float result = instance->getScaleY();
  2623. // Push the return value onto the stack.
  2624. lua_pushnumber(state, result);
  2625. return 1;
  2626. }
  2627. else
  2628. {
  2629. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2630. lua_error(state);
  2631. }
  2632. break;
  2633. }
  2634. default:
  2635. {
  2636. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2637. lua_error(state);
  2638. break;
  2639. }
  2640. }
  2641. return 0;
  2642. }
  2643. int lua_Joint_getScaleZ(lua_State* state)
  2644. {
  2645. // Get the number of parameters.
  2646. int paramCount = lua_gettop(state);
  2647. // Attempt to match the parameters to a valid binding.
  2648. switch (paramCount)
  2649. {
  2650. case 1:
  2651. {
  2652. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2653. {
  2654. Joint* instance = getInstance(state);
  2655. float result = instance->getScaleZ();
  2656. // Push the return value onto the stack.
  2657. lua_pushnumber(state, result);
  2658. return 1;
  2659. }
  2660. else
  2661. {
  2662. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2663. lua_error(state);
  2664. }
  2665. break;
  2666. }
  2667. default:
  2668. {
  2669. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2670. lua_error(state);
  2671. break;
  2672. }
  2673. }
  2674. return 0;
  2675. }
  2676. int lua_Joint_getScene(lua_State* state)
  2677. {
  2678. // Get the number of parameters.
  2679. int paramCount = lua_gettop(state);
  2680. // Attempt to match the parameters to a valid binding.
  2681. switch (paramCount)
  2682. {
  2683. case 1:
  2684. {
  2685. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2686. {
  2687. Joint* instance = getInstance(state);
  2688. void* returnPtr = (void*)instance->getScene();
  2689. if (returnPtr)
  2690. {
  2691. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2692. object->instance = returnPtr;
  2693. object->owns = false;
  2694. luaL_getmetatable(state, "Scene");
  2695. lua_setmetatable(state, -2);
  2696. }
  2697. else
  2698. {
  2699. lua_pushnil(state);
  2700. }
  2701. return 1;
  2702. }
  2703. else
  2704. {
  2705. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2706. lua_error(state);
  2707. }
  2708. break;
  2709. }
  2710. default:
  2711. {
  2712. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2713. lua_error(state);
  2714. break;
  2715. }
  2716. }
  2717. return 0;
  2718. }
  2719. int lua_Joint_getTranslation(lua_State* state)
  2720. {
  2721. // Get the number of parameters.
  2722. int paramCount = lua_gettop(state);
  2723. // Attempt to match the parameters to a valid binding.
  2724. switch (paramCount)
  2725. {
  2726. case 1:
  2727. {
  2728. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2729. {
  2730. Joint* instance = getInstance(state);
  2731. void* returnPtr = (void*)&(instance->getTranslation());
  2732. if (returnPtr)
  2733. {
  2734. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2735. object->instance = returnPtr;
  2736. object->owns = false;
  2737. luaL_getmetatable(state, "Vector3");
  2738. lua_setmetatable(state, -2);
  2739. }
  2740. else
  2741. {
  2742. lua_pushnil(state);
  2743. }
  2744. return 1;
  2745. }
  2746. else
  2747. {
  2748. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2749. lua_error(state);
  2750. }
  2751. break;
  2752. }
  2753. case 2:
  2754. {
  2755. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  2756. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2757. {
  2758. // Get parameter 1 off the stack.
  2759. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  2760. Joint* instance = getInstance(state);
  2761. instance->getTranslation(param1);
  2762. return 0;
  2763. }
  2764. else
  2765. {
  2766. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2767. lua_error(state);
  2768. }
  2769. break;
  2770. }
  2771. default:
  2772. {
  2773. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2774. lua_error(state);
  2775. break;
  2776. }
  2777. }
  2778. return 0;
  2779. }
  2780. int lua_Joint_getTranslationView(lua_State* state)
  2781. {
  2782. // Get the number of parameters.
  2783. int paramCount = lua_gettop(state);
  2784. // Attempt to match the parameters to a valid binding.
  2785. switch (paramCount)
  2786. {
  2787. case 1:
  2788. {
  2789. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2790. {
  2791. Joint* instance = getInstance(state);
  2792. void* returnPtr = (void*)new Vector3(instance->getTranslationView());
  2793. if (returnPtr)
  2794. {
  2795. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2796. object->instance = returnPtr;
  2797. object->owns = true;
  2798. luaL_getmetatable(state, "Vector3");
  2799. lua_setmetatable(state, -2);
  2800. }
  2801. else
  2802. {
  2803. lua_pushnil(state);
  2804. }
  2805. return 1;
  2806. }
  2807. else
  2808. {
  2809. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2810. lua_error(state);
  2811. }
  2812. break;
  2813. }
  2814. default:
  2815. {
  2816. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2817. lua_error(state);
  2818. break;
  2819. }
  2820. }
  2821. return 0;
  2822. }
  2823. int lua_Joint_getTranslationWorld(lua_State* state)
  2824. {
  2825. // Get the number of parameters.
  2826. int paramCount = lua_gettop(state);
  2827. // Attempt to match the parameters to a valid binding.
  2828. switch (paramCount)
  2829. {
  2830. case 1:
  2831. {
  2832. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2833. {
  2834. Joint* instance = getInstance(state);
  2835. void* returnPtr = (void*)new Vector3(instance->getTranslationWorld());
  2836. if (returnPtr)
  2837. {
  2838. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  2839. object->instance = returnPtr;
  2840. object->owns = true;
  2841. luaL_getmetatable(state, "Vector3");
  2842. lua_setmetatable(state, -2);
  2843. }
  2844. else
  2845. {
  2846. lua_pushnil(state);
  2847. }
  2848. return 1;
  2849. }
  2850. else
  2851. {
  2852. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2853. lua_error(state);
  2854. }
  2855. break;
  2856. }
  2857. default:
  2858. {
  2859. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2860. lua_error(state);
  2861. break;
  2862. }
  2863. }
  2864. return 0;
  2865. }
  2866. int lua_Joint_getTranslationX(lua_State* state)
  2867. {
  2868. // Get the number of parameters.
  2869. int paramCount = lua_gettop(state);
  2870. // Attempt to match the parameters to a valid binding.
  2871. switch (paramCount)
  2872. {
  2873. case 1:
  2874. {
  2875. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2876. {
  2877. Joint* instance = getInstance(state);
  2878. float result = instance->getTranslationX();
  2879. // Push the return value onto the stack.
  2880. lua_pushnumber(state, result);
  2881. return 1;
  2882. }
  2883. else
  2884. {
  2885. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2886. lua_error(state);
  2887. }
  2888. break;
  2889. }
  2890. default:
  2891. {
  2892. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2893. lua_error(state);
  2894. break;
  2895. }
  2896. }
  2897. return 0;
  2898. }
  2899. int lua_Joint_getTranslationY(lua_State* state)
  2900. {
  2901. // Get the number of parameters.
  2902. int paramCount = lua_gettop(state);
  2903. // Attempt to match the parameters to a valid binding.
  2904. switch (paramCount)
  2905. {
  2906. case 1:
  2907. {
  2908. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2909. {
  2910. Joint* instance = getInstance(state);
  2911. float result = instance->getTranslationY();
  2912. // Push the return value onto the stack.
  2913. lua_pushnumber(state, result);
  2914. return 1;
  2915. }
  2916. else
  2917. {
  2918. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2919. lua_error(state);
  2920. }
  2921. break;
  2922. }
  2923. default:
  2924. {
  2925. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2926. lua_error(state);
  2927. break;
  2928. }
  2929. }
  2930. return 0;
  2931. }
  2932. int lua_Joint_getTranslationZ(lua_State* state)
  2933. {
  2934. // Get the number of parameters.
  2935. int paramCount = lua_gettop(state);
  2936. // Attempt to match the parameters to a valid binding.
  2937. switch (paramCount)
  2938. {
  2939. case 1:
  2940. {
  2941. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2942. {
  2943. Joint* instance = getInstance(state);
  2944. float result = instance->getTranslationZ();
  2945. // Push the return value onto the stack.
  2946. lua_pushnumber(state, result);
  2947. return 1;
  2948. }
  2949. else
  2950. {
  2951. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2952. lua_error(state);
  2953. }
  2954. break;
  2955. }
  2956. default:
  2957. {
  2958. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2959. lua_error(state);
  2960. break;
  2961. }
  2962. }
  2963. return 0;
  2964. }
  2965. int lua_Joint_getType(lua_State* state)
  2966. {
  2967. // Get the number of parameters.
  2968. int paramCount = lua_gettop(state);
  2969. // Attempt to match the parameters to a valid binding.
  2970. switch (paramCount)
  2971. {
  2972. case 1:
  2973. {
  2974. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  2975. {
  2976. Joint* instance = getInstance(state);
  2977. Node::Type result = instance->getType();
  2978. // Push the return value onto the stack.
  2979. lua_pushstring(state, lua_stringFromEnum_NodeType(result));
  2980. return 1;
  2981. }
  2982. else
  2983. {
  2984. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  2985. lua_error(state);
  2986. }
  2987. break;
  2988. }
  2989. default:
  2990. {
  2991. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2992. lua_error(state);
  2993. break;
  2994. }
  2995. }
  2996. return 0;
  2997. }
  2998. int lua_Joint_getUpVector(lua_State* state)
  2999. {
  3000. // Get the number of parameters.
  3001. int paramCount = lua_gettop(state);
  3002. // Attempt to match the parameters to a valid binding.
  3003. switch (paramCount)
  3004. {
  3005. case 1:
  3006. {
  3007. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3008. {
  3009. Joint* instance = getInstance(state);
  3010. void* returnPtr = (void*)new Vector3(instance->getUpVector());
  3011. if (returnPtr)
  3012. {
  3013. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3014. object->instance = returnPtr;
  3015. object->owns = true;
  3016. luaL_getmetatable(state, "Vector3");
  3017. lua_setmetatable(state, -2);
  3018. }
  3019. else
  3020. {
  3021. lua_pushnil(state);
  3022. }
  3023. return 1;
  3024. }
  3025. else
  3026. {
  3027. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3028. lua_error(state);
  3029. }
  3030. break;
  3031. }
  3032. case 2:
  3033. {
  3034. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3035. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3036. {
  3037. // Get parameter 1 off the stack.
  3038. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  3039. Joint* instance = getInstance(state);
  3040. instance->getUpVector(param1);
  3041. return 0;
  3042. }
  3043. else
  3044. {
  3045. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3046. lua_error(state);
  3047. }
  3048. break;
  3049. }
  3050. default:
  3051. {
  3052. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  3053. lua_error(state);
  3054. break;
  3055. }
  3056. }
  3057. return 0;
  3058. }
  3059. int lua_Joint_getUpVectorWorld(lua_State* state)
  3060. {
  3061. // Get the number of parameters.
  3062. int paramCount = lua_gettop(state);
  3063. // Attempt to match the parameters to a valid binding.
  3064. switch (paramCount)
  3065. {
  3066. case 1:
  3067. {
  3068. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3069. {
  3070. Joint* instance = getInstance(state);
  3071. void* returnPtr = (void*)new Vector3(instance->getUpVectorWorld());
  3072. if (returnPtr)
  3073. {
  3074. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3075. object->instance = returnPtr;
  3076. object->owns = true;
  3077. luaL_getmetatable(state, "Vector3");
  3078. lua_setmetatable(state, -2);
  3079. }
  3080. else
  3081. {
  3082. lua_pushnil(state);
  3083. }
  3084. return 1;
  3085. }
  3086. else
  3087. {
  3088. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3089. lua_error(state);
  3090. }
  3091. break;
  3092. }
  3093. default:
  3094. {
  3095. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3096. lua_error(state);
  3097. break;
  3098. }
  3099. }
  3100. return 0;
  3101. }
  3102. int lua_Joint_getViewMatrix(lua_State* state)
  3103. {
  3104. // Get the number of parameters.
  3105. int paramCount = lua_gettop(state);
  3106. // Attempt to match the parameters to a valid binding.
  3107. switch (paramCount)
  3108. {
  3109. case 1:
  3110. {
  3111. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3112. {
  3113. Joint* instance = getInstance(state);
  3114. void* returnPtr = (void*)&(instance->getViewMatrix());
  3115. if (returnPtr)
  3116. {
  3117. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3118. object->instance = returnPtr;
  3119. object->owns = false;
  3120. luaL_getmetatable(state, "Matrix");
  3121. lua_setmetatable(state, -2);
  3122. }
  3123. else
  3124. {
  3125. lua_pushnil(state);
  3126. }
  3127. return 1;
  3128. }
  3129. else
  3130. {
  3131. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3132. lua_error(state);
  3133. }
  3134. break;
  3135. }
  3136. default:
  3137. {
  3138. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3139. lua_error(state);
  3140. break;
  3141. }
  3142. }
  3143. return 0;
  3144. }
  3145. int lua_Joint_getViewProjectionMatrix(lua_State* state)
  3146. {
  3147. // Get the number of parameters.
  3148. int paramCount = lua_gettop(state);
  3149. // Attempt to match the parameters to a valid binding.
  3150. switch (paramCount)
  3151. {
  3152. case 1:
  3153. {
  3154. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3155. {
  3156. Joint* instance = getInstance(state);
  3157. void* returnPtr = (void*)&(instance->getViewProjectionMatrix());
  3158. if (returnPtr)
  3159. {
  3160. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3161. object->instance = returnPtr;
  3162. object->owns = false;
  3163. luaL_getmetatable(state, "Matrix");
  3164. lua_setmetatable(state, -2);
  3165. }
  3166. else
  3167. {
  3168. lua_pushnil(state);
  3169. }
  3170. return 1;
  3171. }
  3172. else
  3173. {
  3174. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3175. lua_error(state);
  3176. }
  3177. break;
  3178. }
  3179. default:
  3180. {
  3181. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3182. lua_error(state);
  3183. break;
  3184. }
  3185. }
  3186. return 0;
  3187. }
  3188. int lua_Joint_getWorldMatrix(lua_State* state)
  3189. {
  3190. // Get the number of parameters.
  3191. int paramCount = lua_gettop(state);
  3192. // Attempt to match the parameters to a valid binding.
  3193. switch (paramCount)
  3194. {
  3195. case 1:
  3196. {
  3197. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3198. {
  3199. Joint* instance = getInstance(state);
  3200. void* returnPtr = (void*)&(instance->getWorldMatrix());
  3201. if (returnPtr)
  3202. {
  3203. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3204. object->instance = returnPtr;
  3205. object->owns = false;
  3206. luaL_getmetatable(state, "Matrix");
  3207. lua_setmetatable(state, -2);
  3208. }
  3209. else
  3210. {
  3211. lua_pushnil(state);
  3212. }
  3213. return 1;
  3214. }
  3215. else
  3216. {
  3217. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3218. lua_error(state);
  3219. }
  3220. break;
  3221. }
  3222. default:
  3223. {
  3224. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3225. lua_error(state);
  3226. break;
  3227. }
  3228. }
  3229. return 0;
  3230. }
  3231. int lua_Joint_getWorldViewMatrix(lua_State* state)
  3232. {
  3233. // Get the number of parameters.
  3234. int paramCount = lua_gettop(state);
  3235. // Attempt to match the parameters to a valid binding.
  3236. switch (paramCount)
  3237. {
  3238. case 1:
  3239. {
  3240. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3241. {
  3242. Joint* instance = getInstance(state);
  3243. void* returnPtr = (void*)&(instance->getWorldViewMatrix());
  3244. if (returnPtr)
  3245. {
  3246. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3247. object->instance = returnPtr;
  3248. object->owns = false;
  3249. luaL_getmetatable(state, "Matrix");
  3250. lua_setmetatable(state, -2);
  3251. }
  3252. else
  3253. {
  3254. lua_pushnil(state);
  3255. }
  3256. return 1;
  3257. }
  3258. else
  3259. {
  3260. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3261. lua_error(state);
  3262. }
  3263. break;
  3264. }
  3265. default:
  3266. {
  3267. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3268. lua_error(state);
  3269. break;
  3270. }
  3271. }
  3272. return 0;
  3273. }
  3274. int lua_Joint_getWorldViewProjectionMatrix(lua_State* state)
  3275. {
  3276. // Get the number of parameters.
  3277. int paramCount = lua_gettop(state);
  3278. // Attempt to match the parameters to a valid binding.
  3279. switch (paramCount)
  3280. {
  3281. case 1:
  3282. {
  3283. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3284. {
  3285. Joint* instance = getInstance(state);
  3286. void* returnPtr = (void*)&(instance->getWorldViewProjectionMatrix());
  3287. if (returnPtr)
  3288. {
  3289. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  3290. object->instance = returnPtr;
  3291. object->owns = false;
  3292. luaL_getmetatable(state, "Matrix");
  3293. lua_setmetatable(state, -2);
  3294. }
  3295. else
  3296. {
  3297. lua_pushnil(state);
  3298. }
  3299. return 1;
  3300. }
  3301. else
  3302. {
  3303. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3304. lua_error(state);
  3305. }
  3306. break;
  3307. }
  3308. default:
  3309. {
  3310. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3311. lua_error(state);
  3312. break;
  3313. }
  3314. }
  3315. return 0;
  3316. }
  3317. int lua_Joint_isDynamic(lua_State* state)
  3318. {
  3319. // Get the number of parameters.
  3320. int paramCount = lua_gettop(state);
  3321. // Attempt to match the parameters to a valid binding.
  3322. switch (paramCount)
  3323. {
  3324. case 1:
  3325. {
  3326. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3327. {
  3328. Joint* instance = getInstance(state);
  3329. bool result = instance->isDynamic();
  3330. // Push the return value onto the stack.
  3331. lua_pushboolean(state, result);
  3332. return 1;
  3333. }
  3334. else
  3335. {
  3336. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3337. lua_error(state);
  3338. }
  3339. break;
  3340. }
  3341. default:
  3342. {
  3343. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3344. lua_error(state);
  3345. break;
  3346. }
  3347. }
  3348. return 0;
  3349. }
  3350. int lua_Joint_isTransparent(lua_State* state)
  3351. {
  3352. // Get the number of parameters.
  3353. int paramCount = lua_gettop(state);
  3354. // Attempt to match the parameters to a valid binding.
  3355. switch (paramCount)
  3356. {
  3357. case 1:
  3358. {
  3359. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3360. {
  3361. Joint* instance = getInstance(state);
  3362. bool result = instance->isTransparent();
  3363. // Push the return value onto the stack.
  3364. lua_pushboolean(state, result);
  3365. return 1;
  3366. }
  3367. else
  3368. {
  3369. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3370. lua_error(state);
  3371. }
  3372. break;
  3373. }
  3374. default:
  3375. {
  3376. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3377. lua_error(state);
  3378. break;
  3379. }
  3380. }
  3381. return 0;
  3382. }
  3383. int lua_Joint_isVisible(lua_State* state)
  3384. {
  3385. // Get the number of parameters.
  3386. int paramCount = lua_gettop(state);
  3387. // Attempt to match the parameters to a valid binding.
  3388. switch (paramCount)
  3389. {
  3390. case 1:
  3391. {
  3392. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3393. {
  3394. Joint* instance = getInstance(state);
  3395. bool result = instance->isVisible();
  3396. // Push the return value onto the stack.
  3397. lua_pushboolean(state, result);
  3398. return 1;
  3399. }
  3400. else
  3401. {
  3402. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3403. lua_error(state);
  3404. }
  3405. break;
  3406. }
  3407. default:
  3408. {
  3409. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3410. lua_error(state);
  3411. break;
  3412. }
  3413. }
  3414. return 0;
  3415. }
  3416. int lua_Joint_release(lua_State* state)
  3417. {
  3418. // Get the number of parameters.
  3419. int paramCount = lua_gettop(state);
  3420. // Attempt to match the parameters to a valid binding.
  3421. switch (paramCount)
  3422. {
  3423. case 1:
  3424. {
  3425. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3426. {
  3427. Joint* instance = getInstance(state);
  3428. instance->release();
  3429. return 0;
  3430. }
  3431. else
  3432. {
  3433. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3434. lua_error(state);
  3435. }
  3436. break;
  3437. }
  3438. default:
  3439. {
  3440. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3441. lua_error(state);
  3442. break;
  3443. }
  3444. }
  3445. return 0;
  3446. }
  3447. int lua_Joint_removeAllChildren(lua_State* state)
  3448. {
  3449. // Get the number of parameters.
  3450. int paramCount = lua_gettop(state);
  3451. // Attempt to match the parameters to a valid binding.
  3452. switch (paramCount)
  3453. {
  3454. case 1:
  3455. {
  3456. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  3457. {
  3458. Joint* instance = getInstance(state);
  3459. instance->removeAllChildren();
  3460. return 0;
  3461. }
  3462. else
  3463. {
  3464. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3465. lua_error(state);
  3466. }
  3467. break;
  3468. }
  3469. default:
  3470. {
  3471. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  3472. lua_error(state);
  3473. break;
  3474. }
  3475. }
  3476. return 0;
  3477. }
  3478. int lua_Joint_removeChild(lua_State* state)
  3479. {
  3480. // Get the number of parameters.
  3481. int paramCount = lua_gettop(state);
  3482. // Attempt to match the parameters to a valid binding.
  3483. switch (paramCount)
  3484. {
  3485. case 2:
  3486. {
  3487. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3488. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3489. {
  3490. // Get parameter 1 off the stack.
  3491. Node* param1 = ScriptController::getInstance()->getObjectPointer<Node>(2, "Node", false);
  3492. Joint* instance = getInstance(state);
  3493. instance->removeChild(param1);
  3494. return 0;
  3495. }
  3496. else
  3497. {
  3498. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3499. lua_error(state);
  3500. }
  3501. break;
  3502. }
  3503. default:
  3504. {
  3505. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3506. lua_error(state);
  3507. break;
  3508. }
  3509. }
  3510. return 0;
  3511. }
  3512. int lua_Joint_removeListener(lua_State* state)
  3513. {
  3514. // Get the number of parameters.
  3515. int paramCount = lua_gettop(state);
  3516. // Attempt to match the parameters to a valid binding.
  3517. switch (paramCount)
  3518. {
  3519. case 2:
  3520. {
  3521. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3522. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3523. {
  3524. // Get parameter 1 off the stack.
  3525. Transform::Listener* param1 = ScriptController::getInstance()->getObjectPointer<Transform::Listener>(2, "TransformListener", false);
  3526. Joint* instance = getInstance(state);
  3527. instance->removeListener(param1);
  3528. return 0;
  3529. }
  3530. else
  3531. {
  3532. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3533. lua_error(state);
  3534. }
  3535. break;
  3536. }
  3537. default:
  3538. {
  3539. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3540. lua_error(state);
  3541. break;
  3542. }
  3543. }
  3544. return 0;
  3545. }
  3546. int lua_Joint_rotate(lua_State* state)
  3547. {
  3548. // Get the number of parameters.
  3549. int paramCount = lua_gettop(state);
  3550. // Attempt to match the parameters to a valid binding.
  3551. switch (paramCount)
  3552. {
  3553. case 2:
  3554. {
  3555. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3556. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3557. {
  3558. // Get parameter 1 off the stack.
  3559. Quaternion* param1 = ScriptController::getInstance()->getObjectPointer<Quaternion>(2, "Quaternion", true);
  3560. Joint* instance = getInstance(state);
  3561. instance->rotate(*param1);
  3562. return 0;
  3563. }
  3564. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3565. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3566. {
  3567. // Get parameter 1 off the stack.
  3568. Matrix* param1 = ScriptController::getInstance()->getObjectPointer<Matrix>(2, "Matrix", true);
  3569. Joint* instance = getInstance(state);
  3570. instance->rotate(*param1);
  3571. return 0;
  3572. }
  3573. else
  3574. {
  3575. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3576. lua_error(state);
  3577. }
  3578. break;
  3579. }
  3580. case 3:
  3581. {
  3582. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3583. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3584. lua_type(state, 3) == LUA_TNUMBER)
  3585. {
  3586. // Get parameter 1 off the stack.
  3587. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  3588. // Get parameter 2 off the stack.
  3589. float param2 = (float)luaL_checknumber(state, 3);
  3590. Joint* instance = getInstance(state);
  3591. instance->rotate(*param1, param2);
  3592. return 0;
  3593. }
  3594. else
  3595. {
  3596. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3597. lua_error(state);
  3598. }
  3599. break;
  3600. }
  3601. case 5:
  3602. {
  3603. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3604. lua_type(state, 2) == LUA_TNUMBER &&
  3605. lua_type(state, 3) == LUA_TNUMBER &&
  3606. lua_type(state, 4) == LUA_TNUMBER &&
  3607. lua_type(state, 5) == LUA_TNUMBER)
  3608. {
  3609. // Get parameter 1 off the stack.
  3610. float param1 = (float)luaL_checknumber(state, 2);
  3611. // Get parameter 2 off the stack.
  3612. float param2 = (float)luaL_checknumber(state, 3);
  3613. // Get parameter 3 off the stack.
  3614. float param3 = (float)luaL_checknumber(state, 4);
  3615. // Get parameter 4 off the stack.
  3616. float param4 = (float)luaL_checknumber(state, 5);
  3617. Joint* instance = getInstance(state);
  3618. instance->rotate(param1, param2, param3, param4);
  3619. return 0;
  3620. }
  3621. else
  3622. {
  3623. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3624. lua_error(state);
  3625. }
  3626. break;
  3627. }
  3628. default:
  3629. {
  3630. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 5).");
  3631. lua_error(state);
  3632. break;
  3633. }
  3634. }
  3635. return 0;
  3636. }
  3637. int lua_Joint_rotateX(lua_State* state)
  3638. {
  3639. // Get the number of parameters.
  3640. int paramCount = lua_gettop(state);
  3641. // Attempt to match the parameters to a valid binding.
  3642. switch (paramCount)
  3643. {
  3644. case 2:
  3645. {
  3646. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3647. lua_type(state, 2) == LUA_TNUMBER)
  3648. {
  3649. // Get parameter 1 off the stack.
  3650. float param1 = (float)luaL_checknumber(state, 2);
  3651. Joint* instance = getInstance(state);
  3652. instance->rotateX(param1);
  3653. return 0;
  3654. }
  3655. else
  3656. {
  3657. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3658. lua_error(state);
  3659. }
  3660. break;
  3661. }
  3662. default:
  3663. {
  3664. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3665. lua_error(state);
  3666. break;
  3667. }
  3668. }
  3669. return 0;
  3670. }
  3671. int lua_Joint_rotateY(lua_State* state)
  3672. {
  3673. // Get the number of parameters.
  3674. int paramCount = lua_gettop(state);
  3675. // Attempt to match the parameters to a valid binding.
  3676. switch (paramCount)
  3677. {
  3678. case 2:
  3679. {
  3680. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3681. lua_type(state, 2) == LUA_TNUMBER)
  3682. {
  3683. // Get parameter 1 off the stack.
  3684. float param1 = (float)luaL_checknumber(state, 2);
  3685. Joint* instance = getInstance(state);
  3686. instance->rotateY(param1);
  3687. return 0;
  3688. }
  3689. else
  3690. {
  3691. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3692. lua_error(state);
  3693. }
  3694. break;
  3695. }
  3696. default:
  3697. {
  3698. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3699. lua_error(state);
  3700. break;
  3701. }
  3702. }
  3703. return 0;
  3704. }
  3705. int lua_Joint_rotateZ(lua_State* state)
  3706. {
  3707. // Get the number of parameters.
  3708. int paramCount = lua_gettop(state);
  3709. // Attempt to match the parameters to a valid binding.
  3710. switch (paramCount)
  3711. {
  3712. case 2:
  3713. {
  3714. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3715. lua_type(state, 2) == LUA_TNUMBER)
  3716. {
  3717. // Get parameter 1 off the stack.
  3718. float param1 = (float)luaL_checknumber(state, 2);
  3719. Joint* instance = getInstance(state);
  3720. instance->rotateZ(param1);
  3721. return 0;
  3722. }
  3723. else
  3724. {
  3725. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3726. lua_error(state);
  3727. }
  3728. break;
  3729. }
  3730. default:
  3731. {
  3732. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3733. lua_error(state);
  3734. break;
  3735. }
  3736. }
  3737. return 0;
  3738. }
  3739. int lua_Joint_scale(lua_State* state)
  3740. {
  3741. // Get the number of parameters.
  3742. int paramCount = lua_gettop(state);
  3743. // Attempt to match the parameters to a valid binding.
  3744. switch (paramCount)
  3745. {
  3746. case 2:
  3747. {
  3748. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3749. lua_type(state, 2) == LUA_TNUMBER)
  3750. {
  3751. // Get parameter 1 off the stack.
  3752. float param1 = (float)luaL_checknumber(state, 2);
  3753. Joint* instance = getInstance(state);
  3754. instance->scale(param1);
  3755. return 0;
  3756. }
  3757. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3758. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3759. {
  3760. // Get parameter 1 off the stack.
  3761. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  3762. Joint* instance = getInstance(state);
  3763. instance->scale(*param1);
  3764. return 0;
  3765. }
  3766. else
  3767. {
  3768. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3769. lua_error(state);
  3770. }
  3771. break;
  3772. }
  3773. case 4:
  3774. {
  3775. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3776. lua_type(state, 2) == LUA_TNUMBER &&
  3777. lua_type(state, 3) == LUA_TNUMBER &&
  3778. lua_type(state, 4) == LUA_TNUMBER)
  3779. {
  3780. // Get parameter 1 off the stack.
  3781. float param1 = (float)luaL_checknumber(state, 2);
  3782. // Get parameter 2 off the stack.
  3783. float param2 = (float)luaL_checknumber(state, 3);
  3784. // Get parameter 3 off the stack.
  3785. float param3 = (float)luaL_checknumber(state, 4);
  3786. Joint* instance = getInstance(state);
  3787. instance->scale(param1, param2, param3);
  3788. return 0;
  3789. }
  3790. else
  3791. {
  3792. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3793. lua_error(state);
  3794. }
  3795. break;
  3796. }
  3797. default:
  3798. {
  3799. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  3800. lua_error(state);
  3801. break;
  3802. }
  3803. }
  3804. return 0;
  3805. }
  3806. int lua_Joint_scaleX(lua_State* state)
  3807. {
  3808. // Get the number of parameters.
  3809. int paramCount = lua_gettop(state);
  3810. // Attempt to match the parameters to a valid binding.
  3811. switch (paramCount)
  3812. {
  3813. case 2:
  3814. {
  3815. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3816. lua_type(state, 2) == LUA_TNUMBER)
  3817. {
  3818. // Get parameter 1 off the stack.
  3819. float param1 = (float)luaL_checknumber(state, 2);
  3820. Joint* instance = getInstance(state);
  3821. instance->scaleX(param1);
  3822. return 0;
  3823. }
  3824. else
  3825. {
  3826. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3827. lua_error(state);
  3828. }
  3829. break;
  3830. }
  3831. default:
  3832. {
  3833. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3834. lua_error(state);
  3835. break;
  3836. }
  3837. }
  3838. return 0;
  3839. }
  3840. int lua_Joint_scaleY(lua_State* state)
  3841. {
  3842. // Get the number of parameters.
  3843. int paramCount = lua_gettop(state);
  3844. // Attempt to match the parameters to a valid binding.
  3845. switch (paramCount)
  3846. {
  3847. case 2:
  3848. {
  3849. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3850. lua_type(state, 2) == LUA_TNUMBER)
  3851. {
  3852. // Get parameter 1 off the stack.
  3853. float param1 = (float)luaL_checknumber(state, 2);
  3854. Joint* instance = getInstance(state);
  3855. instance->scaleY(param1);
  3856. return 0;
  3857. }
  3858. else
  3859. {
  3860. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3861. lua_error(state);
  3862. }
  3863. break;
  3864. }
  3865. default:
  3866. {
  3867. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3868. lua_error(state);
  3869. break;
  3870. }
  3871. }
  3872. return 0;
  3873. }
  3874. int lua_Joint_scaleZ(lua_State* state)
  3875. {
  3876. // Get the number of parameters.
  3877. int paramCount = lua_gettop(state);
  3878. // Attempt to match the parameters to a valid binding.
  3879. switch (paramCount)
  3880. {
  3881. case 2:
  3882. {
  3883. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3884. lua_type(state, 2) == LUA_TNUMBER)
  3885. {
  3886. // Get parameter 1 off the stack.
  3887. float param1 = (float)luaL_checknumber(state, 2);
  3888. Joint* instance = getInstance(state);
  3889. instance->scaleZ(param1);
  3890. return 0;
  3891. }
  3892. else
  3893. {
  3894. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3895. lua_error(state);
  3896. }
  3897. break;
  3898. }
  3899. default:
  3900. {
  3901. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3902. lua_error(state);
  3903. break;
  3904. }
  3905. }
  3906. return 0;
  3907. }
  3908. int lua_Joint_set(lua_State* state)
  3909. {
  3910. // Get the number of parameters.
  3911. int paramCount = lua_gettop(state);
  3912. // Attempt to match the parameters to a valid binding.
  3913. switch (paramCount)
  3914. {
  3915. case 2:
  3916. {
  3917. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3918. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3919. {
  3920. // Get parameter 1 off the stack.
  3921. Transform* param1 = ScriptController::getInstance()->getObjectPointer<Transform>(2, "Transform", true);
  3922. Joint* instance = getInstance(state);
  3923. instance->set(*param1);
  3924. return 0;
  3925. }
  3926. else
  3927. {
  3928. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3929. lua_error(state);
  3930. }
  3931. break;
  3932. }
  3933. case 4:
  3934. {
  3935. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3936. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3937. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  3938. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL))
  3939. {
  3940. // Get parameter 1 off the stack.
  3941. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  3942. // Get parameter 2 off the stack.
  3943. Quaternion* param2 = ScriptController::getInstance()->getObjectPointer<Quaternion>(3, "Quaternion", true);
  3944. // Get parameter 3 off the stack.
  3945. Vector3* param3 = ScriptController::getInstance()->getObjectPointer<Vector3>(4, "Vector3", true);
  3946. Joint* instance = getInstance(state);
  3947. instance->set(*param1, *param2, *param3);
  3948. return 0;
  3949. }
  3950. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3951. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3952. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  3953. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL))
  3954. {
  3955. // Get parameter 1 off the stack.
  3956. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  3957. // Get parameter 2 off the stack.
  3958. Matrix* param2 = ScriptController::getInstance()->getObjectPointer<Matrix>(3, "Matrix", true);
  3959. // Get parameter 3 off the stack.
  3960. Vector3* param3 = ScriptController::getInstance()->getObjectPointer<Vector3>(4, "Vector3", true);
  3961. Joint* instance = getInstance(state);
  3962. instance->set(*param1, *param2, *param3);
  3963. return 0;
  3964. }
  3965. else
  3966. {
  3967. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3968. lua_error(state);
  3969. }
  3970. break;
  3971. }
  3972. case 5:
  3973. {
  3974. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  3975. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3976. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  3977. lua_type(state, 4) == LUA_TNUMBER &&
  3978. (lua_type(state, 5) == LUA_TUSERDATA || lua_type(state, 5) == LUA_TNIL))
  3979. {
  3980. // Get parameter 1 off the stack.
  3981. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  3982. // Get parameter 2 off the stack.
  3983. Vector3* param2 = ScriptController::getInstance()->getObjectPointer<Vector3>(3, "Vector3", true);
  3984. // Get parameter 3 off the stack.
  3985. float param3 = (float)luaL_checknumber(state, 4);
  3986. // Get parameter 4 off the stack.
  3987. Vector3* param4 = ScriptController::getInstance()->getObjectPointer<Vector3>(5, "Vector3", true);
  3988. Joint* instance = getInstance(state);
  3989. instance->set(*param1, *param2, param3, *param4);
  3990. return 0;
  3991. }
  3992. else
  3993. {
  3994. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  3995. lua_error(state);
  3996. }
  3997. break;
  3998. }
  3999. default:
  4000. {
  4001. lua_pushstring(state, "Invalid number of parameters (expected 2, 4 or 5).");
  4002. lua_error(state);
  4003. break;
  4004. }
  4005. }
  4006. return 0;
  4007. }
  4008. int lua_Joint_setAnimationPropertyValue(lua_State* state)
  4009. {
  4010. // Get the number of parameters.
  4011. int paramCount = lua_gettop(state);
  4012. // Attempt to match the parameters to a valid binding.
  4013. switch (paramCount)
  4014. {
  4015. case 3:
  4016. {
  4017. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4018. lua_type(state, 2) == LUA_TNUMBER &&
  4019. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  4020. {
  4021. // Get parameter 1 off the stack.
  4022. int param1 = (int)luaL_checkint(state, 2);
  4023. // Get parameter 2 off the stack.
  4024. AnimationValue* param2 = ScriptController::getInstance()->getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  4025. Joint* instance = getInstance(state);
  4026. instance->setAnimationPropertyValue(param1, param2);
  4027. return 0;
  4028. }
  4029. else
  4030. {
  4031. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4032. lua_error(state);
  4033. }
  4034. break;
  4035. }
  4036. case 4:
  4037. {
  4038. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4039. lua_type(state, 2) == LUA_TNUMBER &&
  4040. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  4041. lua_type(state, 4) == LUA_TNUMBER)
  4042. {
  4043. // Get parameter 1 off the stack.
  4044. int param1 = (int)luaL_checkint(state, 2);
  4045. // Get parameter 2 off the stack.
  4046. AnimationValue* param2 = ScriptController::getInstance()->getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  4047. // Get parameter 3 off the stack.
  4048. float param3 = (float)luaL_checknumber(state, 4);
  4049. Joint* instance = getInstance(state);
  4050. instance->setAnimationPropertyValue(param1, param2, param3);
  4051. return 0;
  4052. }
  4053. else
  4054. {
  4055. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4056. lua_error(state);
  4057. }
  4058. break;
  4059. }
  4060. default:
  4061. {
  4062. lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
  4063. lua_error(state);
  4064. break;
  4065. }
  4066. }
  4067. return 0;
  4068. }
  4069. int lua_Joint_setAudioSource(lua_State* state)
  4070. {
  4071. // Get the number of parameters.
  4072. int paramCount = lua_gettop(state);
  4073. // Attempt to match the parameters to a valid binding.
  4074. switch (paramCount)
  4075. {
  4076. case 2:
  4077. {
  4078. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4079. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4080. {
  4081. // Get parameter 1 off the stack.
  4082. AudioSource* param1 = ScriptController::getInstance()->getObjectPointer<AudioSource>(2, "AudioSource", false);
  4083. Joint* instance = getInstance(state);
  4084. instance->setAudioSource(param1);
  4085. return 0;
  4086. }
  4087. else
  4088. {
  4089. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4090. lua_error(state);
  4091. }
  4092. break;
  4093. }
  4094. default:
  4095. {
  4096. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4097. lua_error(state);
  4098. break;
  4099. }
  4100. }
  4101. return 0;
  4102. }
  4103. int lua_Joint_setCamera(lua_State* state)
  4104. {
  4105. // Get the number of parameters.
  4106. int paramCount = lua_gettop(state);
  4107. // Attempt to match the parameters to a valid binding.
  4108. switch (paramCount)
  4109. {
  4110. case 2:
  4111. {
  4112. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4113. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4114. {
  4115. // Get parameter 1 off the stack.
  4116. Camera* param1 = ScriptController::getInstance()->getObjectPointer<Camera>(2, "Camera", false);
  4117. Joint* instance = getInstance(state);
  4118. instance->setCamera(param1);
  4119. return 0;
  4120. }
  4121. else
  4122. {
  4123. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4124. lua_error(state);
  4125. }
  4126. break;
  4127. }
  4128. default:
  4129. {
  4130. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4131. lua_error(state);
  4132. break;
  4133. }
  4134. }
  4135. return 0;
  4136. }
  4137. int lua_Joint_setCollisionObject(lua_State* state)
  4138. {
  4139. // Get the number of parameters.
  4140. int paramCount = lua_gettop(state);
  4141. // Attempt to match the parameters to a valid binding.
  4142. switch (paramCount)
  4143. {
  4144. case 2:
  4145. {
  4146. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4147. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  4148. {
  4149. // Get parameter 1 off the stack.
  4150. PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2));
  4151. Joint* instance = getInstance(state);
  4152. void* returnPtr = (void*)instance->setCollisionObject(param1);
  4153. if (returnPtr)
  4154. {
  4155. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  4156. object->instance = returnPtr;
  4157. object->owns = false;
  4158. luaL_getmetatable(state, "PhysicsCollisionObject");
  4159. lua_setmetatable(state, -2);
  4160. }
  4161. else
  4162. {
  4163. lua_pushnil(state);
  4164. }
  4165. return 1;
  4166. }
  4167. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4168. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  4169. {
  4170. // Get parameter 1 off the stack.
  4171. const char* param1 = ScriptController::getInstance()->getString(2, false);
  4172. Joint* instance = getInstance(state);
  4173. void* returnPtr = (void*)instance->setCollisionObject(param1);
  4174. if (returnPtr)
  4175. {
  4176. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  4177. object->instance = returnPtr;
  4178. object->owns = false;
  4179. luaL_getmetatable(state, "PhysicsCollisionObject");
  4180. lua_setmetatable(state, -2);
  4181. }
  4182. else
  4183. {
  4184. lua_pushnil(state);
  4185. }
  4186. return 1;
  4187. }
  4188. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4189. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4190. {
  4191. // Get parameter 1 off the stack.
  4192. Properties* param1 = ScriptController::getInstance()->getObjectPointer<Properties>(2, "Properties", false);
  4193. Joint* instance = getInstance(state);
  4194. void* returnPtr = (void*)instance->setCollisionObject(param1);
  4195. if (returnPtr)
  4196. {
  4197. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  4198. object->instance = returnPtr;
  4199. object->owns = false;
  4200. luaL_getmetatable(state, "PhysicsCollisionObject");
  4201. lua_setmetatable(state, -2);
  4202. }
  4203. else
  4204. {
  4205. lua_pushnil(state);
  4206. }
  4207. return 1;
  4208. }
  4209. else
  4210. {
  4211. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4212. lua_error(state);
  4213. }
  4214. break;
  4215. }
  4216. case 3:
  4217. {
  4218. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4219. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  4220. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  4221. {
  4222. // Get parameter 1 off the stack.
  4223. PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2));
  4224. // Get parameter 2 off the stack.
  4225. PhysicsCollisionShape::Definition* param2 = ScriptController::getInstance()->getObjectPointer<PhysicsCollisionShape::Definition>(3, "PhysicsCollisionShapeDefinition", true);
  4226. Joint* instance = getInstance(state);
  4227. void* returnPtr = (void*)instance->setCollisionObject(param1, *param2);
  4228. if (returnPtr)
  4229. {
  4230. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  4231. object->instance = returnPtr;
  4232. object->owns = false;
  4233. luaL_getmetatable(state, "PhysicsCollisionObject");
  4234. lua_setmetatable(state, -2);
  4235. }
  4236. else
  4237. {
  4238. lua_pushnil(state);
  4239. }
  4240. return 1;
  4241. }
  4242. else
  4243. {
  4244. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4245. lua_error(state);
  4246. }
  4247. break;
  4248. }
  4249. case 4:
  4250. {
  4251. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4252. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  4253. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  4254. (lua_type(state, 4) == LUA_TUSERDATA || lua_type(state, 4) == LUA_TNIL))
  4255. {
  4256. // Get parameter 1 off the stack.
  4257. PhysicsCollisionObject::Type param1 = (PhysicsCollisionObject::Type)lua_enumFromString_PhysicsCollisionObjectType(luaL_checkstring(state, 2));
  4258. // Get parameter 2 off the stack.
  4259. PhysicsCollisionShape::Definition* param2 = ScriptController::getInstance()->getObjectPointer<PhysicsCollisionShape::Definition>(3, "PhysicsCollisionShapeDefinition", true);
  4260. // Get parameter 3 off the stack.
  4261. PhysicsRigidBody::Parameters* param3 = ScriptController::getInstance()->getObjectPointer<PhysicsRigidBody::Parameters>(4, "PhysicsRigidBodyParameters", false);
  4262. Joint* instance = getInstance(state);
  4263. void* returnPtr = (void*)instance->setCollisionObject(param1, *param2, param3);
  4264. if (returnPtr)
  4265. {
  4266. ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
  4267. object->instance = returnPtr;
  4268. object->owns = false;
  4269. luaL_getmetatable(state, "PhysicsCollisionObject");
  4270. lua_setmetatable(state, -2);
  4271. }
  4272. else
  4273. {
  4274. lua_pushnil(state);
  4275. }
  4276. return 1;
  4277. }
  4278. else
  4279. {
  4280. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4281. lua_error(state);
  4282. }
  4283. break;
  4284. }
  4285. default:
  4286. {
  4287. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 4).");
  4288. lua_error(state);
  4289. break;
  4290. }
  4291. }
  4292. return 0;
  4293. }
  4294. int lua_Joint_setDynamic(lua_State* state)
  4295. {
  4296. // Get the number of parameters.
  4297. int paramCount = lua_gettop(state);
  4298. // Attempt to match the parameters to a valid binding.
  4299. switch (paramCount)
  4300. {
  4301. case 2:
  4302. {
  4303. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4304. lua_type(state, 2) == LUA_TBOOLEAN)
  4305. {
  4306. // Get parameter 1 off the stack.
  4307. bool param1 = ScriptController::luaCheckBool(state, 2);
  4308. Joint* instance = getInstance(state);
  4309. instance->setDynamic(param1);
  4310. return 0;
  4311. }
  4312. else
  4313. {
  4314. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4315. lua_error(state);
  4316. }
  4317. break;
  4318. }
  4319. default:
  4320. {
  4321. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4322. lua_error(state);
  4323. break;
  4324. }
  4325. }
  4326. return 0;
  4327. }
  4328. int lua_Joint_setForm(lua_State* state)
  4329. {
  4330. // Get the number of parameters.
  4331. int paramCount = lua_gettop(state);
  4332. // Attempt to match the parameters to a valid binding.
  4333. switch (paramCount)
  4334. {
  4335. case 2:
  4336. {
  4337. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4338. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4339. {
  4340. // Get parameter 1 off the stack.
  4341. Form* param1 = ScriptController::getInstance()->getObjectPointer<Form>(2, "Form", false);
  4342. Joint* instance = getInstance(state);
  4343. instance->setForm(param1);
  4344. return 0;
  4345. }
  4346. else
  4347. {
  4348. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4349. lua_error(state);
  4350. }
  4351. break;
  4352. }
  4353. default:
  4354. {
  4355. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4356. lua_error(state);
  4357. break;
  4358. }
  4359. }
  4360. return 0;
  4361. }
  4362. int lua_Joint_setId(lua_State* state)
  4363. {
  4364. // Get the number of parameters.
  4365. int paramCount = lua_gettop(state);
  4366. // Attempt to match the parameters to a valid binding.
  4367. switch (paramCount)
  4368. {
  4369. case 2:
  4370. {
  4371. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4372. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  4373. {
  4374. // Get parameter 1 off the stack.
  4375. const char* param1 = ScriptController::getInstance()->getString(2, false);
  4376. Joint* instance = getInstance(state);
  4377. instance->setId(param1);
  4378. return 0;
  4379. }
  4380. else
  4381. {
  4382. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4383. lua_error(state);
  4384. }
  4385. break;
  4386. }
  4387. default:
  4388. {
  4389. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4390. lua_error(state);
  4391. break;
  4392. }
  4393. }
  4394. return 0;
  4395. }
  4396. int lua_Joint_setIdentity(lua_State* state)
  4397. {
  4398. // Get the number of parameters.
  4399. int paramCount = lua_gettop(state);
  4400. // Attempt to match the parameters to a valid binding.
  4401. switch (paramCount)
  4402. {
  4403. case 1:
  4404. {
  4405. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL))
  4406. {
  4407. Joint* instance = getInstance(state);
  4408. instance->setIdentity();
  4409. return 0;
  4410. }
  4411. else
  4412. {
  4413. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4414. lua_error(state);
  4415. }
  4416. break;
  4417. }
  4418. default:
  4419. {
  4420. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  4421. lua_error(state);
  4422. break;
  4423. }
  4424. }
  4425. return 0;
  4426. }
  4427. int lua_Joint_setLight(lua_State* state)
  4428. {
  4429. // Get the number of parameters.
  4430. int paramCount = lua_gettop(state);
  4431. // Attempt to match the parameters to a valid binding.
  4432. switch (paramCount)
  4433. {
  4434. case 2:
  4435. {
  4436. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4437. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4438. {
  4439. // Get parameter 1 off the stack.
  4440. Light* param1 = ScriptController::getInstance()->getObjectPointer<Light>(2, "Light", false);
  4441. Joint* instance = getInstance(state);
  4442. instance->setLight(param1);
  4443. return 0;
  4444. }
  4445. else
  4446. {
  4447. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4448. lua_error(state);
  4449. }
  4450. break;
  4451. }
  4452. default:
  4453. {
  4454. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4455. lua_error(state);
  4456. break;
  4457. }
  4458. }
  4459. return 0;
  4460. }
  4461. int lua_Joint_setModel(lua_State* state)
  4462. {
  4463. // Get the number of parameters.
  4464. int paramCount = lua_gettop(state);
  4465. // Attempt to match the parameters to a valid binding.
  4466. switch (paramCount)
  4467. {
  4468. case 2:
  4469. {
  4470. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4471. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4472. {
  4473. // Get parameter 1 off the stack.
  4474. Model* param1 = ScriptController::getInstance()->getObjectPointer<Model>(2, "Model", false);
  4475. Joint* instance = getInstance(state);
  4476. instance->setModel(param1);
  4477. return 0;
  4478. }
  4479. else
  4480. {
  4481. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4482. lua_error(state);
  4483. }
  4484. break;
  4485. }
  4486. default:
  4487. {
  4488. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4489. lua_error(state);
  4490. break;
  4491. }
  4492. }
  4493. return 0;
  4494. }
  4495. int lua_Joint_setParticleEmitter(lua_State* state)
  4496. {
  4497. // Get the number of parameters.
  4498. int paramCount = lua_gettop(state);
  4499. // Attempt to match the parameters to a valid binding.
  4500. switch (paramCount)
  4501. {
  4502. case 2:
  4503. {
  4504. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4505. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4506. {
  4507. // Get parameter 1 off the stack.
  4508. ParticleEmitter* param1 = ScriptController::getInstance()->getObjectPointer<ParticleEmitter>(2, "ParticleEmitter", false);
  4509. Joint* instance = getInstance(state);
  4510. instance->setParticleEmitter(param1);
  4511. return 0;
  4512. }
  4513. else
  4514. {
  4515. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4516. lua_error(state);
  4517. }
  4518. break;
  4519. }
  4520. default:
  4521. {
  4522. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4523. lua_error(state);
  4524. break;
  4525. }
  4526. }
  4527. return 0;
  4528. }
  4529. int lua_Joint_setRotation(lua_State* state)
  4530. {
  4531. // Get the number of parameters.
  4532. int paramCount = lua_gettop(state);
  4533. // Attempt to match the parameters to a valid binding.
  4534. switch (paramCount)
  4535. {
  4536. case 2:
  4537. {
  4538. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4539. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4540. {
  4541. // Get parameter 1 off the stack.
  4542. Quaternion* param1 = ScriptController::getInstance()->getObjectPointer<Quaternion>(2, "Quaternion", true);
  4543. Joint* instance = getInstance(state);
  4544. instance->setRotation(*param1);
  4545. return 0;
  4546. }
  4547. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4548. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4549. {
  4550. // Get parameter 1 off the stack.
  4551. Matrix* param1 = ScriptController::getInstance()->getObjectPointer<Matrix>(2, "Matrix", true);
  4552. Joint* instance = getInstance(state);
  4553. instance->setRotation(*param1);
  4554. return 0;
  4555. }
  4556. else
  4557. {
  4558. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4559. lua_error(state);
  4560. }
  4561. break;
  4562. }
  4563. case 3:
  4564. {
  4565. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4566. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  4567. lua_type(state, 3) == LUA_TNUMBER)
  4568. {
  4569. // Get parameter 1 off the stack.
  4570. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  4571. // Get parameter 2 off the stack.
  4572. float param2 = (float)luaL_checknumber(state, 3);
  4573. Joint* instance = getInstance(state);
  4574. instance->setRotation(*param1, param2);
  4575. return 0;
  4576. }
  4577. else
  4578. {
  4579. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4580. lua_error(state);
  4581. }
  4582. break;
  4583. }
  4584. case 5:
  4585. {
  4586. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4587. lua_type(state, 2) == LUA_TNUMBER &&
  4588. lua_type(state, 3) == LUA_TNUMBER &&
  4589. lua_type(state, 4) == LUA_TNUMBER &&
  4590. lua_type(state, 5) == LUA_TNUMBER)
  4591. {
  4592. // Get parameter 1 off the stack.
  4593. float param1 = (float)luaL_checknumber(state, 2);
  4594. // Get parameter 2 off the stack.
  4595. float param2 = (float)luaL_checknumber(state, 3);
  4596. // Get parameter 3 off the stack.
  4597. float param3 = (float)luaL_checknumber(state, 4);
  4598. // Get parameter 4 off the stack.
  4599. float param4 = (float)luaL_checknumber(state, 5);
  4600. Joint* instance = getInstance(state);
  4601. instance->setRotation(param1, param2, param3, param4);
  4602. return 0;
  4603. }
  4604. else
  4605. {
  4606. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4607. lua_error(state);
  4608. }
  4609. break;
  4610. }
  4611. default:
  4612. {
  4613. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 5).");
  4614. lua_error(state);
  4615. break;
  4616. }
  4617. }
  4618. return 0;
  4619. }
  4620. int lua_Joint_setScale(lua_State* state)
  4621. {
  4622. // Get the number of parameters.
  4623. int paramCount = lua_gettop(state);
  4624. // Attempt to match the parameters to a valid binding.
  4625. switch (paramCount)
  4626. {
  4627. case 2:
  4628. {
  4629. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4630. lua_type(state, 2) == LUA_TNUMBER)
  4631. {
  4632. // Get parameter 1 off the stack.
  4633. float param1 = (float)luaL_checknumber(state, 2);
  4634. Joint* instance = getInstance(state);
  4635. instance->setScale(param1);
  4636. return 0;
  4637. }
  4638. else if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4639. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4640. {
  4641. // Get parameter 1 off the stack.
  4642. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  4643. Joint* instance = getInstance(state);
  4644. instance->setScale(*param1);
  4645. return 0;
  4646. }
  4647. else
  4648. {
  4649. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4650. lua_error(state);
  4651. }
  4652. break;
  4653. }
  4654. case 4:
  4655. {
  4656. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4657. lua_type(state, 2) == LUA_TNUMBER &&
  4658. lua_type(state, 3) == LUA_TNUMBER &&
  4659. lua_type(state, 4) == LUA_TNUMBER)
  4660. {
  4661. // Get parameter 1 off the stack.
  4662. float param1 = (float)luaL_checknumber(state, 2);
  4663. // Get parameter 2 off the stack.
  4664. float param2 = (float)luaL_checknumber(state, 3);
  4665. // Get parameter 3 off the stack.
  4666. float param3 = (float)luaL_checknumber(state, 4);
  4667. Joint* instance = getInstance(state);
  4668. instance->setScale(param1, param2, param3);
  4669. return 0;
  4670. }
  4671. else
  4672. {
  4673. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4674. lua_error(state);
  4675. }
  4676. break;
  4677. }
  4678. default:
  4679. {
  4680. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  4681. lua_error(state);
  4682. break;
  4683. }
  4684. }
  4685. return 0;
  4686. }
  4687. int lua_Joint_setScaleX(lua_State* state)
  4688. {
  4689. // Get the number of parameters.
  4690. int paramCount = lua_gettop(state);
  4691. // Attempt to match the parameters to a valid binding.
  4692. switch (paramCount)
  4693. {
  4694. case 2:
  4695. {
  4696. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4697. lua_type(state, 2) == LUA_TNUMBER)
  4698. {
  4699. // Get parameter 1 off the stack.
  4700. float param1 = (float)luaL_checknumber(state, 2);
  4701. Joint* instance = getInstance(state);
  4702. instance->setScaleX(param1);
  4703. return 0;
  4704. }
  4705. else
  4706. {
  4707. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4708. lua_error(state);
  4709. }
  4710. break;
  4711. }
  4712. default:
  4713. {
  4714. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4715. lua_error(state);
  4716. break;
  4717. }
  4718. }
  4719. return 0;
  4720. }
  4721. int lua_Joint_setScaleY(lua_State* state)
  4722. {
  4723. // Get the number of parameters.
  4724. int paramCount = lua_gettop(state);
  4725. // Attempt to match the parameters to a valid binding.
  4726. switch (paramCount)
  4727. {
  4728. case 2:
  4729. {
  4730. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4731. lua_type(state, 2) == LUA_TNUMBER)
  4732. {
  4733. // Get parameter 1 off the stack.
  4734. float param1 = (float)luaL_checknumber(state, 2);
  4735. Joint* instance = getInstance(state);
  4736. instance->setScaleY(param1);
  4737. return 0;
  4738. }
  4739. else
  4740. {
  4741. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4742. lua_error(state);
  4743. }
  4744. break;
  4745. }
  4746. default:
  4747. {
  4748. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4749. lua_error(state);
  4750. break;
  4751. }
  4752. }
  4753. return 0;
  4754. }
  4755. int lua_Joint_setScaleZ(lua_State* state)
  4756. {
  4757. // Get the number of parameters.
  4758. int paramCount = lua_gettop(state);
  4759. // Attempt to match the parameters to a valid binding.
  4760. switch (paramCount)
  4761. {
  4762. case 2:
  4763. {
  4764. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4765. lua_type(state, 2) == LUA_TNUMBER)
  4766. {
  4767. // Get parameter 1 off the stack.
  4768. float param1 = (float)luaL_checknumber(state, 2);
  4769. Joint* instance = getInstance(state);
  4770. instance->setScaleZ(param1);
  4771. return 0;
  4772. }
  4773. else
  4774. {
  4775. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4776. lua_error(state);
  4777. }
  4778. break;
  4779. }
  4780. default:
  4781. {
  4782. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4783. lua_error(state);
  4784. break;
  4785. }
  4786. }
  4787. return 0;
  4788. }
  4789. int lua_Joint_setTranslation(lua_State* state)
  4790. {
  4791. // Get the number of parameters.
  4792. int paramCount = lua_gettop(state);
  4793. // Attempt to match the parameters to a valid binding.
  4794. switch (paramCount)
  4795. {
  4796. case 2:
  4797. {
  4798. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4799. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  4800. {
  4801. // Get parameter 1 off the stack.
  4802. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  4803. Joint* instance = getInstance(state);
  4804. instance->setTranslation(*param1);
  4805. return 0;
  4806. }
  4807. else
  4808. {
  4809. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4810. lua_error(state);
  4811. }
  4812. break;
  4813. }
  4814. case 4:
  4815. {
  4816. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4817. lua_type(state, 2) == LUA_TNUMBER &&
  4818. lua_type(state, 3) == LUA_TNUMBER &&
  4819. lua_type(state, 4) == LUA_TNUMBER)
  4820. {
  4821. // Get parameter 1 off the stack.
  4822. float param1 = (float)luaL_checknumber(state, 2);
  4823. // Get parameter 2 off the stack.
  4824. float param2 = (float)luaL_checknumber(state, 3);
  4825. // Get parameter 3 off the stack.
  4826. float param3 = (float)luaL_checknumber(state, 4);
  4827. Joint* instance = getInstance(state);
  4828. instance->setTranslation(param1, param2, param3);
  4829. return 0;
  4830. }
  4831. else
  4832. {
  4833. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4834. lua_error(state);
  4835. }
  4836. break;
  4837. }
  4838. default:
  4839. {
  4840. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  4841. lua_error(state);
  4842. break;
  4843. }
  4844. }
  4845. return 0;
  4846. }
  4847. int lua_Joint_setTranslationX(lua_State* state)
  4848. {
  4849. // Get the number of parameters.
  4850. int paramCount = lua_gettop(state);
  4851. // Attempt to match the parameters to a valid binding.
  4852. switch (paramCount)
  4853. {
  4854. case 2:
  4855. {
  4856. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4857. lua_type(state, 2) == LUA_TNUMBER)
  4858. {
  4859. // Get parameter 1 off the stack.
  4860. float param1 = (float)luaL_checknumber(state, 2);
  4861. Joint* instance = getInstance(state);
  4862. instance->setTranslationX(param1);
  4863. return 0;
  4864. }
  4865. else
  4866. {
  4867. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4868. lua_error(state);
  4869. }
  4870. break;
  4871. }
  4872. default:
  4873. {
  4874. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4875. lua_error(state);
  4876. break;
  4877. }
  4878. }
  4879. return 0;
  4880. }
  4881. int lua_Joint_setTranslationY(lua_State* state)
  4882. {
  4883. // Get the number of parameters.
  4884. int paramCount = lua_gettop(state);
  4885. // Attempt to match the parameters to a valid binding.
  4886. switch (paramCount)
  4887. {
  4888. case 2:
  4889. {
  4890. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4891. lua_type(state, 2) == LUA_TNUMBER)
  4892. {
  4893. // Get parameter 1 off the stack.
  4894. float param1 = (float)luaL_checknumber(state, 2);
  4895. Joint* instance = getInstance(state);
  4896. instance->setTranslationY(param1);
  4897. return 0;
  4898. }
  4899. else
  4900. {
  4901. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4902. lua_error(state);
  4903. }
  4904. break;
  4905. }
  4906. default:
  4907. {
  4908. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4909. lua_error(state);
  4910. break;
  4911. }
  4912. }
  4913. return 0;
  4914. }
  4915. int lua_Joint_setTranslationZ(lua_State* state)
  4916. {
  4917. // Get the number of parameters.
  4918. int paramCount = lua_gettop(state);
  4919. // Attempt to match the parameters to a valid binding.
  4920. switch (paramCount)
  4921. {
  4922. case 2:
  4923. {
  4924. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4925. lua_type(state, 2) == LUA_TNUMBER)
  4926. {
  4927. // Get parameter 1 off the stack.
  4928. float param1 = (float)luaL_checknumber(state, 2);
  4929. Joint* instance = getInstance(state);
  4930. instance->setTranslationZ(param1);
  4931. return 0;
  4932. }
  4933. else
  4934. {
  4935. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4936. lua_error(state);
  4937. }
  4938. break;
  4939. }
  4940. default:
  4941. {
  4942. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4943. lua_error(state);
  4944. break;
  4945. }
  4946. }
  4947. return 0;
  4948. }
  4949. int lua_Joint_setTransparent(lua_State* state)
  4950. {
  4951. // Get the number of parameters.
  4952. int paramCount = lua_gettop(state);
  4953. // Attempt to match the parameters to a valid binding.
  4954. switch (paramCount)
  4955. {
  4956. case 2:
  4957. {
  4958. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4959. lua_type(state, 2) == LUA_TBOOLEAN)
  4960. {
  4961. // Get parameter 1 off the stack.
  4962. bool param1 = ScriptController::luaCheckBool(state, 2);
  4963. Joint* instance = getInstance(state);
  4964. instance->setTransparent(param1);
  4965. return 0;
  4966. }
  4967. else
  4968. {
  4969. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  4970. lua_error(state);
  4971. }
  4972. break;
  4973. }
  4974. default:
  4975. {
  4976. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  4977. lua_error(state);
  4978. break;
  4979. }
  4980. }
  4981. return 0;
  4982. }
  4983. int lua_Joint_setVisible(lua_State* state)
  4984. {
  4985. // Get the number of parameters.
  4986. int paramCount = lua_gettop(state);
  4987. // Attempt to match the parameters to a valid binding.
  4988. switch (paramCount)
  4989. {
  4990. case 2:
  4991. {
  4992. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  4993. lua_type(state, 2) == LUA_TBOOLEAN)
  4994. {
  4995. // Get parameter 1 off the stack.
  4996. bool param1 = ScriptController::luaCheckBool(state, 2);
  4997. Joint* instance = getInstance(state);
  4998. instance->setVisible(param1);
  4999. return 0;
  5000. }
  5001. else
  5002. {
  5003. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5004. lua_error(state);
  5005. }
  5006. break;
  5007. }
  5008. default:
  5009. {
  5010. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5011. lua_error(state);
  5012. break;
  5013. }
  5014. }
  5015. return 0;
  5016. }
  5017. int lua_Joint_static_ANIMATE_ROTATE(lua_State* state)
  5018. {
  5019. // Validate the number of parameters.
  5020. if (lua_gettop(state) > 0)
  5021. {
  5022. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5023. lua_error(state);
  5024. }
  5025. int result = Joint::ANIMATE_ROTATE;
  5026. // Push the return value onto the stack.
  5027. lua_pushinteger(state, result);
  5028. return 1;
  5029. }
  5030. int lua_Joint_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state)
  5031. {
  5032. // Validate the number of parameters.
  5033. if (lua_gettop(state) > 0)
  5034. {
  5035. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5036. lua_error(state);
  5037. }
  5038. int result = Joint::ANIMATE_ROTATE_TRANSLATE;
  5039. // Push the return value onto the stack.
  5040. lua_pushinteger(state, result);
  5041. return 1;
  5042. }
  5043. int lua_Joint_static_ANIMATE_SCALE(lua_State* state)
  5044. {
  5045. // Validate the number of parameters.
  5046. if (lua_gettop(state) > 0)
  5047. {
  5048. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5049. lua_error(state);
  5050. }
  5051. int result = Joint::ANIMATE_SCALE;
  5052. // Push the return value onto the stack.
  5053. lua_pushinteger(state, result);
  5054. return 1;
  5055. }
  5056. int lua_Joint_static_ANIMATE_SCALE_ROTATE_TRANSLATE(lua_State* state)
  5057. {
  5058. // Validate the number of parameters.
  5059. if (lua_gettop(state) > 0)
  5060. {
  5061. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5062. lua_error(state);
  5063. }
  5064. int result = Joint::ANIMATE_SCALE_ROTATE_TRANSLATE;
  5065. // Push the return value onto the stack.
  5066. lua_pushinteger(state, result);
  5067. return 1;
  5068. }
  5069. int lua_Joint_static_ANIMATE_SCALE_UNIT(lua_State* state)
  5070. {
  5071. // Validate the number of parameters.
  5072. if (lua_gettop(state) > 0)
  5073. {
  5074. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5075. lua_error(state);
  5076. }
  5077. int result = Joint::ANIMATE_SCALE_UNIT;
  5078. // Push the return value onto the stack.
  5079. lua_pushinteger(state, result);
  5080. return 1;
  5081. }
  5082. int lua_Joint_static_ANIMATE_SCALE_X(lua_State* state)
  5083. {
  5084. // Validate the number of parameters.
  5085. if (lua_gettop(state) > 0)
  5086. {
  5087. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5088. lua_error(state);
  5089. }
  5090. int result = Joint::ANIMATE_SCALE_X;
  5091. // Push the return value onto the stack.
  5092. lua_pushinteger(state, result);
  5093. return 1;
  5094. }
  5095. int lua_Joint_static_ANIMATE_SCALE_Y(lua_State* state)
  5096. {
  5097. // Validate the number of parameters.
  5098. if (lua_gettop(state) > 0)
  5099. {
  5100. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5101. lua_error(state);
  5102. }
  5103. int result = Joint::ANIMATE_SCALE_Y;
  5104. // Push the return value onto the stack.
  5105. lua_pushinteger(state, result);
  5106. return 1;
  5107. }
  5108. int lua_Joint_static_ANIMATE_SCALE_Z(lua_State* state)
  5109. {
  5110. // Validate the number of parameters.
  5111. if (lua_gettop(state) > 0)
  5112. {
  5113. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5114. lua_error(state);
  5115. }
  5116. int result = Joint::ANIMATE_SCALE_Z;
  5117. // Push the return value onto the stack.
  5118. lua_pushinteger(state, result);
  5119. return 1;
  5120. }
  5121. int lua_Joint_static_ANIMATE_TRANSLATE(lua_State* state)
  5122. {
  5123. // Validate the number of parameters.
  5124. if (lua_gettop(state) > 0)
  5125. {
  5126. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5127. lua_error(state);
  5128. }
  5129. int result = Joint::ANIMATE_TRANSLATE;
  5130. // Push the return value onto the stack.
  5131. lua_pushinteger(state, result);
  5132. return 1;
  5133. }
  5134. int lua_Joint_static_ANIMATE_TRANSLATE_X(lua_State* state)
  5135. {
  5136. // Validate the number of parameters.
  5137. if (lua_gettop(state) > 0)
  5138. {
  5139. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5140. lua_error(state);
  5141. }
  5142. int result = Joint::ANIMATE_TRANSLATE_X;
  5143. // Push the return value onto the stack.
  5144. lua_pushinteger(state, result);
  5145. return 1;
  5146. }
  5147. int lua_Joint_static_ANIMATE_TRANSLATE_Y(lua_State* state)
  5148. {
  5149. // Validate the number of parameters.
  5150. if (lua_gettop(state) > 0)
  5151. {
  5152. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5153. lua_error(state);
  5154. }
  5155. int result = Joint::ANIMATE_TRANSLATE_Y;
  5156. // Push the return value onto the stack.
  5157. lua_pushinteger(state, result);
  5158. return 1;
  5159. }
  5160. int lua_Joint_static_ANIMATE_TRANSLATE_Z(lua_State* state)
  5161. {
  5162. // Validate the number of parameters.
  5163. if (lua_gettop(state) > 0)
  5164. {
  5165. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5166. lua_error(state);
  5167. }
  5168. int result = Joint::ANIMATE_TRANSLATE_Z;
  5169. // Push the return value onto the stack.
  5170. lua_pushinteger(state, result);
  5171. return 1;
  5172. }
  5173. int lua_Joint_static_isTransformChangedSuspended(lua_State* state)
  5174. {
  5175. // Get the number of parameters.
  5176. int paramCount = lua_gettop(state);
  5177. // Attempt to match the parameters to a valid binding.
  5178. switch (paramCount)
  5179. {
  5180. case 0:
  5181. {
  5182. bool result = Joint::isTransformChangedSuspended();
  5183. // Push the return value onto the stack.
  5184. lua_pushboolean(state, result);
  5185. return 1;
  5186. break;
  5187. }
  5188. default:
  5189. {
  5190. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5191. lua_error(state);
  5192. break;
  5193. }
  5194. }
  5195. return 0;
  5196. }
  5197. int lua_Joint_static_resumeTransformChanged(lua_State* state)
  5198. {
  5199. // Get the number of parameters.
  5200. int paramCount = lua_gettop(state);
  5201. // Attempt to match the parameters to a valid binding.
  5202. switch (paramCount)
  5203. {
  5204. case 0:
  5205. {
  5206. Joint::resumeTransformChanged();
  5207. return 0;
  5208. break;
  5209. }
  5210. default:
  5211. {
  5212. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5213. lua_error(state);
  5214. break;
  5215. }
  5216. }
  5217. return 0;
  5218. }
  5219. int lua_Joint_static_suspendTransformChanged(lua_State* state)
  5220. {
  5221. // Get the number of parameters.
  5222. int paramCount = lua_gettop(state);
  5223. // Attempt to match the parameters to a valid binding.
  5224. switch (paramCount)
  5225. {
  5226. case 0:
  5227. {
  5228. Joint::suspendTransformChanged();
  5229. return 0;
  5230. break;
  5231. }
  5232. default:
  5233. {
  5234. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  5235. lua_error(state);
  5236. break;
  5237. }
  5238. }
  5239. return 0;
  5240. }
  5241. int lua_Joint_transformPoint(lua_State* state)
  5242. {
  5243. // Get the number of parameters.
  5244. int paramCount = lua_gettop(state);
  5245. // Attempt to match the parameters to a valid binding.
  5246. switch (paramCount)
  5247. {
  5248. case 2:
  5249. {
  5250. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5251. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  5252. {
  5253. // Get parameter 1 off the stack.
  5254. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  5255. Joint* instance = getInstance(state);
  5256. instance->transformPoint(param1);
  5257. return 0;
  5258. }
  5259. else
  5260. {
  5261. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5262. lua_error(state);
  5263. }
  5264. break;
  5265. }
  5266. case 3:
  5267. {
  5268. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5269. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  5270. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  5271. {
  5272. // Get parameter 1 off the stack.
  5273. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  5274. // Get parameter 2 off the stack.
  5275. Vector3* param2 = ScriptController::getInstance()->getObjectPointer<Vector3>(3, "Vector3", false);
  5276. Joint* instance = getInstance(state);
  5277. instance->transformPoint(*param1, param2);
  5278. return 0;
  5279. }
  5280. else
  5281. {
  5282. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5283. lua_error(state);
  5284. }
  5285. break;
  5286. }
  5287. default:
  5288. {
  5289. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  5290. lua_error(state);
  5291. break;
  5292. }
  5293. }
  5294. return 0;
  5295. }
  5296. int lua_Joint_transformVector(lua_State* state)
  5297. {
  5298. // Get the number of parameters.
  5299. int paramCount = lua_gettop(state);
  5300. // Attempt to match the parameters to a valid binding.
  5301. switch (paramCount)
  5302. {
  5303. case 2:
  5304. {
  5305. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5306. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  5307. {
  5308. // Get parameter 1 off the stack.
  5309. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", false);
  5310. Joint* instance = getInstance(state);
  5311. instance->transformVector(param1);
  5312. return 0;
  5313. }
  5314. else
  5315. {
  5316. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5317. lua_error(state);
  5318. }
  5319. break;
  5320. }
  5321. case 3:
  5322. {
  5323. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5324. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  5325. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  5326. {
  5327. // Get parameter 1 off the stack.
  5328. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  5329. // Get parameter 2 off the stack.
  5330. Vector3* param2 = ScriptController::getInstance()->getObjectPointer<Vector3>(3, "Vector3", false);
  5331. Joint* instance = getInstance(state);
  5332. instance->transformVector(*param1, param2);
  5333. return 0;
  5334. }
  5335. else
  5336. {
  5337. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5338. lua_error(state);
  5339. }
  5340. break;
  5341. }
  5342. case 6:
  5343. {
  5344. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5345. lua_type(state, 2) == LUA_TNUMBER &&
  5346. lua_type(state, 3) == LUA_TNUMBER &&
  5347. lua_type(state, 4) == LUA_TNUMBER &&
  5348. lua_type(state, 5) == LUA_TNUMBER &&
  5349. (lua_type(state, 6) == LUA_TUSERDATA || lua_type(state, 6) == LUA_TNIL))
  5350. {
  5351. // Get parameter 1 off the stack.
  5352. float param1 = (float)luaL_checknumber(state, 2);
  5353. // Get parameter 2 off the stack.
  5354. float param2 = (float)luaL_checknumber(state, 3);
  5355. // Get parameter 3 off the stack.
  5356. float param3 = (float)luaL_checknumber(state, 4);
  5357. // Get parameter 4 off the stack.
  5358. float param4 = (float)luaL_checknumber(state, 5);
  5359. // Get parameter 5 off the stack.
  5360. Vector3* param5 = ScriptController::getInstance()->getObjectPointer<Vector3>(6, "Vector3", false);
  5361. Joint* instance = getInstance(state);
  5362. instance->transformVector(param1, param2, param3, param4, param5);
  5363. return 0;
  5364. }
  5365. else
  5366. {
  5367. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5368. lua_error(state);
  5369. }
  5370. break;
  5371. }
  5372. default:
  5373. {
  5374. lua_pushstring(state, "Invalid number of parameters (expected 2, 3 or 6).");
  5375. lua_error(state);
  5376. break;
  5377. }
  5378. }
  5379. return 0;
  5380. }
  5381. int lua_Joint_translate(lua_State* state)
  5382. {
  5383. // Get the number of parameters.
  5384. int paramCount = lua_gettop(state);
  5385. // Attempt to match the parameters to a valid binding.
  5386. switch (paramCount)
  5387. {
  5388. case 2:
  5389. {
  5390. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5391. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  5392. {
  5393. // Get parameter 1 off the stack.
  5394. Vector3* param1 = ScriptController::getInstance()->getObjectPointer<Vector3>(2, "Vector3", true);
  5395. Joint* instance = getInstance(state);
  5396. instance->translate(*param1);
  5397. return 0;
  5398. }
  5399. else
  5400. {
  5401. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5402. lua_error(state);
  5403. }
  5404. break;
  5405. }
  5406. case 4:
  5407. {
  5408. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5409. lua_type(state, 2) == LUA_TNUMBER &&
  5410. lua_type(state, 3) == LUA_TNUMBER &&
  5411. lua_type(state, 4) == LUA_TNUMBER)
  5412. {
  5413. // Get parameter 1 off the stack.
  5414. float param1 = (float)luaL_checknumber(state, 2);
  5415. // Get parameter 2 off the stack.
  5416. float param2 = (float)luaL_checknumber(state, 3);
  5417. // Get parameter 3 off the stack.
  5418. float param3 = (float)luaL_checknumber(state, 4);
  5419. Joint* instance = getInstance(state);
  5420. instance->translate(param1, param2, param3);
  5421. return 0;
  5422. }
  5423. else
  5424. {
  5425. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5426. lua_error(state);
  5427. }
  5428. break;
  5429. }
  5430. default:
  5431. {
  5432. lua_pushstring(state, "Invalid number of parameters (expected 2 or 4).");
  5433. lua_error(state);
  5434. break;
  5435. }
  5436. }
  5437. return 0;
  5438. }
  5439. int lua_Joint_translateForward(lua_State* state)
  5440. {
  5441. // Get the number of parameters.
  5442. int paramCount = lua_gettop(state);
  5443. // Attempt to match the parameters to a valid binding.
  5444. switch (paramCount)
  5445. {
  5446. case 2:
  5447. {
  5448. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5449. lua_type(state, 2) == LUA_TNUMBER)
  5450. {
  5451. // Get parameter 1 off the stack.
  5452. float param1 = (float)luaL_checknumber(state, 2);
  5453. Joint* instance = getInstance(state);
  5454. instance->translateForward(param1);
  5455. return 0;
  5456. }
  5457. else
  5458. {
  5459. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5460. lua_error(state);
  5461. }
  5462. break;
  5463. }
  5464. default:
  5465. {
  5466. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5467. lua_error(state);
  5468. break;
  5469. }
  5470. }
  5471. return 0;
  5472. }
  5473. int lua_Joint_translateLeft(lua_State* state)
  5474. {
  5475. // Get the number of parameters.
  5476. int paramCount = lua_gettop(state);
  5477. // Attempt to match the parameters to a valid binding.
  5478. switch (paramCount)
  5479. {
  5480. case 2:
  5481. {
  5482. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5483. lua_type(state, 2) == LUA_TNUMBER)
  5484. {
  5485. // Get parameter 1 off the stack.
  5486. float param1 = (float)luaL_checknumber(state, 2);
  5487. Joint* instance = getInstance(state);
  5488. instance->translateLeft(param1);
  5489. return 0;
  5490. }
  5491. else
  5492. {
  5493. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5494. lua_error(state);
  5495. }
  5496. break;
  5497. }
  5498. default:
  5499. {
  5500. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5501. lua_error(state);
  5502. break;
  5503. }
  5504. }
  5505. return 0;
  5506. }
  5507. int lua_Joint_translateUp(lua_State* state)
  5508. {
  5509. // Get the number of parameters.
  5510. int paramCount = lua_gettop(state);
  5511. // Attempt to match the parameters to a valid binding.
  5512. switch (paramCount)
  5513. {
  5514. case 2:
  5515. {
  5516. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5517. lua_type(state, 2) == LUA_TNUMBER)
  5518. {
  5519. // Get parameter 1 off the stack.
  5520. float param1 = (float)luaL_checknumber(state, 2);
  5521. Joint* instance = getInstance(state);
  5522. instance->translateUp(param1);
  5523. return 0;
  5524. }
  5525. else
  5526. {
  5527. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5528. lua_error(state);
  5529. }
  5530. break;
  5531. }
  5532. default:
  5533. {
  5534. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5535. lua_error(state);
  5536. break;
  5537. }
  5538. }
  5539. return 0;
  5540. }
  5541. int lua_Joint_translateX(lua_State* state)
  5542. {
  5543. // Get the number of parameters.
  5544. int paramCount = lua_gettop(state);
  5545. // Attempt to match the parameters to a valid binding.
  5546. switch (paramCount)
  5547. {
  5548. case 2:
  5549. {
  5550. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5551. lua_type(state, 2) == LUA_TNUMBER)
  5552. {
  5553. // Get parameter 1 off the stack.
  5554. float param1 = (float)luaL_checknumber(state, 2);
  5555. Joint* instance = getInstance(state);
  5556. instance->translateX(param1);
  5557. return 0;
  5558. }
  5559. else
  5560. {
  5561. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5562. lua_error(state);
  5563. }
  5564. break;
  5565. }
  5566. default:
  5567. {
  5568. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5569. lua_error(state);
  5570. break;
  5571. }
  5572. }
  5573. return 0;
  5574. }
  5575. int lua_Joint_translateY(lua_State* state)
  5576. {
  5577. // Get the number of parameters.
  5578. int paramCount = lua_gettop(state);
  5579. // Attempt to match the parameters to a valid binding.
  5580. switch (paramCount)
  5581. {
  5582. case 2:
  5583. {
  5584. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5585. lua_type(state, 2) == LUA_TNUMBER)
  5586. {
  5587. // Get parameter 1 off the stack.
  5588. float param1 = (float)luaL_checknumber(state, 2);
  5589. Joint* instance = getInstance(state);
  5590. instance->translateY(param1);
  5591. return 0;
  5592. }
  5593. else
  5594. {
  5595. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5596. lua_error(state);
  5597. }
  5598. break;
  5599. }
  5600. default:
  5601. {
  5602. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5603. lua_error(state);
  5604. break;
  5605. }
  5606. }
  5607. return 0;
  5608. }
  5609. int lua_Joint_translateZ(lua_State* state)
  5610. {
  5611. // Get the number of parameters.
  5612. int paramCount = lua_gettop(state);
  5613. // Attempt to match the parameters to a valid binding.
  5614. switch (paramCount)
  5615. {
  5616. case 2:
  5617. {
  5618. if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TNIL) &&
  5619. lua_type(state, 2) == LUA_TNUMBER)
  5620. {
  5621. // Get parameter 1 off the stack.
  5622. float param1 = (float)luaL_checknumber(state, 2);
  5623. Joint* instance = getInstance(state);
  5624. instance->translateZ(param1);
  5625. return 0;
  5626. }
  5627. else
  5628. {
  5629. lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
  5630. lua_error(state);
  5631. }
  5632. break;
  5633. }
  5634. default:
  5635. {
  5636. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  5637. lua_error(state);
  5638. break;
  5639. }
  5640. }
  5641. return 0;
  5642. }
  5643. }